Question: cut the sequence from fasta file
0
gravatar for harry
4 weeks 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 • 128 views
ADD COMMENTlink modified 4 weeks ago by finswimmer12k • written 4 weeks ago by harry0
1
gravatar for Benn
4 weeks ago by
Benn7.5k
Netherlands
Benn7.5k 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 4 weeks ago • written 4 weeks ago by Benn7.5k
1
gravatar for genomax
4 weeks ago by
genomax70k
United States
genomax70k 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 4 weeks ago • written 4 weeks ago by genomax70k
1
gravatar for finswimmer
4 weeks ago by
finswimmer12k
Germany
finswimmer12k 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 4 weeks ago by finswimmer12k
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: 845 users visited in the last hour