Skip to content

Commit

Permalink
Use memory map to speed up genome reference retrival (small fix)
Browse files Browse the repository at this point in the history
  • Loading branch information
jordeu committed Mar 21, 2016
1 parent 703d3eb commit 844e663
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions transvar/faidx.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
""" faidx python code adapted from Allen Yu
http://www.allenyu.info/item/24-quickly-fetch-sequence-from-samtools-faidx-indexed-fasta-sequences.html """
import sys

import mmap

from err import *
Expand Down Expand Up @@ -88,10 +87,7 @@ def fetch_sequence(self, chrom, start, end):

def __exit__(self, type, value, traceback):
self.fasta_handle.close()

if self.use_mmap:
self.fasta_fd.close()

self.fasta_fd.close()
self.faidx_handle.close()

def chrm2len(self, chrm):
Expand Down

0 comments on commit 844e663

Please sign in to comment.