errorplot.py 文件源码

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

项目:IgDiscover 作者: NBISweden 项目源码 文件源码
def main(args):
    table = read_table(args.table)

    # Discard rows with any mutation within J at all
    logger.info('%s rows read', len(table))
    if not args.ignore_J:
        # Discard rows with any mutation within J at all
        table = table[table.J_SHM == 0][:]
        logger.info('%s rows remain after discarding J%%SHM > 0', len(table))

    if args.minimum_group_size is None:
        total = len(table)
        minimum_group_size = min(total // 1000, 100)
        logger.info('Skipping genes with less than %s assignments', minimum_group_size)
    else:
        minimum_group_size = args.minimum_group_size
    n = 0
    too_few = 0
    with PdfPages(args.pdf) as pages:
        for gene, group in table.groupby('V_gene'):
            if len(group) < minimum_group_size:
                too_few += 1
                continue
            fig = plot_difference_histogram(group, gene)
            n += 1
            FigureCanvasPdf(fig).print_figure(pages, bbox_inches='tight')
    logger.info('%s plots created (%s skipped because of too few sequences)', n, too_few)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号