def testModule(self): pModule1 = Proc() pModule2 = Proc() pModule3 = Proc() pModule4 = Proc() pModule5 = Proc() pModule6 = Proc() aggr = Aggr(pModule1, pModule2, pModule3, pModule4, pModule5, pModule6, depends=False) aggr.module('m1', starts='pModule1, pModule2', ends='pModule4', depends={ 'pModule3,': ['starts'], 'pModule4': 'pModule3' }, ends_shared={'pModule4': 'm2'}, depends_shared={'pModule4': 'm2'}) aggr.module('m2', starts='pModule3', ends='pModule4, pModule6', depends={'pModule4': 'pModule3'}, ends_shared={'pModule4': 'm1'}, depends_shared={'pModule4': 'm1'}, starts_shared={'pModule3': 'm1'}) self.assertEqual(aggr.starts, []) self.assertEqual(aggr.ends, []) self.assertEqual(aggr.pModule3.depends, []) self.assertEqual(aggr.pModule4.depends, []) aggr.on('m1') self.assertEqual(aggr.starts, [aggr.pModule1, aggr.pModule2]) self.assertEqual(aggr.ends, [aggr.pModule4]) self.assertEqual(aggr.pModule3.depends, [aggr.pModule1, aggr.pModule2]) self.assertEqual(aggr.pModule4.depends, [aggr.pModule3]) aggr.off('m1') self.assertEqual(aggr.starts, []) self.assertEqual(aggr.ends, []) self.assertEqual(aggr.pModule3.depends, []) self.assertEqual(aggr.pModule4.depends, []) aggr.on('m2') self.assertEqual(aggr.starts, [aggr.pModule3]) self.assertEqual(aggr.ends, [aggr.pModule4, aggr.pModule6]) self.assertEqual(aggr.pModule4.depends, [aggr.pModule3]) aggr.off('m2') self.assertEqual(aggr.starts, []) self.assertEqual(aggr.ends, []) self.assertEqual(aggr.pModule3.depends, []) aggr.on('m1, m2') aggr.off('m2') self.assertEqual(aggr.starts, [aggr.pModule1, aggr.pModule2, aggr.pModule3]) self.assertEqual(aggr.ends, [aggr.pModule4]) self.assertEqual(aggr.pModule3.depends, [aggr.pModule1, aggr.pModule2]) self.assertEqual(aggr.pModule4.depends, [aggr.pModule3])
aPrepareBam['pSam2Bam', ].depends = ['pFastq2Sam'] aPrepareBam['pBamRecal', ].depends = ['pSam2Bam'] # delegates aPrepareBam.delegate('args.ref', 'pFastq2Sam, pBamRecal') # args aPrepareBam.pSam2Bam.args.markdup = True # modules aPrepareBam.module('ebam', starts='pBam2Fastq', depends={'pFastqTrim': 'pBam2Fastq'}) aPrepareBam.module('fastq', starts='pFastqTrim') aPrepareBam.module('qc', ends='pFastQC, pFastMC', depends={'pFastQC, pFastMC': ['pFastqTrim'] * 2}) # inital modules aPrepareBam.on('fastq') """ @name: aBam2SCNV @description: Call CNV with paired control samples @procs: `pBamDir` : The directory with the bam files `pSampleInfo` : The sample information `pCNVkitPrepare`: Prepare the region/coverage file for CNV calling `pCNVkitCov` : Get the coverage file for each bam file. `pCNNDir` : Put all coverage file into a directory. `pCNVkitRef` : Aggregate the reference cnn file from controls. `pCNVkitFix` : Fix the coverage for each sample using the reference cnn file. `pCNVkitSeg` : Segment the regions `pCNVkitCall` : Call CNVs.
aCELDir2DEG.ends = 'pMArrayDEG' aCELDir2DEG['pGMTFetcher'].input = ['KEGG_2016_gmt'] aCELDir2DEG['pMArrayDEG'].args.maplot = True aCELDir2DEG['pMArrayDEG'].args.heatmap = True aCELDir2DEG['pGMTFetcher'].args.header = False # Depends aCELDir2DEG['pMArrayDEG', ].depends = ['pCELDir2Matrix, pSampleInfo'] # Input adjustments aCELDir2DEG['pGSEA'].input = lambda ch1, ch2, ch3: \ ch1.repRow(ch2.length() * ch3.length()) \ .cbind(ch2.repRow(ch1.length() * ch3.length())) \ .cbind(ch3.repRow(ch1.length() * ch2.length())) aCELDir2DEG['pMArrayDEG'].input = lambda ch1, ch2: \ ch1.colAt(0).repRow(ch2.length()).cbind(ch2.repRow(ch1.length())) # Configs aCELDir2DEG.module('exprplot', depends={'pExprPlot': 'pCELDir2Matrix'}, ends='pExprPlot') aCELDir2DEG.module( 'gsea', 'pGMTFetcher', { 'pGSEA': 'pExprMat2GCT, pSampleinfo2CLS, pGMTFetcher', 'pExprMat2GCT': 'pCELDir2Matrix', 'pSampleinfo2CLS': 'pSampleInfo' }, 'pGSEA') aCELDir2DEG.module('enrichr', depends={'pEnrichr': 'pMArrayDEG'}, ends='pEnrichr') # Enable all functions aCELDir2DEG.on()