How to use the bamnostic.csi.Csi function in bamnostic

To help you get started, we’ve selected a few bamnostic examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github betteridiot / bamnostic / bamnostic / bam.py View on Github external
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)