create_bigwigs.py 文件源码

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

项目:epic 作者: biocore-ntnu 项目源码 文件源码
def create_bigwigs(matrix, outdir, args):
    # type: (pd.DataFrame, str, Namespace) -> None
    """Create bigwigs from matrix."""
    call("mkdir -p {}".format(outdir), shell=True)
    genome_size_dict = args.chromosome_sizes

    outpaths, data = [], []
    for bed_file in matrix:
        outpath = join(outdir, splitext(basename(bed_file))[0] + ".bw")
        outpaths.append(outpath)

        bed_column = matrix[bed_file]
        bed_column = 1e6 * bed_column / bed_column.sum()
        data.append(bed_column)

    Parallel(n_jobs=args.number_cores)(delayed(_create_bigwig)(bed_column, outpath, genome_size_dict) for outpath, bed_column in zip(outpaths, data))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号