Changeset 2566


Ignore:
Timestamp:
Aug 11, 2014, 10:34:48 AM (7 years ago)
Author:
Nicklas Nordborg
Message:

References #547: Start Demux and Merge

Specify project name in the configuration file instead of in the wizard. The 'debug' parameter now results in a subdirectory inside the project directory instead of a sibling directory.

Location:
extensions/net.sf.basedb.reggie/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • extensions/net.sf.basedb.reggie/trunk/reggie-ogs-hosts.xml

    r2563 r2566  
    2424   
    2525    <!-- Full path to the location where data files should be archived (required) -->
    26     <!-- Do not include name of project, since it is added by the Reggie wizard -->
    27     <project-archive>/path/to/project-archive</project-archive>
     26    <!-- The path should include the name of the project -->
     27    <project-archive>/path/to/project-archive/scanb</project-archive>
    2828   
    2929    <!-- Full path to the root location where reference genomes are located -->
  • extensions/net.sf.basedb.reggie/trunk/resources/analysis/demux_start.jsp

    r2434 r2566  
    3434var readStringIsValid = [];
    3535var clusterIsValid = false;
    36 var projectNameIsValid = false;
    3736
    3837function init()
     
    137136{
    138137  if (!clusterIsValid) return false;
    139   if (!projectNameIsValid) return false;
    140138 
    141139  var frm = document.forms['reggie'];
     
    174172    setFatalError(response.message);
    175173    return false;
    176   }
    177  
    178   if (response.projectName)
    179   {
    180     frm.projectName.value = response.projectName;
    181174  }
    182175 
     
    337330    frm.mergeSoftware[0] = new Option('- none -', '');
    338331  }
    339  
    340   projectNameOnChange();
    341 
    342332}
    343333
     
    361351    Main.hide('job-priority');
    362352  }
    363 }
    364 
    365 function projectNameOnChange()
    366 {
    367   var frm = document.forms['reggie'];
    368   projectNameIsValid = false;
    369   var projectName = frm.projectName.value.toLowerCase();
    370   if (projectName == '')
    371   {
    372     setInputStatus('projectName', 'Missing', 'invalid');
    373     frm.projectName.focus();
    374     return;
    375   }
    376   if (projectName.match(/[^a-z0-9_]/))
    377   {
    378     setInputStatus('projectName', 'Only a-z, 0-9 and _ are allowed', 'invalid');
    379     frm.projectName.focus();
    380     return;
    381   }
    382 
    383   frm.projectName.value = projectName;
    384   setInputStatus('projectName', '', 'valid');
    385   projectNameIsValid = true;
    386353}
    387354
     
    490457  frm.mergeSoftware.disabled = true;
    491458  frm.mergeProtocol.disabled = true;
    492   frm.projectName.disabled = true;
    493459  frm.priority.disabled = true;
    494460  frm.debug.disabled = true;
     
    506472  submitInfo.mergeSoftware = parseInt(frm.mergeSoftware.value);
    507473  submitInfo.mergeProtocol = parseInt(frm.mergeProtocol.value);
    508   submitInfo.projectName = frm.projectName.value;
    509474  submitInfo.cluster = frm.clusters.value;
    510475  if (frm.priority.selectedIndex >= 0)
     
    766731        </td>
    767732      </tr>
    768       <tr valign="top">
    769         <td class="subprompt">Project name</td>
    770         <td class="input"><input type="text" class="required" name="projectName"
    771           value="" size="18" maxlength="12"
    772           onblur="projectNameOnChange()"
    773           onkeypress="focusOnEnter(event, 'clusters')" ></td>
    774         <td class="status" id="projectName.status"></td>
    775         <td class="help"><span id="projectName.message" class="message" style="display: none;"></span>
    776           The project name affects the final storage location of FASTQ files in
    777           the <b>project-archive</b> directory.
    778         </td>
    779       </tr>
    780733      <tr valign="top" style="background-color: #E8E8E8;">
    781734        <td class="prompt">Open Grid Scheduler</td>
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/DemuxMergeServlet.java

    r2561 r2566  
    4545import net.sf.basedb.core.Path;
    4646import net.sf.basedb.core.PhysicalBioAssay;
    47 import net.sf.basedb.core.Project;
    4847import net.sf.basedb.core.Protocol;
    4948import net.sf.basedb.core.SessionControl;
     
    188187       
    189188        json.put("sequencingRuns", jsonRuns);
    190         if (sc.getActiveProjectId() != 0)
    191         {
    192           json.put("projectName", Reggie.makeSafeProjectName(Project.getById(dc, sc.getActiveProjectId()).getName()));
    193         }
    194189      }
    195190      else if ("GetSequencingRunInfo".equals(cmd))
     
    346341        boolean debug = Boolean.TRUE.equals(jsonReq.get("debug"));
    347342        Number priority = (Number)jsonReq.get("priority");
    348         String projectName = (String)jsonReq.get("projectName");
    349         if (projectName == null)
    350         {
    351           if (sc.getActiveProjectId() != 0)
    352           {
    353             projectName = Project.getById(dc, sc.getActiveProjectId()).getName();
    354           }
    355           else
    356           {
    357             projectName = "scanb";
    358           }
    359         }
    360         projectName = Reggie.makeSafeProjectName(projectName);
    361343       
    362344        OpenGridCluster cluster = OpenGridService.getInstance().getClusterById(clusterId);
     
    371353        String runArchive = cluster.getRequiredConfig("run-archive");
    372354        String projectRoot = cluster.getRequiredConfig("project-archive");
    373         String projectFolder = projectName+(debug ? ".debug" : "");
    374         String fastqArchive = projectRoot + "/" + projectFolder;
     355        String projectFolder = (debug ? "/debug" : "");
    375356
    376357        // Paths to programs used (picard and trimmomatic)
     
    545526        StringParameterType sType = new StringParameterType();
    546527        demuxMergeJob.setParameterValue("jobName", sType, jobName);
    547         demuxMergeJob.setParameterValue("jobFolder", sType, jobFolder);
    548         demuxMergeJob.setParameterValue("tmpFolder", sType, tmpFolder);
    549         demuxMergeJob.setParameterValue("fastqFolder", sType, fastqArchive);
    550528        if (debug)
    551529        {
     
    695673            // Reload in current transaction
    696674            merged = DerivedBioAssay.getById(dc, merged.getId());
    697             String fastqFolder = (String)Annotationtype.DATA_FILES_FOLDER.getAnnotationValue(dc, merged);
     675            String fastqFolder = projectRoot + (String)Annotationtype.DATA_FILES_FOLDER.getAnnotationValue(dc, merged);
    698676            script.comment("Consolidating FASTQ: " + merged.getName());
    699677            // Progress between 50-95%
     
    729707           
    730708            script.progress(percent, "Archiving FASTQ: " + merged.getName());
    731             script.cmd("mkdir -p " + projectRoot + "/" + fastqFolder);
    732             script.bkgr("cat fastq.trimmomatic/" + R1_name + " > " + projectRoot + "/" + fastqFolder + "/"+R1_name);
    733             script.bkgr("cat fastq.trimmomatic/" + R2_name + " > " + projectRoot + "/" + fastqFolder + "/"+R2_name);
     709            script.cmd("mkdir -p " + fastqFolder);
     710            script.bkgr("cat fastq.trimmomatic/" + R1_name + " > " + fastqFolder + "/"+R1_name);
     711            script.bkgr("cat fastq.trimmomatic/" + R2_name + " > " + fastqFolder + "/"+R2_name);
    734712            script.newLine();
    735713          }
Note: See TracChangeset for help on using the changeset viewer.