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
)
评论列表
文章目录