Skip to content

Commit

Permalink
Update tabix reader
Browse files Browse the repository at this point in the history
  • Loading branch information
nvictus committed Feb 9, 2017
1 parent b9efd0f commit 5c0d349
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cooler/_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,8 @@ def __getstate__(self):
return d

def _size(self, chrom):
if chrom not in self.contigs:
return None
import pysam
with pysam.TabixFile(self.filepath, 'r', encoding='ascii') as f:
return sum(1 for line in f.fetch(chrom))
Expand Down

0 comments on commit 5c0d349

Please sign in to comment.