Changeset 5815


Ignore:
Timestamp:
Jan 24, 2020, 2:37:45 PM (2 years ago)
Author:
Nicklas Nordborg
Message:

References #1208: Implement wizard for building database of variant frequencies in SCAN-B samples

Updated the wizard to ask if the list contains tumor or normal samples. This option affect only the file name of the VCF that is cretated:

  • Tumors: scanb-tumors.vcf.gz
  • Normals: scanb-normals.vcf.gz


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  
    180180    submitInfo.itemList = parseInt(frm.itemList.value);
    181181    submitInfo.cluster = frm.clusters.value;
     182    submitInfo.sampleType = frm.sampleType.value;
    182183    if (frm.priority.selectedIndex >= 0)
    183184    {
  • extensions/net.sf.basedb.reggie/trunk/resources/analysis/vcall_build.jsp

    r5766 r5815  
    6767          way up to a patient item. This is needed since the script calculates
    6868          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.
    6982        </td>
    7083      </tr>
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/grid/VariantStatisticsJobCreator.java

    r5773 r5815  
    2121import net.sf.basedb.core.ProgressReporter;
    2222import net.sf.basedb.core.SessionControl;
     23import net.sf.basedb.core.StringParameterType;
    2324import net.sf.basedb.core.Type;
    2425import net.sf.basedb.core.query.Expressions;
     
    5657  private boolean debug;
    5758  private Integer priority;
     59  private String outputBaseName = "scanb-tumors";
    5860 
    5961  public VariantStatisticsJobCreator()
     
    7678  {
    7779    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;
    7890  }
    7991 
     
    112124    statJob.setName("Build variant statistics");
    113125    statJob.setParameterValue("list", new ItemParameterType<ItemList>(ItemList.class, null), list);
     126    statJob.setParameterValue("outputBaseName", new StringParameterType(), outputBaseName);
    114127    if (debug) statJob.setName(statJob.getName() + " (debug)");
    115128    dc.saveItem(statJob);
     
    118131    script.comment("Setting up scripting environment and copying script to tmp folder");
    119132    script.cmd("export ScriptDir=" + pipeline_scripts_path);
     133    script.cmd("OUTNAME="+outputBaseName);
    120134    script.newLine();
    121135
     
    129143    statCmd += " ${WD}/vcflist.txt";
    130144    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";
    133147    script.cmd(statCmd);
    134148    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");
    137151    script.cmd("cp results/* ${WD}");
    138152   
     
    214228    {
    215229      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");
    217232      Stats stat = Stats.parse(log);
    218233     
    219234      return "Parsed " + stat.numVcf + " VCF files for " + stat.numPatients + " patients." +
    220235        " 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 + ".*";
    222238    }
    223239  }
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/VariantCallingServlet.java

    r5805 r5815  
    521521     
    522522        Number listId = (Number)jsonReq.get("itemList");
     523        boolean isNormals = "normals".equals(jsonReq.get("sampleType"));
    523524        String clusterId = (String)jsonReq.get("cluster");
    524525        boolean debug = Boolean.TRUE.equals(jsonReq.get("debug"));
     
    539540        jobCreator.setDebug(debug);
    540541        jobCreator.setPriority(priority == null ? null : priority.intValue());
     542        jobCreator.setOutputBaseName(isNormals ? "scanb-normals" : "scanb-tumors");
    541543
    542544        Job statJob = jobCreator.createVariantStatisticsJob(dc, cluster, list, progress);
Note: See TracChangeset for help on using the changeset viewer.