Created
July 19, 2017 14:27
-
-
Save mdshw5/d1e4af5ef83a04630175f0dcc0638b6a to your computer and use it in GitHub Desktop.
biostars 263478
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pyfaidx import Fasta | |
with Fasta('input.fasta') as fasta: | |
with open('pos.txt', 'r') as nucleotides: | |
for line in nucleotides: | |
chrom, pos = line.rstrip().split() | |
nuc = fasta[chrom][int(pos)].seq | |
print("{chrom}\t{pos}\t{nuc}".format(**locals())) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment