file_utils.py 文件源码

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

项目:pheweb 作者: statgen 项目源码 文件源码
def convert_VariantFile_to_IndexedVariantFile(vf_path, ivf_path):
    from .load.cffi._x import ffi, lib
    make_basedir(ivf_path)
    tmp_path = get_tmp_path(ivf_path)
    args = [
        ffi.new('char[]', vf_path.encode('utf8')),
        ffi.new('char[]', tmp_path.encode('utf8')),
        ffi.new('char[]', b'#'),
    ]
    lib.cffi_bgzip_file(*args)
    os.rename(tmp_path, ivf_path)

    pysam.tabix_index(
        filename=ivf_path, force=True,
        seq_col=0, start_col=1, end_col=1 # note: these are 0-based, but `/usr/bin/tabix` is 1-based
    )
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号