def merge_same_files(sample1_dfs, sample2_dfs, nb_cpu):
# type: (List[pd.DataFrame], List[pd.DataFrame], int) -> List[pd.DataFrame]
# if one list is missing a chromosome, we might pair up the wrong dataframes
# therefore creating dicts beforehand to ensure they are paired up properly
d1, d2 = ensure_same_chromosomes_in_list(sample1_dfs,
sample2_dfs)
assert len(d1) == len(d2)
logging.info("Merging same class data.")
merged_chromosome_dfs = Parallel(n_jobs=nb_cpu)(delayed(_merge_same_files)(
d1[chromosome],
d2[chromosome]) for chromosome in d1.keys())
return merged_chromosome_dfs
评论列表
文章目录