Commit 63d89929 authored by Guillaume Jimenez's avatar Guillaume Jimenez
Browse files

Added all control fields to Seq Run Details and Order Details

parent 6e64843f
......@@ -22,6 +22,7 @@ response.setDateHeader ("Expires", 0);
<!-- <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> -->
<!-- <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/jquery-ui.min.js"></script> -->
<!-- <script type="text/javascript" src="https://igv.org/web/release/1.0.9/igv-1.0.9.js"></script> -->
<script type="text/javascript" src="https://igv.org/web/release/2.0.0-beta3/dist/igv.min.js"></script>
</head>
......
......@@ -588,6 +588,12 @@ Vue.component('data-table', {
this.items = response.data.items;
this.pagination.totalItems = this.items.length;
this.uniqueIdField = response.data.uniqueIdField;
this.csvContent = response.data.csvContent;
if (this.doExport) {
this.csvContent = response.data.csvContent;
this.createCSVFile();
this.doExport = false;
}
this.stopLoading();
},
//If the response contains data for multiple tables
......
......@@ -364,7 +364,8 @@ const OrderDetails = {
// TODO add more values here if needed. Maybe add that property to Header instead?
isValueTooLong(headerValue) {
return headerValue == 'sampleLabName' || headerValue == 'libDnaBCIndex'
|| headerValue == 'seqRunId' || headerValue == 'correlatedSampleName';
|| headerValue == 'seqRunId' || headerValue == 'correlatedSampleName'
|| headerValue == 'snspSampleName' || headerValue == 'fusionSampleName';
},
scrollWithBar() {
this.$refs.orderSamples.$el.scrollLeft = this.scrollPos;
......
......@@ -62,7 +62,7 @@ const SeqRunDetailsTable = {
<v-layout row wrap>
<v-flex :class="[isControlVisible ? 'xs6' : 'xs12']" >
<data-table ref="seqRunDetailsTable" @need-manual-data="getAjaxData()" table-title="Sequencing Run Data" no-data-text="No Data"
:fetch-on-created="false" initial-sort="seqRunId" :fixed="false"></data-table>
:fetch-on-created="false" initial-sort="seqRunId" :fixed="false" :sort-descending="true" :export-enabled="true"></data-table>
</v-flex>
<v-flex v-show="isControlVisible" class="xs6">
<v-card class="elevation-5">
......@@ -124,6 +124,7 @@ const SeqRunDetailsTable = {
fromDateString: this.fromDate,
toDateString: this.toDate,
sampleId: this.sampleSelected,
doExport: this.$refs.seqRunDetailsTable.doExport
}
})
.then(response => {
......
......@@ -3,6 +3,7 @@ package utsw.bicf.nucliavault.controller;
import java.io.IOException;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.ServletContext;
......@@ -22,6 +23,7 @@ import utsw.bicf.nucliavault.controller.serialization.vuetify.ControlFusionExpan
import utsw.bicf.nucliavault.controller.serialization.vuetify.ControlFusionExpansionTableSummary;
import utsw.bicf.nucliavault.controller.serialization.vuetify.ControlSNSPExpansionTable;
import utsw.bicf.nucliavault.controller.serialization.vuetify.ControlSNSPExpansionTableSummary;
import utsw.bicf.nucliavault.controller.serialization.vuetify.Header;
import utsw.bicf.nucliavault.controller.serialization.vuetify.SeqRunDetailsTableSummary;
import utsw.bicf.nucliavault.controller.serialization.vuetify.SeqRunItems;
import utsw.bicf.nucliavault.controller.serialization.vuetify.Summary;
......@@ -51,7 +53,8 @@ public class SeqRunDetailsController {
@RequestParam(required= false) String machineName,
@RequestParam(required= false) String fromDateString,
@RequestParam(required= false) String toDateString,
@RequestParam(required= false) Integer sampleId) {
@RequestParam(required= false) Integer sampleId,
@RequestParam(defaultValue="false") Boolean doExport) {
try {
LocalDate fromDate = null;
LocalDate toDate = null;
......@@ -63,10 +66,16 @@ public class SeqRunDetailsController {
}
Summary<SeqRunDetailsTable> summary = new SeqRunDetailsTableSummary(
seqRunId, machineName, fromDate, toDate, sampleId, "seqRunId", modelDAO);
if (doExport) {
summary.createCSVContent(new ArrayList<Header>());
}
return summary.createVuetifyDataTableJSON();
} catch (JsonProcessingException e) {
e.printStackTrace();
return null;
} catch (IOException e) {
e.printStackTrace();
return null;
}
}
......
......@@ -139,8 +139,18 @@ public class OrderDetailsSummary {
seqRunHeaders.add(new Header(new String[] {"Avg Pct.", "PF Reads"}, "seqAvgPercPfValue", Units.PCT, new ToolTip("PASS > 80%"), true));
// seqRunHeaders.add(new Header(new String[] {"Sample", "Read Count"}, "seqSampleReadCount", null));
seqRunHeaders.add(new Header(new String[] {"Over", "Q30"}, "seqSampleQ30Value", Units.PCT, new ToolTip("PASS > 80"), true));
seqRunHeaders.add(new Header(new String[] {"PhiX Error", "Rate"}, "seqPhiXErrorRateValue", Units.PCT, new ToolTip("PASS < 1%"), true));
seqRunHeaders.add(new Header(new String[] {"PhiX Error", "Rate"}, "seqPhiXErrorRateValue", Units.PCT, new ToolTip("PASS < 0.7%"), true));
if (!this.primaryOnly) {
seqRunHeaders.add(new Header(new String[] {"SNSP", "Sample Name"}, "snspSampleName"));
seqRunHeaders.add(new Header(new String[] {"SN", "SNP"}, "snSNP", Units.PCT));
seqRunHeaders.add(new Header(new String[] {"SN", "Indel"}, "snIndel", Units.PCT));
seqRunHeaders.add(new Header(new String[] {"SN", "Combined"}, "snCombinedValue", Units.PCT, new ToolTip("PASS > 95" + Units.PCT), true));
seqRunHeaders.add(new Header(new String[] {"PPV", "SNP"}, "ppvSNP", Units.PCT));
seqRunHeaders.add(new Header(new String[] {"PPV", "Indel"}, "ppvIndel", Units.PCT));
seqRunHeaders.add(new Header(new String[] {"PPV", "Combined"}, "ppvCombinedValue", Units.PCT, new ToolTip("PASS > 95" + Units.PCT), true));
seqRunHeaders.add(new Header(new String[] {"Fusion", "Sample Name"}, "fusionSampleName"));
seqRunHeaders.add(new Header(new String[] {"Fusion", "Name"}, "fusionName"));
seqRunHeaders.add(new Header(new String[] {"RNA", "Reads"}, "rnaReadsValue", Units.NB, new ToolTip("PASS > 20"), true));
seqRunHeaders.add(new Header(new String[] {"PhiX", "Aligned"}, "seqRunPctPhiX", Units.PCT));
seqRunHeaders.add(new Header(new String[] {"Seq Run", "Date"}, "seqRunDateFormatted", null));
seqRunHeaders.add(new Header(new String[] {"Scientist", "Name"}, "seqRunTechName", null));
......
......@@ -420,7 +420,7 @@ public class SampleDetailsTableSummary extends Summary<SampleDetailsTable>{
percLane.setIsExpansion(true);
headers.add(percLane);
Header phiXError = new Header(new String[] {"Avg PhiX","Error"}, "avgPhiXErrorValue", Units.NB, new ToolTip("PASS < 1%"), true);
Header phiXError = new Header(new String[] {"Avg PhiX","Error"}, "avgPhiXErrorValue", Units.NB, new ToolTip("PASS < 0.7%"), true);
phiXError.setIsDna(true);
phiXError.setIsRna(true);
phiXError.setIsExpansion(true);
......
package utsw.bicf.nucliavault.controller.serialization.vuetify;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import utsw.bicf.nucliavault.controller.serialization.Units;
import utsw.bicf.nucliavault.dao.ModelDAO;
import utsw.bicf.nucliavault.model.ControlFusion;
import utsw.bicf.nucliavault.model.ControlSNSP;
import utsw.bicf.nucliavault.model.hybrid.SeqRunDetailsTable;
//JSON Object with
......@@ -14,7 +20,49 @@ import utsw.bicf.nucliavault.model.hybrid.SeqRunDetailsTable;
public class SeqRunDetailsTableSummary extends Summary<SeqRunDetailsTable>{
public SeqRunDetailsTableSummary(String seqRunId, String machineName, LocalDate fromDate, LocalDate toDate, Integer sampleId, String uniqueIdField, ModelDAO modelDAO) {
super(modelDAO.getSeqRunDetailsSummaryData(seqRunId, machineName, fromDate, toDate, sampleId, modelDAO), uniqueIdField);
super(getData(seqRunId, machineName, fromDate, toDate, sampleId, modelDAO), uniqueIdField);
}
private static List<SeqRunDetailsTable> getData(String seqRunId, String machineName, LocalDate fromDate, LocalDate toDate, Integer sampleId, ModelDAO modelDAO) {
List<SeqRunDetailsTable> data = modelDAO.getSeqRunDetailsSummaryData(seqRunId, machineName, fromDate, toDate, sampleId, modelDAO);
List<ControlSNSP> snsps = modelDAO.getAllControlSNSPs().stream().filter(i -> i.getCaller().equals("genomeseer")).collect(Collectors.toList());
List<ControlFusion> fusions = modelDAO.getAllControlFusions();
for (SeqRunDetailsTable item : data) {
for (ControlSNSP snsp : snsps) {
if (snsp.getSeqRun().getSeqRunId().equals(item.getSeqRunId())) {
item.setControlSampleName(snsp.getSample().getSampleLabId());
item.setPpvCombined(snsp.getPpvCombined());
item.setSnCombined(snsp.getSnCombined());
item.setSnSNP(snsp.getSnSNP());
item.setSnIndel(snsp.getSnIndel());
item.setPpvSNP(snsp.getPpvSNP());
item.setPpvIndel(snsp.getPpvIndel());
}
}
Map<String, ControlFusion> uniqueFusions = new HashMap<String, ControlFusion>();
for (ControlFusion f : fusions) {
String fusionName = f.getFusionName().replaceAll("-", "").replaceAll("ROS1", "") + f.getSample().getSampleId();
ControlFusion existingFusion = uniqueFusions.get(fusionName);
if (existingFusion == null) {
uniqueFusions.put(fusionName, f);
}
else if (f.getRnaReads() > existingFusion.getRnaReads()) {
uniqueFusions.put(fusionName, f);
}
}
fusions = new ArrayList<ControlFusion>();
fusions.addAll(uniqueFusions.values());
for (ControlFusion fusion : fusions) {
if (fusion.getSeqRun().getSeqRunId().equals(item.getSeqRunId())) {
item.setFusionSampleName(fusion.getSample().getSampleLabId());
item.setFusionName(fusion.getFusionName());
item.setRnaReads(fusion.getRnaReads());
}
}
}
return data;
}
@Override
......@@ -41,6 +89,45 @@ public class SeqRunDetailsTableSummary extends Summary<SeqRunDetailsTable>{
headers.add(new Header(new String[] {"Avg. Qual.", "Score"}, "avgQualScore", Units.NB));
headers.add(new Header("% Lane", "percLane", Units.PCT));
//controls
Header controlSample = new Header(new String[] {"SNSP", "Sample"}, "controlSampleName");
headers.add(controlSample);
Header snSNP = new Header(new String[] {"SN", "SNP"}, "snSNP", Units.PCT);
snSNP.setIsExpansion(true);
snSNP.setWidth("125px");
headers.add(snSNP);
Header snIndel = new Header(new String[] {"SN", "Indel"}, "snIndel", Units.PCT);
snIndel.setIsExpansion(true);
snIndel.setWidth("125px");
headers.add(snIndel);
Header snCombined = new Header(new String[] {"SN", "Combined"}, "snCombined", Units.PCT);
snCombined.setWidth("125px");
headers.add(snCombined);
Header ppvSNP = new Header(new String[] {"PPV", "SNP"}, "ppvSNP", Units.PCT);
ppvSNP.setIsExpansion(true);
ppvSNP.setWidth("125px");
headers.add(ppvSNP);
Header ppvIndel = new Header(new String[] {"PPV", "Indel"}, "ppvIndel", Units.PCT);
ppvIndel.setIsExpansion(true);
ppvIndel.setWidth("125px");
headers.add(ppvIndel);
Header ppvCombined = new Header(new String[] {"PPV", "Combined"}, "ppvCombined", Units.PCT);
ppvCombined.setWidth("125px");
headers.add(ppvCombined);
Header fusionSample = new Header(new String[] {"Fusion", "Sample"}, "fusionSampleName");
fusionSample.setWidth("150px");
headers.add(fusionSample);
Header fusion = new Header("Fusion", "fusionName");
fusion.setWidth("100px");
headers.add(fusion);
Header rnaReads = new Header(new String[] {"RNA", "Reads"}, "rnaReads", Units.NB);
rnaReads.setWidth("125px");
headers.add(rnaReads);
//keep in the same order
headerOrder = headers.stream().map(header -> header.getValue()).collect(Collectors.toList());
......
......@@ -20,7 +20,12 @@ import utsw.bicf.nucliavault.clarity.api.utils.TypeUtils;
import utsw.bicf.nucliavault.controller.serialization.PassableValue;
import utsw.bicf.nucliavault.controller.serialization.ToolTip;
import utsw.bicf.nucliavault.controller.serialization.Units;
import utsw.bicf.nucliavault.controller.serialization.vuetify.ControlFusionExpansionTable;
import utsw.bicf.nucliavault.controller.serialization.vuetify.ControlFusionExpansionTableSummary;
import utsw.bicf.nucliavault.controller.serialization.vuetify.ControlSNSPExpansionTable;
import utsw.bicf.nucliavault.controller.serialization.vuetify.ControlSNSPExpansionTableSummary;
import utsw.bicf.nucliavault.controller.serialization.vuetify.Header;
import utsw.bicf.nucliavault.controller.serialization.vuetify.Summary;
import utsw.bicf.nucliavault.dao.ModelDAO;
import utsw.bicf.nucliavault.model.Demultiplex;
import utsw.bicf.nucliavault.model.DnaAlignment;
......@@ -162,6 +167,21 @@ public class SampleDetails {
public LocalDateTime seqRunDate;
public String seqRunTechName;
// Seq Run Controls
public String snspSampleName;
public Float ppvCombined;
public PassableValue ppvCombinedValue;
public Float snCombined;
public PassableValue snCombinedValue;
public Float snSNP;
public Float snIndel;
public Float ppvSNP;
public Float ppvIndel;
public String fusionSampleName;
public String fusionName;
public Integer rnaReads;
public PassableValue rnaReadsValue;
// Alignment
public Float mapRate;
public PassableValue mapRateValue;
......@@ -488,6 +508,19 @@ public class SampleDetails {
analysisTAT = (int) (seconds / (3600 * 24));
}
}
Summary<ControlSNSPExpansionTable> summary = new ControlSNSPExpansionTableSummary("sampleId", modelDAO, seqRunId);
if (summary.getItems() != null && !summary.getItems().isEmpty()) {
ControlSNSPExpansionTable item = summary.getItems().get(0);
snspSampleName = item.getSampleName();
ppvCombined = item.getPpvCombined();
snIndel = item.getSnIndel();
snSNP = item.getSnSNP();
ppvCombinedValue = new PassableValue(Threshold.getThreshold(thresholds, Threshold.CONTROL_PPV_COMBINED), "ppvCombinedValue", ppvCombined);
ppvIndel = item.getPpvIndel();
ppvSNP = item.getPpvSNP();
snCombined = item.getSnCombined();
snCombinedValue = new PassableValue(Threshold.getThreshold(thresholds, Threshold.CONTROL_SN_COMBINED), "snCombinedValue", snCombined);
}
}
else if (run != null && sample.isRna()) {
......@@ -511,6 +544,15 @@ public class SampleDetails {
analysisTAT = (int) (seconds / (3600 * 24));
}
}
Summary<ControlFusionExpansionTable> summary = new ControlFusionExpansionTableSummary("sampleId", modelDAO, seqRunId);
if (summary.getItems() != null && !summary.getItems().isEmpty()) {
ControlFusionExpansionTable item = summary.getItems().get(0);
fusionSampleName = item.getSampleName();
fusionName = item.getFusionName();
rnaReads = item.getRnaReads();
rnaReadsValue = new PassableValue(Threshold.getThreshold(thresholds, Threshold.CONTROL_FUSION_RNA_READS), "rnaReadsValue", rnaReads);
}
}
List<Integer> sampleIds = new ArrayList<Integer>();
......@@ -1214,6 +1256,58 @@ public class SampleDetails {
return rawAvgDepthValue;
}
public String getSnspSampleName() {
return snspSampleName;
}
public Float getPpvCombined() {
return ppvCombined;
}
public PassableValue getPpvCombinedValue() {
return ppvCombinedValue;
}
public Float getSnCombined() {
return snCombined;
}
public PassableValue getSnCombinedValue() {
return snCombinedValue;
}
public String getFusionSampleName() {
return fusionSampleName;
}
public String getFusionName() {
return fusionName;
}
public Integer getRnaReads() {
return rnaReads;
}
public PassableValue getRnaReadsValue() {
return rnaReadsValue;
}
public Float getSnIndel() {
return snIndel;
}
public Float getPpvSNP() {
return ppvSNP;
}
public Float getPpvIndel() {
return ppvIndel;
}
public Float getSnSNP() {
return snSNP;
}
// public PassableValue getSeqRunClusterDensityR1Value() {
// return seqRunClusterDensityR1Value;
// }
......
......@@ -33,6 +33,18 @@ public class SeqRunDetailsTable {
String sampleName;
String runDateFormatted;
BigInteger clusterDensityR1;
//Control
String controlSampleName;
Float ppvSNP;
Float ppvIndel;
Float ppvCombined;
Float snSNP;
Float snIndel;
Float snCombined;
String fusionSampleName;
String fusionName;
Integer rnaReads;
public SeqRunDetailsTable(Object[] values, String[] labels) throws ParseException {
for (int i = 0; i < labels.length; i++) {
......@@ -198,4 +210,104 @@ public class SeqRunDetailsTable {
this.clusterDensityR1 = clusterDensityR1;
}
public String getControlSampleName() {
return controlSampleName;
}
public void setControlSampleName(String controlSampleName) {
this.controlSampleName = controlSampleName;
}
public Float getPpvCombined() {
return ppvCombined;
}
public void setPpvCombined(Float ppvCombined) {
this.ppvCombined = ppvCombined;
}
public Float getSnCombined() {
return snCombined;
}
public void setSnCombined(Float snCombined) {
this.snCombined = snCombined;
}
public String getFusionSampleName() {
return fusionSampleName;
}
public void setFusionSampleName(String fusionSampleName) {
this.fusionSampleName = fusionSampleName;
}
public String getFusionName() {
return fusionName;
}
public void setFusionName(String fusionName) {
this.fusionName = fusionName;
}
public Integer getRnaReads() {
return rnaReads;
}
public void setRnaReads(Integer rnaReads) {
this.rnaReads = rnaReads;
}
public Float getPpvSNP() {
return ppvSNP;
}
public void setPpvSNP(Float ppvSNP) {
this.ppvSNP = ppvSNP;
}
public Float getPpvIndel() {
return ppvIndel;
}
public void setPpvIndel(Float ppvIndel) {
this.ppvIndel = ppvIndel;
}
public Float getSnSNP() {
return snSNP;
}
public void setSnSNP(Float snSNP) {
this.snSNP = snSNP;
}
public Float getSnIndel() {
return snIndel;
}
public void setSnIndel(Float snIndel) {
this.snIndel = snIndel;
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment