Thursday 9 July 2015

Get the nth base from a certain chromosome in a fasta file

I was trying to write my own tool to do this, but I doubt I could make it run as fast or faster than an existing tool.

Turns out samtools does the trick.

http://seqanswers.com/forums/showthread.php?t=17315

samtools faidx <fasta.fa> <seq>:<pos>-<pos>

For example, to get the 6078th base in chr 3:
samtools faidx <fasta.fa> chr3:6078-6078

No comments:

Post a Comment