cut the sequence from fasta file
3
0
Entering edit mode
4.8 years ago
harry ▴ 30

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 • 3.6k views
ADD COMMENT
2
Entering edit mode
4.8 years ago
Benn 8.3k

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 COMMENT
1
Entering edit mode
4.8 years ago
GenoMax 141k

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 COMMENT
1
Entering edit mode
4.8 years ago

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 COMMENT

Login before adding your answer.

Traffic: 2549 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6