@@ -2220,25 +2220,38 @@ def main():
22202220 "for single end data." .format (args .adapter ))
22212221
22222222 if args .paired_end :
2223+ r1_expected = out_fastq_pre + "_R1_processed.fastq"
2224+ r2_expected = out_fastq_pre + "_R2_trimmed.fastq"
22232225 if not args .complexity and int (args .umi_len ) > 0 :
2224- if not os .path .exists (processed_target_R1 ) or args .new_start :
2226+ if (not os .path .exists (processed_target_R1 ) or args .new_start or
2227+ not os .path .exists (r1_expected )):
22252228 unmap_fq1 , unmap_fq1_dups = _process_fastq (
22262229 args , tools , res , False ,
22272230 untrimmed_fastq1 , outfolder = param .outfolder )
2231+ else :
2232+ unmap_fq1 = r1_expected
2233+ unmap_fq1_dups = out_fastq_pre + "_R1_trimmed.fastq"
22282234 cmd = ("touch " + processed_target_R1 )
22292235 pm .run (cmd , processed_target_R1 )
22302236 else :
2231- if not os .path .exists (processed_target_R1 ) or args .new_start :
2237+ if (not os .path .exists (processed_target_R1 ) or args .new_start or
2238+ not os .path .exists (r1_expected )):
22322239 unmap_fq1 = _process_fastq (
22332240 args , tools , res , False ,
22342241 untrimmed_fastq1 , outfolder = param .outfolder )
2242+ else :
2243+ unmap_fq1 = r1_expected
22352244 cmd = ("touch " + processed_target_R1 )
22362245 pm .run (cmd , processed_target_R1 )
22372246
2238- if not os .path .exists (processed_target_R2 ) or args .new_start :
2247+ if (not os .path .exists (processed_target_R2 ) or args .new_start or
2248+ not os .path .exists (r2_expected )):
22392249 unmap_fq2 , unmap_fq2_dups = _process_fastq (
22402250 args , tools , res , True ,
22412251 untrimmed_fastq2 , outfolder = param .outfolder )
2252+ else :
2253+ unmap_fq2 = r2_expected
2254+ unmap_fq2_dups = out_fastq_pre + "_R2_trimmed_dups.fastq"
22422255 cmd = ("touch " + processed_target_R2 )
22432256 pm .run (cmd , processed_target_R2 )
22442257
0 commit comments