Question: cut the sequence from fasta file
0
gravatar for harry
16 months ago by
harry10
harry10 wrote:

gggggaattggaggttttatcaaagtaagacagtatgatcagatactcatagaaatctgcggacataaagc

Ex- I have like this whole fasta sequence . i want to extract particular sequence like if i want 5 to 20 sequence only from my fasta sequence. then how i extract those sequence. thanks

sequence • 801 views
ADD COMMENTlink modified 16 months ago by finswimmer14k • written 16 months ago by harry10
1
gravatar for Benn
16 months ago by
Benn8.0k
Netherlands
Benn8.0k wrote:

You can use a tool called fastx. Use fastx-trimmer and give it the start and end position of your selection (in your case 5 to 20).

fastx_trimmer -f 5 -l 20 -i input.fasta -o output.fasta

See here for the instructions.

http://hannonlab.cshl.edu/fastx_toolkit/commandline.html#fastx_trimmer_usage

ADD COMMENTlink modified 16 months ago • written 16 months ago by Benn8.0k
1
gravatar for genomax
16 months ago by
genomax92k
United States
genomax92k wrote:

It is not clear if you want to cut the sequence you pasted above from your sequences or if you just want to identify fasta sequences that contain that sequence. In either case you can use bbduk.sh from BBMap suite to do either. A guide is available here. Sequence you are looking for can be provided via a file or using literal=actual_sequence option.

ADD COMMENTlink modified 16 months ago • written 16 months ago by genomax92k
1
gravatar for finswimmer
16 months ago by
finswimmer14k
Germany
finswimmer14k wrote:

What you are showing is not a valid fasta file, because the id is missing.

Assuming you have my.fasta file with this content:

>my_sequence
gggggaattggaggttttatcaaagtaagacagtatgatcagatactcatagaaatctgcggacataaagc

You can use samtools faidx

$ samtools faidx my.fasta my_sequence:5-20
ADD COMMENTlink written 16 months ago by finswimmer14k
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: 1084 users visited in the last hour