variants.py 文件源码

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

项目:XYalign 作者: WilsonSayresLab 项目源码 文件源码
def compress_vcf(self):
        """
        Compresses vcf file using bgzip.

        Returns
        -------

        bool
            True if successful

        Raises
        -------

        RuntimeError
            If return code from external call is not 0

        """
        self.logger.info("Compressing vcf file {}".format(self.filepath))
        bgzip_start = time.time()
        rc = subprocess.call([self.bgzip, "-f", self.filepath])
        if rc == 0:
            self.logger.info("Compression complete. Elapsed time: {} seconds".format(
                time.time() - bgzip_start))
            self.filepath = self.filepath + ".gz"
            return True
        else:
            self.logger.error("Unable to compress vcf file: {}. Exiting.".format(
                self.filepath))
            logging.shutdown()
            raise RuntimeError("Unable to compress vcf file. Exiting.")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号