This is a test version of Biostars. For the public version, visit https://www.biostars.org.
get dna sequence from chromosome, start, and end

Hello!

Is there a standard way to retrieve a sequence of dna given the chromosome number, start position, and end position? I am using biopython. I would like to do all of this locally without having to query an external source (as was suggested here How To Fetch Genomics Sequence Using Coordinates In Biopython). I have fasta files for the human chromosomes available locally (http://hgdownload.cse.ucsc.edu/goldenpath/hg19/chromosomes/) but have been unable to find a standard way to query them based on position.

Thanks!

sequence python biopython

1 answer

Sounds like this would be useful Pyfaidx: Efficient, "Pythonic" Random Access To Fasta Files Using Samtools-Compatible Indexing

BTW, there are convenient examples in the github repo.

You're doing my job for me :).

Log in to answer this question.