Question: error in fasta sequence extraction based on gene ID
0
gravatar for Bioinfonext
3.3 years ago by
Bioinfonext220
Korea
Bioinfonext220 wrote:

My fasta file header is like this:

>MSTRG.8.1 gene=MSTRG.8

AATCGACCAGAACGTTGACGACTTCTTGAAGCTTATAGCCGATCTCAACAATCTCAACATTGAGATTCCA

>MSTRG.10.1 gene=MSTRG.10

TCATCAGACTCTTCCGCAACCAATACTTCTACCCTTCAGAAGCTCCCTATCAAAGTAGGAATCTTTTATA

>MSTRG.10.2 gene=MSTRG.10

TTCTACCCTTCAGAAGCTCCCTATCAAAGACAAATCTACAGGTCATGTGACTAAAGA

And gene Id is like this:

MSTRG.8.1       gene=MSTRG.8

MSTRG.10.1      gene=MSTRG.10

MSTRG.10.2   gene=MSTRG.10

Could you please help How I can extract sequences for these gene ids from fasta file.

If I trim header of both file then I can able extract, but I need the same header in my fasta files.

Thanks

rna-seq • 920 views
ADD COMMENTlink modified 3.3 years ago by genomax87k • written 3.3 years ago by Bioinfonext220
2

it's a frequently asked question, please search on this site.

ADD REPLYlink written 3.3 years ago by shenwei3565.2k
3
gravatar for shenwei356
3.3 years ago by
shenwei3565.2k
China
shenwei3565.2k wrote:

seqkit

seqkit grep -n -f ids.txt seqs.fa
ADD COMMENTlink written 3.3 years ago by shenwei3565.2k

Thanks, it is resolved

ADD REPLYlink written 3.3 years ago by Bioinfonext220
0
gravatar for genomax
3.3 years ago by
genomax87k
United States
genomax87k wrote:

I had answered a very similar question on the site yesterday. : C: How to remove sequences from a fasta file based on ID list? The question there was to remove sequences but can also be used in this case with a minor modification of the command line.

nabiyogesh : It is tempting to get an immediate answer by posting a question the moment you encounter it but you should spend some time doing an effort on your part as suggested by @shenwei356. It would help you find other interesting things as you look through the search results trying to find one you can use.

ADD COMMENTlink modified 3.3 years ago • written 3.3 years ago by genomax87k

yes, I will surely try to improve myself.

ADD REPLYlink written 3.3 years ago by Bioinfonext220
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 661 users visited in the last hour