bam.py 文件源码

python
阅读 35 收藏 0 点赞 0 评论 0

项目:XYalign 作者: WilsonSayresLab 项目源码 文件源码
def index_bam(self):
        """
        Indexes a bam using samtools ('samtools index file.bam').

        Returns
        -------

        bool
            True if successful.

        Raises
        ------

        RuntimeError
            If return code from external call is not 0.

        """
        self.logger.info("Indexing bam file: {}".format(self.filepath))
        idx_start = time.time()
        rc = subprocess.call([self.samtools, "index", self.filepath])
        if rc == 0:
            self.logger.info("Indexing complete. Elapsed time: {} seconds".format(
                time.time() - idx_start))
            return True
        else:
            self.logger.error("Unable to index bamfile {}. Exiting".format(
                self.filepath))
            logging.shutdown()
            raise RuntimeError("Unable to index bamfile. Exiting")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号