This is a test version of Biostars. For the public version, visit https://www.biostars.org.
extracting sequence from large fasta file

I want to extract subsequences from a large fasta file. For example, I need to extract the subsequence from location 46 to 3615 for the id IWGSC_scaff_1308330. I have 1500 such ids and each id contains a range. Is there any script available?

fasta
samtools faidx <ref.fasta> [region1 [...]]

does it.

1 answer

Load sequence in a java String or StringBuilder and get the substring between your two positions

Log in to answer this question.