Changeset 2559


Ignore:
Timestamp:
Aug 6, 2014, 12:55:15 PM (7 years ago)
Author:
Nicklas Nordborg
Message:

References #614: Improve error handling when executing jobs on the cluster

Copying results files to the project archive. All *.out files are also included and they are also copied to the job folder so BASE can import some information.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/MaskAlignServlet.java

    r2556 r2559  
    352352          aligned.setProtocol(alignProtocol);
    353353          aligned.addParent(masked);
    354           String tophatFolder = "tophat"+maskedName.substring(maskedName.lastIndexOf("."));
    355           Annotationtype.DATA_FILES_FOLDER.setAnnotationValue(dc, aligned, fastQFolder+"/"+tophatFolder);
     354          String tophatFolder = fastQFolder + "/tophat"+maskedName.substring(maskedName.lastIndexOf("."));
     355          Annotationtype.DATA_FILES_FOLDER.setAnnotationValue(dc, aligned, tophatFolder);
    356356          dc.saveItem(aligned);
    357357         
     
    371371          script.cmd("Gidx=${ReferenceDir}/" + align_gidx);
    372372          script.cmd("Tidx=${ReferenceDir}/" + align_tidx);
    373           script.cmd("export TransferDir="+projectRoot+"/" + projectName);
    374           script.cmd("export TophatDir="+tophatFolder);
    375373          script.cmd("NumThreads=`nproc`");
    376374          script.newLine();
     
    381379          script.cmd("cp ${ScriptDir}/picard .");
    382380          script.cmd("cp ${ScriptDir}/alignment_statistics.sh .");
    383           script.cmd("cp ${ScriptDir}/sync_resultfiles.sh .");
    384381          script.newLine();
    385382         
     
    410407          maskCmd += " -2 ${FASTQ2}";
    411408          maskCmd += " -S /dev/null";
    412           maskCmd += " > " + jobFolder + "/masked.out";
     409          maskCmd += " > fastq.masked/masked.out";
    413410          script.cmd(maskCmd);
    414411          script.newLine();
     
    428425          tophatCmd += " fastq.masked/R1.fastq.gz";
    429426          tophatCmd += " fastq.masked/R2.fastq.gz";
    430           tophatCmd += " > " + jobFolder + "/tophat.out";
     427          tophatCmd += " > fastq.masked.tophat/tophat.out";
    431428          script.cmd(tophatCmd);
     429          script.cmd("rm -rf fastq.masked.tophat/logs");
    432430          script.newLine();
    433431
     
    438436          picardCmd += " METRICS_FILE=fastq.masked.tophat/accepted_hits_picardmetrics.csv";
    439437          picardCmd += " " + align_markDuplicatesOptions;
    440           picardCmd += " > " + jobFolder + "/picard_MarkDuplicates.out";
     438          picardCmd += " > fastq.masked.tophat/picard_MarkDuplicates.out";
    441439          script.cmd(picardCmd);
    442440          script.cmd("mv fastq.masked.tophat/accepted_hits.bam.tmp_picard fastq.masked.tophat/accepted_hits.bam");
     
    448446
    449447          script.progress(90, "Culculating alignment statistics");
    450           script.cmd("./alignment_statistics.sh fastq.masked.tophat > " + jobFolder + "/alignment_statistics.out");
    451           script.newLine();
    452          
    453           script.comment("Wait for background tasks to finish");
     448          script.cmd("./alignment_statistics.sh fastq.masked.tophat > fastq.masked.tophat/alignment_statistics.out");
     449          script.newLine();
     450         
     451          script.comment("Wait for background tasks to finish and copy some files to job folder");
    454452          script.cmd("wait");
    455453          script.newLine();
    456454         
    457455          script.progress(90, "Copying result files to project archive");
    458           script.comment("Sync result files to project archive");
    459           script.cmd("echo " + merged.getName() + " > sync.list");
    460           script.cmd("./sync_resultfiles.sh < sync.list >& sync.out");
     456          script.cmd("mkdir -p " + projectRoot + "/" + tophatFolder);
     457          script.cmd("cp fastq.masked/*.out " + jobFolder);
     458          script.cmd("cp fastq.masked.tophat/*.out " + jobFolder);
     459          script.cmd("cp fastq.masked/*.out " + projectRoot + "/" + tophatFolder);
     460          script.cmd("cp fastq.masked.tophat/* " + projectRoot + "/" + tophatFolder);
    461461          script.newLine();
    462462         
Note: See TracChangeset for help on using the changeset viewer.