Changeset 2460


Ignore:
Timestamp:
May 26, 2014, 9:32:59 AM (8 years ago)
Author:
Nicklas Nordborg
Message:

References #593: Start masking and alignment

Improved error handling in script. Check that data folder exists before starting.

File:
1 edited

Legend:

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

    r2420 r2460  
    300300        for (int mgNo = 0; mgNo < jsonMerged.size(); mgNo++)
    301301        {
     302          dc = sc.newDbControl();
    302303          JSONObject jsonMg = (JSONObject)jsonMerged.get(mgNo);
    303304          Number mergedId = (Number)jsonMg.get("id");
     
    345346         
    346347          ScriptBuilder script = new ScriptBuilder(jobFolder);
     348          script.comment("Exit script immediately if an error occurs");
     349          script.cmd("set -e");
     350          script.newLine();
    347351          script.comment("Setting up scripting environment and copying script to tmp folder");
    348352          script.cmd("export ScriptDir=" + cluster.getScriptFolder());
     
    364368          script.comment("Copy FASTQ files to tmp folder");
    365369          script.progress(10, "Copying FASTQ files");
     370          script.cmd("if [ ! -d \""+projectRoot + "/" + fastQFolder+"\" ]; then");
     371          script.cmd("echo \"Can't find data folder "+fastQFolder+" in " + projectRoot + "\" 1>&2");
     372          script.cmd("exit 1");
     373          script.cmd("fi");
    366374          script.cmd("mkdir fastq");
    367375          script.cmd("cp " + projectRoot + "/" + fastQFolder + "/*.fastq.gz fastq");
Note: See TracChangeset for help on using the changeset viewer.