Changeset 6467
- Timestamp:
- Nov 3, 2021, 3:13:27 PM (15 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/net.sf.basedb.reggie/branches/4.33-stable/src/net/sf/basedb/reggie/grid/ImportFastqJobCreator.java
r6421 r6467 187 187 demuxName + " must have two values: " + rawFastqNames); 188 188 } 189 String fastqNameR1 = null; 190 String fastqNameR2 = null; 191 // NOTE! Order in the list is not specified so we don't know which is R1 and R2 192 // Search for _R1 and _R2 193 for (String fqName : rawFastqNames) 194 { 195 if (fqName.contains("_R1")) fastqNameR1 = fqName; 196 if (fqName.contains("_R2")) fastqNameR2 = fqName; 197 } 198 if (fastqNameR1 == null) 199 { 200 throw new InvalidDataException("Annotation RawFASTQ on " + 201 demuxName + " is missing an R1 fastq file: " + rawFastqNames); 202 } 203 if (fastqNameR2 == null) 204 { 205 throw new InvalidDataException("Annotation RawFASTQ on " + 206 demuxName + " is missing an R2 fastq file: " + rawFastqNames); 207 } 189 208 190 209 // Get SequencingRun so that we can get the path to the FASTQ folder. … … 272 291 // If not, we need to copy from ImportGateway 273 292 // If they don't exists at all we generate an error 274 int fileNo = 0;275 293 script.cmd("mkdir -p ${ImportArchive}"); 276 for (String fastqName : rawFastqNames) 277 { 278 fileNo++; 279 // NOTE! Order in the list is not specified so we don't know which is R1 and R2 280 script.cmd("FASTQ="+ScriptUtil.checkValidFilename(fastqName)); 281 script.progress(5+fileNo*5, "Copying FASTQ files: ${FASTQ}"); 282 script.cmd("if [ ! -f \"${ImportArchive}/${FASTQ}\" ]; then"); 283 script.cmd(" if [ ! -f \"${ImportGateway}/${FASTQ}\" ]; then"); 284 script.cmd(" echo \"Can't find FASTQ file ${FASTQ} in ${ImportGateway} or ${ImportArchive}\" 1>&2"); 294 script.cmd("FASTQ1="+ScriptUtil.checkValidFilename(fastqNameR1)); 295 script.cmd("FASTQ2="+ScriptUtil.checkValidFilename(fastqNameR2)); 296 for (int fileNo = 1; fileNo <= 2; fileNo++) 297 { 298 script.progress(5+fileNo*5, "Copying FASTQ files: ${FASTQ"+fileNo+"}"); 299 script.cmd("if [ ! -f \"${ImportArchive}/${FASTQ"+fileNo+"}\" ]; then"); 300 script.cmd(" if [ ! -f \"${ImportGateway}/${FASTQ"+fileNo+"}\" ]; then"); 301 script.cmd(" echo \"Can't find FASTQ file ${FASTQ"+fileNo+"} in ${ImportGateway} or ${ImportArchive}\" 1>&2"); 285 302 script.cmd(" exit 1"); 286 303 script.cmd(" fi"); 287 script.cmd(" cp \"${ImportGateway}/${FASTQ }\" \"${ImportArchive}/${FASTQ}\"");304 script.cmd(" cp \"${ImportGateway}/${FASTQ"+fileNo+"}\" \"${ImportArchive}/${FASTQ"+fileNo+"}\""); 288 305 if (!debug) 289 306 { 290 script.cmd(" rm -f \"${ImportGateway}/${FASTQ }\"");307 script.cmd(" rm -f \"${ImportGateway}/${FASTQ"+fileNo+"}\""); 291 308 } 292 309 script.cmd("fi"); 293 script.cmd("cp \"${ImportArchive}/${FASTQ }\" fastq");310 script.cmd("cp \"${ImportArchive}/${FASTQ"+fileNo+"}\" fastq"); 294 311 script.newLine(); 295 312 } 296 297 script.comment("Find FASTQ files");298 script.cmd("FASTQ1=`find fastq -name \"*_R1*.fastq.gz\" -print -quit 2> /dev/null`");299 script.cmd("FASTQ2=`find fastq -name \"*_R2*.fastq.gz\" -print -quit 2> /dev/null`");300 script.newLine();301 313 302 314 script.comment("Run Bowtie2"); 303 script.progress( 40, "Bowtie2: " + mergedName + " (${NumThreads} threads)");315 script.progress(20, "Bowtie2: " + mergedName + " (${NumThreads} threads)"); 304 316 String alignCmd = "./stdwrap.sh " + bowtie_path; 305 317 alignCmd += " -p ${NumThreads}"; … … 307 319 alignCmd += " --un-conc fastq.aligned/R%.fastq"; 308 320 alignCmd += " -x ${Gidx}"; 309 alignCmd += " -1 ${FASTQ1}";310 alignCmd += " -2 ${FASTQ2}";321 alignCmd += " -1 fastq/${FASTQ1}"; 322 alignCmd += " -2 fastq/${FASTQ2}"; 311 323 alignCmd += " -S fastq.aligned/aligned.sam"; 312 324 alignCmd += " > fastq.aligned/aligned.out"; … … 319 331 String trimCmd1 = "./stdwrap.sh ./trimmomatic PE"; 320 332 trimCmd1 += " -threads ${NumThreads}"; 321 trimCmd1 += " ${FASTQ1}";322 trimCmd1 += " ${FASTQ2}";333 trimCmd1 += " fastq/${FASTQ1}"; 334 trimCmd1 += " fastq/${FASTQ2}"; 323 335 trimCmd1 += " fastq.trimmomatic.1/"+R1_name; 324 336 trimCmd1 += " fastq.trimmomatic.1/un_"+R1_name;
Note: See TracChangeset
for help on using the changeset viewer.