Changeset 5815
- Timestamp:
- Jan 24, 2020, 2:37:45 PM (3 years ago)
- Location:
- extensions/net.sf.basedb.reggie/trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/net.sf.basedb.reggie/trunk/resources/analysis/vcall_build.js
r5766 r5815 180 180 submitInfo.itemList = parseInt(frm.itemList.value); 181 181 submitInfo.cluster = frm.clusters.value; 182 submitInfo.sampleType = frm.sampleType.value; 182 183 if (frm.priority.selectedIndex >= 0) 183 184 { -
extensions/net.sf.basedb.reggie/trunk/resources/analysis/vcall_build.jsp
r5766 r5815 67 67 way up to a patient item. This is needed since the script calculates 68 68 per-patient frequencies of variants. 69 </td> 70 </tr> 71 <tr> 72 <td class="subprompt">Sample type</td> 73 <td class="input"> 74 <label><input type="radio" name="sampleType" id="sampleTypeTumors" value="tumors" checked>Tumors</label> 75 <label><input type="radio" name="sampleType" id="sampleTypeNormals" value="normals">Normals</label> 76 </td> 77 <td class="status" id="sampleType.status"></td> 78 <td class="help"> 79 <span id="sampleType.message" class="message"></span> 80 Select the sample type of the alignments in the list. The selection 81 dosn't affect the analysis except the name of the final result files. 69 82 </td> 70 83 </tr> -
extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/grid/VariantStatisticsJobCreator.java
r5773 r5815 21 21 import net.sf.basedb.core.ProgressReporter; 22 22 import net.sf.basedb.core.SessionControl; 23 import net.sf.basedb.core.StringParameterType; 23 24 import net.sf.basedb.core.Type; 24 25 import net.sf.basedb.core.query.Expressions; … … 56 57 private boolean debug; 57 58 private Integer priority; 59 private String outputBaseName = "scanb-tumors"; 58 60 59 61 public VariantStatisticsJobCreator() … … 76 78 { 77 79 this.priority = priority; 80 } 81 82 /** 83 Set the base name of files that are created. 84 Typically, this should be "scanb-tumors" or 85 "scanb-normals" (.vcf.gz is and other extensions are automatically appended) 86 */ 87 public void setOutputBaseName(String baseName) 88 { 89 this.outputBaseName = baseName; 78 90 } 79 91 … … 112 124 statJob.setName("Build variant statistics"); 113 125 statJob.setParameterValue("list", new ItemParameterType<ItemList>(ItemList.class, null), list); 126 statJob.setParameterValue("outputBaseName", new StringParameterType(), outputBaseName); 114 127 if (debug) statJob.setName(statJob.getName() + " (debug)"); 115 128 dc.saveItem(statJob); … … 118 131 script.comment("Setting up scripting environment and copying script to tmp folder"); 119 132 script.cmd("export ScriptDir=" + pipeline_scripts_path); 133 script.cmd("OUTNAME="+outputBaseName); 120 134 script.newLine(); 121 135 … … 129 143 statCmd += " ${WD}/vcflist.txt"; 130 144 statCmd += " ${WD}/progress"; 131 statCmd += " ${WD}/ mut_stats.log";132 statCmd += " > tmp/ mut_stats.vcf";145 statCmd += " ${WD}/${OUTNAME}.log"; 146 statCmd += " > tmp/${OUTNAME}.vcf"; 133 147 script.cmd(statCmd); 134 148 script.progress(95, "Sorting and indexing..."); 135 script.cmd(bedtools_path+" sort -header -i tmp/ mut_stats.vcf | bgzip -c > results/mut_stats.vcf.gz");136 script.cmd("tabix results/ mut_stats.vcf.gz");149 script.cmd(bedtools_path+" sort -header -i tmp/${OUTNAME}.vcf | bgzip -c > results/${OUTNAME}.vcf.gz"); 150 script.cmd("tabix results/${OUTNAME}.vcf.gz"); 137 151 script.cmd("cp results/* ${WD}"); 138 152 … … 214 228 { 215 229 String jobName = status.getName(); 216 String log = session.getJobFileAsString(jobName, "mut_stats.log", "UTF-8"); 230 String baseFileName = job.getParameterValue("outputBaseName"); 231 String log = session.getJobFileAsString(jobName, baseFileName+".log", "UTF-8"); 217 232 Stats stat = Stats.parse(log); 218 233 219 234 return "Parsed " + stat.numVcf + " VCF files for " + stat.numPatients + " patients." + 220 235 " Found "+Reggie.formatCount(stat.numVariants) + " variants." + 221 " Result files can be found at: " + session.getHost().getWorkFolder(jobName); 236 " Result files can be found at: " + session.getHost().getWorkFolder(jobName) + 237 "/" + baseFileName + ".*"; 222 238 } 223 239 } -
extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/VariantCallingServlet.java
r5805 r5815 521 521 522 522 Number listId = (Number)jsonReq.get("itemList"); 523 boolean isNormals = "normals".equals(jsonReq.get("sampleType")); 523 524 String clusterId = (String)jsonReq.get("cluster"); 524 525 boolean debug = Boolean.TRUE.equals(jsonReq.get("debug")); … … 539 540 jobCreator.setDebug(debug); 540 541 jobCreator.setPriority(priority == null ? null : priority.intValue()); 542 jobCreator.setOutputBaseName(isNormals ? "scanb-normals" : "scanb-tumors"); 541 543 542 544 Job statJob = jobCreator.createVariantStatisticsJob(dc, cluster, list, progress);
Note: See TracChangeset
for help on using the changeset viewer.