Biostar Beta. Not for public use.
How To Rename FASTA Headers
0
Entering edit mode
15 months ago
kari_vo3 • 0

Hello, i want to change the fasta header of this input file :

>M04631:312:000000000-C6V6K:1:2107:11495:1734 1:N:0:ACTGAGCG+TTATGCGA

>M04631:312:000000000-C6V6K:1:2107:13059:1785 1:N:0:ACTGAGCG+TTATGCGA

In this fasta header:

>adjH001

>adjH002

>adjH....

>adjH099

>adjH100

what script do I have to use??

next-gen • 278 views
ADD COMMENTlink
0
Entering edit mode

Looks like you have MiSeq data, please provide the actual context about what you're doing. It should include the words "MiSeq" and "fastq". It's highly unlikely that your actual question will end up actually renaming fasta entries.

ADD REPLYlink
0
Entering edit mode

You need to explain your naming convention further. There’s no information in those headers to generate what you’re asking for.

If you just want all the sequences named adjH followed by some number, how high should these numbers go? How many sequences do you have? Since you want them 0-padded this matters.

Are the names arbitrary in order?

ADD REPLYlink
0
Entering edit mode

i have 300000 reads and then i'll renamed them to a metagenomic analysis :

ADD REPLYlink
0
Entering edit mode

renamed them to a metagenomic analysis

That's not clear. We still don't know where the adjH001 identifiers are based on.

ADD REPLYlink
0
Entering edit mode

You need to tell us how:

>adjH001 pairs with >M04631:312:000000000-C6V6K:1:2107:11495:1734 1:N:0:ACTGAGCG+TTATGCGA

or any other sequence. Is it purely based on the order in which they occur?

ADD REPLYlink
0
Entering edit mode

You may be interested in SEDA (https://www.sing-group.org/seda/), a user-friendly GUI-based tool with a powerful option to rename FASTA headers (https://www.sing-group.org/seda/manual/operations.html#rename-header).

ADD REPLYlink
2
Entering edit mode
12 months ago
5heikki 8.4k
Finland
awk 'BEGIN{N=1;S=">adjH"}{if(/^>/){printf("%s%03d\n",S,N);N++}else{print $0}}' in.fa > out.fa
ADD COMMENTlink
0
Entering edit mode

Thank you!!!!!. It works.

ADD REPLYlink
0
Entering edit mode

If an answer was helpful you should upvote it, if the answer resolved your question you should mark it as accepted.
Upvote|Bookmark|Accept

ADD REPLYlink

Login before adding your answer.

Similar Posts
Loading Similar Posts
Powered by the version 2.1