@@ -74,6 +74,7 @@ def main(args):
7474 parser .add_argument ('--chimera_method' , default = 'consensus' , choices = ['consensus' , 'pooled' , 'per-sample' ], help = 'bimera removal method' )
7575 parser .add_argument ('--uchime_ref' , help = 'Run UCHIME REF [ITS,16S,LSU,COI,custom]' )
7676 parser .add_argument ('--pool' , action = 'store_true' , help = 'Pool all sequences together for DADA2' )
77+ parser .add_argument ('--pseudopool' , action = 'store_true' , help = 'Use DADA2 pseudopooling' )
7778 parser .add_argument ('--debug' , action = 'store_true' , help = 'Keep all intermediate files' )
7879 parser .add_argument ('-u' ,'--usearch' , dest = "usearch" , default = 'usearch9' , help = 'USEARCH9 EXE' )
7980 parser .add_argument ('--cpus' , type = int , help = "Number of CPUs. Default: auto" )
@@ -172,16 +173,23 @@ def main(args):
172173 os .remove (os .path .join (filtfolder , y ))
173174
174175 #now run DADA2 on filtered folder
175- amptklib .log .info ("Running DADA2 pipeline" )
176- dada2log = base + '.dada2.Rscript.log'
177- dada2out = base + '.dada2.csv'
178- #check pooling vs notpooled, default is not pooled.
176+ #check pooling pseudopooling or notpooled, default is not pooled.
179177 if args .pool :
180178 POOL = 'TRUE'
179+ amptklib .log .info ("Running DADA2 pipeline using pooling of samples" )
180+ elif args .pseudopool :
181+ POOL = 'PSEUDO'
182+ amptklib .log .info ("Running DADA2 pipeline using pseudopooling of samples" )
181183 else :
182184 POOL = 'FALSE'
185+ amptklib .log .info ("Running DADA2 pipeline on each sample" )
186+ dada2log = base + '.dada2.Rscript.log'
187+ dada2out = base + '.dada2.csv'
188+
189+ dada2cmd = ['Rscript' , '--vanilla' , dada2script , filtfolder , dada2out , args .platform , POOL , CORES , args .chimera_method ]
190+ amptklib .log .debug (' ' .join (dada2cmd ))
183191 with open (dada2log , 'w' ) as logfile :
184- subprocess .call ([ 'Rscript' , '--vanilla' , dada2script , filtfolder , dada2out , args . platform , POOL , CORES , args . chimera_method ] , stdout = logfile , stderr = logfile )
192+ subprocess .call (dada2cmd , stdout = logfile , stderr = logfile )
185193
186194 #check for results
187195 if not os .path .isfile (dada2out ):
0 commit comments