Changing Fasta Header
Dear Colleagues,
I would like to change my FASTA file header from this :
oreNil2_augustusGene_g25.t1 range=chrLG1:1047971-1161345 5'pad=0 3'pad=0 strand=+ repeatMasking=none
to this :
oreNil2_augustusGene_g25.t1
Basically removing all the lines after the space.
I know we can do this with sed or awk but my knowledge with this two commands are elementary at best. Any help here will be awesome!
regards,
Zi Yi
• 1,721 views
•
link
2 answers
You can use the BBMap package for this:
reformat.sh in=sequences.fasta out=renamed.fasta trd
"trd" stands for "trim read description" and will truncate everything after the first whitespace.
• 1 views
•
link
sed '/>/ s/\s.*$//' input.fasta > u.fasta
• 0 views
•
link
Log in to answer this question.
This perl script may help to solve your porblem:
This was answered too many times on this forum. Here is one solution
Hello wanziyi89!
We believe that this post does not fit the main topic of this site.
Please read the multitude of identical posts here.
For this reason we have closed your question. This allows us to keep the site focused on the topics that the community can help with.
If you disagree please tell us why in a reply below, we'll be happy to talk about it.
Cheers!