def _check_variantcaller(item): """Ensure specified variantcaller is a valid choice. """ allowed = set(genotype.get_variantcallers().keys() + [None, False]) vcs = item["algorithm"].get("variantcaller", "gatk") if not isinstance(vcs, (tuple, list)): vcs = [vcs] problem = [x for x in vcs if x not in allowed] if len(problem) > 0: raise ValueError("Unexpected algorithm 'variantcaller' parameter: %s\n" "Supported options: %s\n" % (problem, sorted(list(allowed))))
def _add_filename_details(full_f): """Add variant callers and germline information standard CWL filenames. This is an ugly way of working around not having metadata with calls. """ out = {"vrn_file": full_f} f = os.path.basename(full_f) for vc in genotype.get_variantcallers().keys() + ["ensemble"]: if f.find("-%s.vcf" % vc) > 0: out["variantcaller"] = vc if f.find("-germline-") >= 0: out["germline"] = full_f return out
def _add_filename_details(full_f): """Add variant callers and germline information standard CWL filenames. This is an ugly way of working around not having metadata with calls. """ out = {"vrn_file": full_f} f = os.path.basename(full_f) for vc in list(genotype.get_variantcallers().keys()) + ["ensemble"]: if f.find("-%s.vcf" % vc) > 0: out["variantcaller"] = vc if f.find("-germline-") >= 0: out["germline"] = full_f return out
def _check_variantcaller(item): """Ensure specified variantcaller is a valid choice. """ allowed = set(genotype.get_variantcallers().keys() + [None, False]) vcs = item["algorithm"].get("variantcaller") if not isinstance(vcs, dict): vcs = {"variantcaller": vcs} for vc_set in vcs.values(): if not isinstance(vc_set, (tuple, list)): vc_set = [vc_set] problem = [x for x in vc_set if x not in allowed] if len(problem) > 0: raise ValueError("Unexpected algorithm 'variantcaller' parameter: %s\n" "Supported options: %s\n" % (problem, sorted(list(allowed)))) # Ensure germline somatic calling only specified with tumor/normal samples if "germline" in vcs or "somatic" in vcs: paired = vcfutils.get_paired_phenotype(item) if not paired: raise ValueError("%s: somatic/germline calling in 'variantcaller' " "but tumor/normal metadata phenotype not specified" % dd.get_sample_name(item))