def concat_batch_variantcalls(items, region_block=True, skip_jointcheck=False):
    """CWL entry point: combine variant calls from regions into single VCF.
    """
    items = [utils.to_single_data(x) for x in items]
    batch_name = _get_batch_name(items, skip_jointcheck)
    variantcaller = _get_batch_variantcaller(items)
    # Pre-called input variant files
    if not variantcaller and all(d.get("vrn_file") for d in items):
        return {"vrn_file": items[0]["vrn_file"]}
    out_file = os.path.join(dd.get_work_dir(items[0]), variantcaller, "%s.vcf.gz" % (batch_name))
    utils.safe_makedir(os.path.dirname(out_file))
    if region_block:
        regions = [_region_to_coords(rs[0]) for rs in items[0]["region_block"]]
    else:
        regions = [_region_to_coords(r) for r in items[0]["region"]]
    vrn_file_regions = items[0]["vrn_file_region"]
    out_file = vcfutils.concat_variant_files(vrn_file_regions, out_file, regions,
                                             dd.get_ref_file(items[0]), items[0]["config"])
    return {"vrn_file": out_file}
def concat_batch_variantcalls ( items , region_block = True , skip_jointcheck = False ) : items = [ utils . to_single_data ( x ) for x in items ] batch_name = _get_batch_name ( items , skip_jointcheck ) variantcaller = _get_batch_variantcaller ( items ) if not variantcaller and all ( d . get ( "vrn_file" ) for d in items ) : return { "vrn_file" : items [ 0 ] [ "vrn_file" ] } out_file = os . path . join ( dd . get_work_dir ( items [ 0 ] ) , variantcaller , "%s.vcf.gz" % ( batch_name ) ) utils . safe_makedir ( os . path . dirname ( out_file ) ) if region_block : regions = [ _region_to_coords ( rs [ 0 ] ) for rs in items [ 0 ] [ "region_block" ] ] else : regions = [ _region_to_coords ( r ) for r in items [ 0 ] [ "region" ] ] vrn_file_regions = items [ 0 ] [ "vrn_file_region" ] out_file = vcfutils . concat_variant_files ( vrn_file_regions , out_file , regions , dd . get_ref_file ( items [ 0 ] ) , items [ 0 ] [ "config" ] ) return { "vrn_file" : out_file }
CWL entry point: combine variant calls from regions into single VCF.