def get_paired_bams(align_bams, items): """Split aligned bams into tumor / normal pairs if this is a paired analysis. Allows cases with only tumor BAMs to handle callers that can work without normal BAMs or with normal VCF panels. """ tumor_bam, tumor_name, normal_bam, normal_name, normal_panel, tumor_config, normal_data = ( None, ) * 7 for bamfile, item in zip(align_bams, items): phenotype = get_paired_phenotype(item) if phenotype == "normal": normal_bam = bamfile normal_name = dd.get_sample_name(item) normal_data = item elif phenotype == "tumor": tumor_bam = bamfile tumor_name = dd.get_sample_name(item) tumor_data = item tumor_config = item["config"] normal_panel = dd.get_background_variant(item) if tumor_bam or tumor_name: return PairedData(tumor_bam, tumor_name, normal_bam, normal_name, normal_panel, tumor_config, tumor_data, normal_data)
def get_paired_bams(align_bams, items): """Split aligned bams into tumor / normal pairs if this is a paired analysis. Allows cases with only tumor BAMs to handle callers that can work without normal BAMs or with normal VCF panels. """ tumor_bam, tumor_name, normal_bam, normal_name, normal_panel, tumor_config, normal_data = (None,) * 7 for bamfile, item in zip(align_bams, items): phenotype = get_paired_phenotype(item) if phenotype == "normal": normal_bam = bamfile normal_name = dd.get_sample_name(item) normal_data = item elif phenotype == "tumor": tumor_bam = bamfile tumor_name = dd.get_sample_name(item) tumor_data = item tumor_config = item["config"] normal_panel = dd.get_background_variant(item) if tumor_bam or tumor_name: return PairedData(tumor_bam, tumor_name, normal_bam, normal_name, normal_panel, tumor_config, tumor_data, normal_data)