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