Skip to content

Commit

Permalink
Merge pull request #38 from betteridiot/fix_nnocoord
Browse files Browse the repository at this point in the history
Fixing style errors.
  • Loading branch information
betteridiot authored Aug 9, 2019
2 parents cfacc9b + 9188963 commit 4f86bb6
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions bamnostic/bam.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,15 +327,21 @@ def _init_index(self):
"""Initialize the index file (BAI)"""

if self._check_idx:
#self._index = bamnostic.bai.Bai(self._index_path)
if self._index_ext == 'csi':
# self._index = bamnostic.bai.Bai(self._index_path)
if self._index_ext == "csi":
self._index = csi.Csi(self._index_path)
elif self._index_ext == 'bai':
elif self._index_ext == "bai":
self._index = bai.Bai(self._index_path)

self.__nocoordinate = self._index.n_no_coor
self.__mapped = sum(self._index.unmapped[mapped].n_mapped for mapped in self._index.unmapped) + (self.nocoordinate if self.nocoordinate is not None else 0)
self.__unmapped = sum(self._index.unmapped[unmapped].n_unmapped for unmapped in self._index.unmapped) + (self.nocoordinate if self.nocoordinate is not None else 0)
self.__mapped = sum(
self._index.unmapped[mapped].n_mapped
for mapped in self._index.unmapped
) + (self.nocoordinate if self.nocoordinate is not None else 0)
self.__unmapped = sum(
self._index.unmapped[unmapped].n_unmapped
for unmapped in self._index.unmapped
) + (self.nocoordinate if self.nocoordinate is not None else 0)

@property
def nocoordinate(self):
Expand Down

0 comments on commit 4f86bb6

Please sign in to comment.