def setDefaults(self, config_dict): """ Check mandatory keys and set defaults for any missing keys :param config_dict: config dictionary :return: config dictionary with defaults """ # check mandatory keys config_dict = utils.checkKeys( config_dict, keys=["htmlOutputPath", "root", "sampleAnnotation"], check_files=True) config_dict["geneAnnotation"] = utils.checkKeys( config_dict["geneAnnotation"], keys=None, check_files=True) config_dict["wBuildPath"] = utils.getWBuildPath() setKey = utils.setKey setKey(config_dict, None, "fileRegex", ".*\.(R|md)") setKey(config_dict, None, "genomeAssembly", "hg19") # set submodule dictionaries setKey(config_dict, None, "aberrantExpression", dict()) setKey(config_dict, None, "aberrantSplicing", dict()) setKey(config_dict, None, "mae", dict()) setKey(config_dict, None, "exportCounts", dict()) # commandline tools setKey(config_dict, None, "tools", dict()) setKey(config_dict, ["tools"], "samtoolsCmd", "samtools") setKey(config_dict, ["tools"], "bcftoolsCmd", "bcftools") setKey(config_dict, ["tools"], "gatkCmd", "gatk") return config_dict
def setDefaults(self, config_dict): """ Check mandatory keys and set defaults for any missing keys :param config_dict: config dictionary :return: config dictionary with defaults """ # check mandatory keys config_dict = utils.checkKeys( config_dict, keys=["htmlOutputPath", "root", "sampleAnnotation"], check_files=True) config_dict["geneAnnotation"] = utils.checkKeys( config_dict["geneAnnotation"], keys=None, check_files=True) config_dict["wBuildPath"] = utils.getWBuildPath() setKey = utils.setKey setKey(config_dict, None, "fileRegex", r".*\.(R|md)") setKey(config_dict, None, "genomeAssembly", "hg19") hpo_url = 'https://www.cmm.in.tum.de/public/paper/drop_analysis/resource/hpo_genes.tsv.gz' setKey(config_dict, None, "hpoFile", hpo_url) # set submodule dictionaries setKey(config_dict, None, "aberrantExpression", dict()) setKey(config_dict, None, "aberrantSplicing", dict()) setKey(config_dict, None, "mae", dict()) setKey(config_dict, None, "rnaVariantCalling", dict()) setKey(config_dict, None, "exportCounts", dict()) # Legacy check: If mae still defines genome print warning, otherwise use the # globally defined genome try: genome_files = self.get("mae")["genome"] logger.info( "WARNING: Using the mae defined genome instead of the globally defined one.\n" "This will be deprecated in the future to allow for reference genomes to" " be defined in the sample annotation table. Please update your config " "and sample annotation table\n") except KeyError: genome_files = self.get("genome") setKey(config_dict, None, "genome", genome_files) # commandline tools setKey(config_dict, None, "tools", dict()) setKey(config_dict, ["tools"], "samtoolsCmd", "samtools") setKey(config_dict, ["tools"], "bcftoolsCmd", "bcftools") setKey(config_dict, ["tools"], "gatkCmd", "gatk") return config_dict