Question: cut the sequence from fasta file
0
gravatar for harry
6 months ago by
harry0
harry0 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 • 225 views
ADD COMMENTlink modified 5 months ago by finswimmer13k • written 6 months ago by harry0
1
gravatar for Benn
6 months ago by
Benn7.9k
Netherlands
Benn7.9k 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 6 months ago • written 6 months ago by Benn7.9k
1
gravatar for genomax
6 months ago by
genomax76k
United States
genomax76k 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 6 months ago • written 6 months ago by genomax76k
1
gravatar for finswimmer
5 months ago by
finswimmer13k
Germany
finswimmer13k 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 5 months ago by finswimmer13k
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: 786 users visited in the last hour