SEQanswers

Go Back   SEQanswers > Bioinformatics > Bioinformatics



Similar Threads
Thread Thread Starter Forum Replies Last Post
Adaptor order in PE sequencing Sakti Illumina/Solexa 4 04-23-2013 09:54 AM
how to order the contigs luckylove Bioinformatics 6 06-30-2012 10:07 AM
miRNA rank order Fiji_surf General 1 03-30-2011 09:53 AM
Newbie Question, Getting my Terminology in Order Bardj General 0 01-21-2010 11:26 AM

Reply
 
Thread Tools
Old 06-20-2013, 02:02 AM   #1
evepy88
Junior Member
 
Location: Malaysia

Join Date: Dec 2011
Posts: 4
Default Command to reverse heading order

Hi everyone,

I am a very beginner for linux command and I need help in the command needed to perform this action for the heading of my contig.
Example:
I have a sentence which is in this way
> contig85 |[average coverage: 76][Limit0.01]

How am I going to rearrange it into:
> [average coverage:76][Limit 0.01] contig85

Thank you very much
XY
evepy88 is offline   Reply With Quote
Old 06-21-2013, 01:29 AM   #2
hanshart
Member
 
Location: Germany

Join Date: Nov 2011
Posts: 27
Default

Hi evepy88,
In Linux you can use awk to rearrange your fields
The following code will do the job:
Code:
awk 'BEGIN{FS="[|>]"}{print "> "$3$2}'
FS="[|>]" determines the field seperators to be "|" or ">"
$3 and $2 refer to the third and second field then.

awk can be used for every line of a file:
Code:
awk 'BEGIN{FS="[|>]"}{print "> "$3$2}' FILENAME
or with the pipe:
Code:
echo "> contig85 |[average coverage: 76][Limit0.01]" | awk 'BEGIN{FS="[|>]"}{print "> "$3$2}'
> [average coverage: 76][Limit0.01] contig85
hanshart is offline   Reply With Quote
Old 06-21-2013, 01:52 AM   #3
evepy88
Junior Member
 
Location: Malaysia

Join Date: Dec 2011
Posts: 4
Default Thanks

Thanks hanshart
evepy88 is offline   Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off




All times are GMT -8. The time now is 08:43 AM.


Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
Single Sign On provided by vBSSO