![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Extraction of a portion of a fasta header | chayan | Bioinformatics | 4 | 01-04-2015 11:50 PM |
Add count numbers to headers in a fasta file | Giorgio C | Bioinformatics | 7 | 07-08-2013 03:06 AM |
fasta header | polijana | Bioinformatics | 2 | 03-31-2013 03:01 PM |
Add header to SAM file | gormleymp | Bioinformatics | 9 | 11-14-2012 03:24 AM |
Lower case characters in FASTa reference sequence | foxyg | Bioinformatics | 5 | 09-08-2010 01:08 PM |
![]() |
|
Thread Tools |
![]() |
#1 |
Member
Location: NJ Join Date: Oct 2012
Posts: 97
|
![]()
Hi Everyone,
I have small question. How do we add characters to a start of a fasta header? I know we can add it to the end of Fasta header using this. Code:
perl -p -e 's/^(>.*)$/$1-New_Header_info/g' input.fasta > output.fasta ![]() Thank you in advance. ![]() -Zapages |
![]() |
![]() |
![]() |
#2 |
Junior Member
Location: Massachusetts Join Date: Feb 2009
Posts: 1
|
![]()
You're almost all the way there: just move the $1 to the end of the replacement string. Also, it'll be a little easier if you take the greater than (>) out of the match.
Code:
perl -p -e 's/^>(.*)/>New_Header_Info $1/' input.fasta > output.fasta |
![]() |
![]() |
![]() |
Thread Tools | |
|
|