def __init__(self, wbuildConfig): """ Parse wbuild/snakemake config object for DROP-specific content :param wbuildConfig: wBuild config object """ self.wBuildConfig = wbuildConfig self.config_dict = self.setDefaults(wbuildConfig.getConfig()) self.root = Path(self.get("root")) self.processedDataDir = self.root / "processed_data" self.processedResultsDir = self.root / "processed_results" utils.createDir(self.root) utils.createDir(self.processedDataDir) utils.createDir(self.processedResultsDir) self.htmlOutputPath = Path(self.get("htmlOutputPath")) self.readmePath = Path(self.get("readmePath")) # annotations self.geneAnnotation = self.get("geneAnnotation") self.genomeAssembly = self.get("genomeAssembly") self.fastaFile = self.get("mae")[ "genome"] # TODO: move fasta outside of mae self.fastaDict = Path(self.fastaFile).with_suffix(".dict") self.sampleAnnotation = SampleAnnotation(self.get("sampleAnnotation"), self.root) # submodules self.AE = AE(config=self.get("aberrantExpression"), sampleAnnotation=self.sampleAnnotation, processedDataDir=self.processedDataDir, processedResultsDir=self.processedResultsDir) self.AS = AS(config=self.get("aberrantSplicing"), sampleAnnotation=self.sampleAnnotation, processedDataDir=self.processedDataDir, processedResultsDir=self.processedResultsDir) self.MAE = MAE(config=self.get("mae"), sampleAnnotation=self.sampleAnnotation, processedDataDir=self.processedDataDir, processedResultsDir=self.processedResultsDir) # counts export self.exportCounts = ExportCounts( dict_=self.get("exportCounts"), outputRoot=self.processedResultsDir, sampleAnnotation=self.sampleAnnotation, geneAnnotations=self.getGeneAnnotations(), genomeAssembly=self.get("genomeAssembly"), aberrantExpression=self.AE, aberrantSplicing=self.AS) # legacy utils.setKey(self.config_dict, None, "aberrantExpression", self.AE.dict_) utils.setKey(self.config_dict, None, "aberrantSplicing", self.AS.dict_) utils.setKey(self.config_dict, None, "mae", self.MAE.dict_)
def __init__(self, wbuildConfig): """ Parse wbuild/snakemake config object for DROP-specific content :param wbuildConfig: wBuild config object """ self.wBuildConfig = wbuildConfig self.config_dict = self.setDefaults(wbuildConfig.getConfig()) self.root = Path(self.get("root")) self.processedDataDir = self.root / "processed_data" self.processedResultsDir = self.root / "processed_results" utils.createDir(self.root) utils.createDir(self.processedDataDir) utils.createDir(self.processedResultsDir) self.htmlOutputPath = Path(self.get("htmlOutputPath")) self.readmePath = Path(self.get("readmePath")) self.geneAnnotation = self.get("geneAnnotation") self.genomeAssembly = self.get("genomeAssembly") self.sampleAnnotation = SampleAnnotation(self.get("sampleAnnotation"), self.root) # setup submodules cfg = self.config_dict sa = self.sampleAnnotation pd = self.processedDataDir pr = self.processedResultsDir self.AE = AE(cfg["aberrantExpression"], sa, pd, pr) self.AS = AS(cfg["aberrantSplicing"], sa, pd, pr) self.MAE = MAE(cfg["mae"], sa, pd, pr) self.exportCounts = ExportCounts(self.config_dict, self.processedResultsDir, self.sampleAnnotation, self.getGeneAnnotations(), self.get("genomeAssembly"), aberrantExpression=self.AE, aberrantSplicing=self.AS) # legacy utils.setKey(self.config_dict, None, "aberrantExpression", self.AE.dict_) utils.setKey(self.config_dict, None, "aberrantSplicing", self.AS.dict_) utils.setKey(self.config_dict, None, "mae", self.MAE.dict_)
def __init__(self, wbuildConfig, workDir): """ Parse wbuild/snakemake config object for DROP-specific content :param wbuildConfig: wBuild config object :param workDir: path to project working directory """ self.workDir = Path(workDir) self.wBuildConfig = wbuildConfig self.config_dict = self.setDefaults(wbuildConfig.getConfig()) self.root = Path(self.get("root")) self.processedDataDir = self.root / "processed_data" self.processedResultsDir = self.root / "processed_results" utils.createDir(self.root) utils.createDir(self.processedDataDir) utils.createDir(self.processedResultsDir) self.htmlOutputPath = Path(self.get("htmlOutputPath")) self.readmePath = Path(self.get("readmePath")) # annotations self.genome = Genome( annotation=self.get("geneAnnotation"), assembly=self.get("genomeAssembly"), reference=self.get("genome") ) self.sampleAnnotation = SampleAnnotation( file=self.get("sampleAnnotation"), root=self.root, genome=self.genome ) # submodules self.AE = AE( config=self.get("aberrantExpression"), sampleAnnotation=self.sampleAnnotation, processedDataDir=self.processedDataDir, processedResultsDir=self.processedResultsDir, workDir=workDir ) self.AS = AS( config=self.get("aberrantSplicing"), sampleAnnotation=self.sampleAnnotation, processedDataDir=self.processedDataDir, processedResultsDir=self.processedResultsDir, workDir=workDir ) self.MAE = MAE( config=self.get("mae"), sampleAnnotation=self.sampleAnnotation, processedDataDir=self.processedDataDir, processedResultsDir=self.processedResultsDir, workDir=workDir, genome=self.genome ) # counts export self.exportCounts = ExportCounts( dict_=self.get("exportCounts"), outputRoot=self.processedResultsDir, sampleAnnotation=self.sampleAnnotation, genome=self.genome, aberrantExpression=self.AE, aberrantSplicing=self.AS ) # write sample params for each module AS not currently supported sampleParams = SampleParams( self.AE, self.AS, self.MAE, self.get("geneAnnotation"), self.processedDataDir, self.sampleAnnotation ) # legacy utils.setKey(self.config_dict, None, "aberrantExpression", self.AE.dict_) utils.setKey(self.config_dict, None, "aberrantSplicing", self.AS.dict_) utils.setKey(self.config_dict, None, "mae", self.MAE.dict_)