Question: error in fasta sequence extraction based on gene ID
0
gravatar for Bioinfonext
2.4 years ago by
Bioinfonext160
Korea
Bioinfonext160 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 • 764 views
ADD COMMENTlink modified 2.4 years ago by genomax71k • written 2.4 years ago by Bioinfonext160
2

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

ADD REPLYlink written 2.4 years ago by shenwei3564.8k
3
gravatar for shenwei356
2.4 years ago by
shenwei3564.8k
China
shenwei3564.8k wrote:

seqkit

seqkit grep -n -f ids.txt seqs.fa
ADD COMMENTlink written 2.4 years ago by shenwei3564.8k

Thanks, it is resolved

ADD REPLYlink written 2.4 years ago by Bioinfonext160
0
gravatar for genomax
2.4 years ago by
genomax71k
United States
genomax71k 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 2.4 years ago • written 2.4 years ago by genomax71k

yes, I will surely try to improve myself.

ADD REPLYlink written 2.4 years ago by Bioinfonext160
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: 1627 users visited in the last hour