def _normalize_sv_coverage_gatk(group_id, inputs, backgrounds, work_dir, back_files, out_files):
    """Normalize CNV coverage using panel of normals with GATK's de-noise approaches.
    """
    input_backs = set(filter(lambda x: x is not None,
                             [dd.get_background_cnv_reference(d, "gatk-cnv") for d in inputs]))
    if input_backs:
        assert len(input_backs) == 1, "Multiple backgrounds in group: %s" % list(input_backs)
        pon = list(input_backs)[0]
    elif backgrounds:
        pon = gatkcnv.create_panel_of_normals(backgrounds, group_id, work_dir)
    else:
        pon = None
    for data in inputs:
        work_dir = utils.safe_makedir(os.path.join(dd.get_work_dir(data), "structural",
                                                   dd.get_sample_name(data), "bins"))
        denoise_file = gatkcnv.denoise(data, pon, work_dir)
        out_files[dd.get_sample_name(data)] = denoise_file
        back_files[dd.get_sample_name(data)] = pon
    return back_files, out_files
def _normalize_sv_coverage_gatk ( group_id , inputs , backgrounds , work_dir , back_files , out_files ) : input_backs = set ( filter ( lambda x : x is not None , [ dd . get_background_cnv_reference ( d , "gatk-cnv" ) for d in inputs ] ) ) if input_backs : assert len ( input_backs ) == 1 , "Multiple backgrounds in group: %s" % list ( input_backs ) pon = list ( input_backs ) [ 0 ] elif backgrounds : pon = gatkcnv . create_panel_of_normals ( backgrounds , group_id , work_dir ) else : pon = None for data in inputs : work_dir = utils . safe_makedir ( os . path . join ( dd . get_work_dir ( data ) , "structural" , dd . get_sample_name ( data ) , "bins" ) ) denoise_file = gatkcnv . denoise ( data , pon , work_dir ) out_files [ dd . get_sample_name ( data ) ] = denoise_file back_files [ dd . get_sample_name ( data ) ] = pon return back_files , out_files
Normalize CNV coverage using panel of normals with GATK's de-noise approaches.