This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to extract partial sequences from an DNA alignment in fasta format

Dear community,

I have a long DNA sequence alignment in fasta format (I prefer to open the alignment in MEGA). Now I want to extract partial sequences from the alignment and save as a different file. Do you know if there is a easy way to perform such a task? I may delete un-needed regions and keep only the region needed, and save the remaining sequences, but the problem is that I need to extract many different regions from the alignment. Please let me know if you have a simple solution that can save time and labour.

Thanks.

Yongjie

sequence

Thanks for your answers. That really helps, esp. the former. For the latter, I found the outputs are not from the start to end positions indicated; they are actually the region from "the start position + 1" to "the start + end". For example, perl select_sites.pl Mitogenome_aligned.fas 50 500 extract the region from 51 to 550.

2 answers

The "selectSites.pl" script on this site may help you.

This script does what you want. Feel free to modify according to your needs.

Log in to answer this question.