Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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 = csi.Csi(self._index_path)
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)