Skip to content

Instantly share code, notes, and snippets.

@arq5x
Created September 6, 2011 01:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arq5x/1196299 to your computer and use it in GitHub Desktop.
Save arq5x/1196299 to your computer and use it in GitHub Desktop.
test
from pybedtools import BedTool
snps = BedTool('../test/data/snps.bed.gz')
genes = BedTool('../test/data/hg19.gff')
intergenic_snps = (snps - genes)
nearby = genes.closest(intergenic_snps,
d=True,
stream=True)
for gene in nearby:
if int(gene[-1]) < 5000:
print gene.name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment