Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Volcano plot part1 #753

Merged
merged 63 commits into from
Jan 27, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
04fb973
volcano plot view using Scatterplots.js
Nov 9, 2015
f0f3aa5
code now using only Scatterplots.js
Nov 9, 2015
0be8a32
added the option to add a volcano plot representation of the data.
Nov 9, 2015
182d122
removed field cytoband to free up some space in the UI
Nov 9, 2015
7762233
made drawCoExpInfo optional
Nov 9, 2015
1b20b73
added volcano_plot_view.js
Nov 9, 2015
3e80f94
sending original json data to callback function
Nov 10, 2015
1010558
small fixes and enhancements; further integrated plot with datatable to
Nov 10, 2015
097a7d7
implemented scatterPlotBrushCallBack and special selection cases
Nov 10, 2015
9176c64
implemented special selection cases, added support for optional
Nov 10, 2015
267ecd8
added ScatterPlots.js
Nov 10, 2015
96c94e0
increased width of gene column
Nov 10, 2015
0a69371
renamed method
Nov 10, 2015
ad46bc0
added correct formatting for qtip
Nov 10, 2015
18f24d4
added documentation to new methods
Nov 10, 2015
25852d0
added comments; removed unnecessary code
Nov 10, 2015
85ce926
updated code, removed unnecessary parts
Nov 10, 2015
b18b07c
small documentation improvement
Nov 10, 2015
308e2a9
improved comments
Nov 10, 2015
996194a
code clean-up
Nov 10, 2015
a6f2fb0
merge of rc
Nov 10, 2015
32242e4
added first PROTOTYPE for Euler diagram
Nov 13, 2015
a5c8d9e
volcano plot view using Scatterplots.js
Nov 9, 2015
a08a02e
code now using only Scatterplots.js
Nov 9, 2015
3078816
added the option to add a volcano plot representation of the data.
Nov 9, 2015
0a08e42
removed field cytoband to free up some space in the UI
Nov 9, 2015
2c1e062
made drawCoExpInfo optional
Nov 9, 2015
0c2874a
added volcano_plot_view.js
Nov 9, 2015
83cb642
sending original json data to callback function
Nov 10, 2015
5136e76
small fixes and enhancements; further integrated plot with datatable to
Nov 10, 2015
50e80ef
implemented scatterPlotBrushCallBack and special selection cases
Nov 10, 2015
1e3e978
implemented special selection cases, added support for optional
Nov 10, 2015
6358f9c
added ScatterPlots.js
Nov 10, 2015
9f72196
increased width of gene column
Nov 10, 2015
6c79503
renamed method
Nov 10, 2015
fcd90d9
added correct formatting for qtip
Nov 10, 2015
5838be4
added documentation to new methods
Nov 10, 2015
fe7f9d5
added comments; removed unnecessary code
Nov 10, 2015
709fa33
updated code, removed unnecessary parts
Nov 10, 2015
c306280
small documentation improvement
Nov 10, 2015
170301a
improved comments
Nov 10, 2015
d2f7c6b
code clean-up
Nov 10, 2015
d94232d
added first PROTOTYPE for Euler diagram
Nov 13, 2015
a2d7dc5
added code for a horizontal stacked histogram
Nov 27, 2015
da0d806
added additional comments and code cleanup
Dec 2, 2015
37b3b1d
Merge remote-tracking branch 'origin/volcano_plot_part1' into volcano…
Dec 2, 2015
c196ea9
Removed the venn diagram and updated some variable names which were s…
Dec 2, 2015
b3d9449
Updating the mini-onco functionality and added the possibility to add…
Dec 15, 2015
7945390
label name change suggested by Nikki, gene column width change, chan…
Dec 16, 2015
d2ec738
Created new scatterplot based on plotly
Dec 24, 2015
6917ac9
added plotly
Dec 24, 2015
b0be329
fixed typo
Jan 4, 2016
7f8be13
Merged
Jan 4, 2016
4bcb9a7
- changed the textual arrows to unicode arrows
Jan 6, 2016
5938e82
bugfix for IE
Jan 6, 2016
80880dc
Filtering of table will now only occur when the data in the area changes
Jan 7, 2016
7ffe1c2
Volcano plot also added to other plot tabs
Jan 14, 2016
e44d135
Added a container to keep the components together to fix a bug with t…
Jan 14, 2016
46452e3
Merge branch 'rc'
Jan 14, 2016
6bb7cb7
The merged added new functionality to the datatable, which broke the …
Jan 14, 2016
a67cdd1
mini-onco now immediately visible with a text that suggests a user sh…
Jan 21, 2016
5c7c728
Workaround fix for double-click, which now clears the table filter
Jan 25, 2016
cc366ee
Mini-onco only shown for mutations and copy number
Jan 25, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ protected void doPost(HttpServletRequest httpServletRequest,
tmpProfileObj.put("GENETIC_ALTERATION_TYPE", geneticProfile.getGeneticAlterationType().toString());
tmpProfileObj.put("CANCER_STUDY_ID", geneticProfile.getCancerStudyId());
tmpProfileObj.put("SHOW_PROFILE_IN_ANALYSIS_TAB", geneticProfile.showProfileInAnalysisTab());
// added datatype to be able to make distinction between log data and non-log data
tmpProfileObj.put("DATATYPE", geneticProfile.getDatatype());
result.put(geneticProfile.getStableId(), tmpProfileObj);
}
httpServletResponse.setContentType("application/json");
Expand Down Expand Up @@ -161,6 +163,8 @@ protected void doPost(HttpServletRequest httpServletRequest,
tmpProfileObj.put("GENETIC_ALTERATION_TYPE", geneticProfile.getGeneticAlterationType().toString());
tmpProfileObj.put("CANCER_STUDY_ID", geneticProfile.getCancerStudyId());
tmpProfileObj.put("SHOW_PROFILE_IN_ANALYSIS_TAB", geneticProfile.showProfileInAnalysisTab());
// added datatype to be able to make distinction between log data and non-log data
tmpProfileObj.put("DATATYPE", geneticProfile.getDatatype());
tmpResult.put(geneticProfile.getStableId(), tmpProfileObj);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@
<script type="text/javascript" src="js/src/over-representation-analysis/util.js?<%=GlobalProperties.getAppVersion()%>"></script>
<script type="text/javascript" src="js/src/over-representation-analysis/plots.js?<%=GlobalProperties.getAppVersion()%>"></script>
<script type="text/javascript" src="js/src/over-representation-analysis/boilerplate.js?<%=GlobalProperties.getAppVersion()%>"></script>
<script type="text/javascript" src="js/src/co-exp/components/ScatterPlots.js?<%=GlobalProperties.getAppVersion()%>"></script>
<%--<script type="text/javascript" src="js/src/over-representation-analysis/volcano_plot_view.js?<%=GlobalProperties.getAppVersion()%>"></script>--%>

<script type="text/javascript" src="js/src/over-representation-analysis/stacked_histogram.js?<%=GlobalProperties.getAppVersion()%>"></script>
<link href="css/stacked_histogram.css?<%=GlobalProperties.getAppVersion()%>" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="js/lib/plotly.min.js?<%=GlobalProperties.getAppVersion()%>"></script>
<script type="text/javascript" src="js/src/co-exp/components/ScatterPlotly.js?<%=GlobalProperties.getAppVersion()%>"></script>
<script type="text/javascript" src="js/src/co-exp/components/MiniOnco.js?<%=GlobalProperties.getAppVersion()%>"></script>
<script type="text/javascript" src="js/src/over-representation-analysis/volcano_plot_view.js?<%=GlobalProperties.getAppVersion()%>"></script>

<div class="section" id="or_analysis">
<div id="or-analysis-info-box" style="padding: 10px;margin-top: -40px;"></div>
Expand Down Expand Up @@ -49,6 +58,39 @@
background-color : white;
width: 600px;
}

/* elements for table gene highlighting */
span.selectHighlight{
padding: 1px;
border: 2px solid transparent;
width: 150%;
}
span.selectHighlight:hover{
padding: 1px;
border: 2px solid #1974b8;
cursor: pointer;
}
span.geneSelected{
font-weight: bold;
}
div.geneCheckboxDiv{
width: 100px;
}
div.loaderIcon{
width: 100%;
display:none;
position: absolute;
left: 65%;
top: 30%;
}

div.loaderIconLoading{
display:block;
}

table.tableLoading{
opacity: 0.5;
}
</style>

<script>
Expand Down
11 changes: 11 additions & 0 deletions portal/src/main/webapp/css/stacked_histogram.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.axis path,
.axis line {
fill: none;
stroke: black;
shape-rendering: crispEdges;
}

.axis text {
font-family: Verdana, Arial, sans-serif;
font-size: 11px;
}
44 changes: 44 additions & 0 deletions portal/src/main/webapp/js/lib/plotly.min.js

Large diffs are not rendered by default.

146 changes: 146 additions & 0 deletions portal/src/main/webapp/js/src/co-exp/components/MiniOnco.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
function MiniOnco(plotDiv, miniOncoDiv, originalData){
var stackedHistogram;

// build a mini oncoprint
// the mini oncoprint works as follows
// Bar1: Query Genes
// - Altered Samples
// - Unaltered Samples
// Bar2: Selected Gene
// - Query Genes Altered and Selected Gene Unaltered Samples
// - Query Genes Altered and Selected Gene Altered Samples
// - Query Genes Unaltered and Selected Gene Altered Samples
// - Query Genes Unaltered and Selected Gene Unaltered Samples
this.render = function(current_gene){
// fetch the alteredSamples
window.QuerySession.getAlteredSamples().then(
function (setAlt) {
// when we have the data, create bardata and build the mini oncoprint
var bardata = createBarData(setAlt.length, current_gene);
buildMiniOnco(bardata);
}
)
}

// create the bar data which will be used to create the stacked histogram
function createBarData(setSizeAlt, current_gene){
var bardata;
// retrieve the total number of samples and calculate the setsizes
var totalSetSize = window.QuerySession.getSampleIds().length;
var setSizeUnalt = totalSetSize - setSizeAlt;

if(!stackedHistogram){
bardata = createEmptyBar(setSizeUnalt, setSizeAlt);
//bardata = createSelectedGeneData(current_gene, setSizeUnalt, setSizeAlt);
}
else{
bardata = createSelectedGeneData(current_gene, setSizeUnalt, setSizeAlt);
}

bardata.push({
barName: "Query Genes",
barPieceName: "Query Genes Unaltered: "+setSizeUnalt,
barPieceValue: setSizeUnalt,
color: "lightgrey"
});

bardata.push({
barName: "Query Genes",
barPieceName: "Query Genes Altered: "+setSizeAlt,
barPieceValue: setSizeAlt,
color: "#58ACFA"
});

return bardata;
}

/**
* Creates an empty row for when the mini-onco is created
* @param setSizeUnalt
* @param setSizeAlt
* @returns {*[]}
*/
function createEmptyBar(setSizeUnalt, setSizeAlt){
return [{
barName: "None selected",
barPieceName: "Select gene in table or volcano plot",
barPieceValue: setSizeUnalt + setSizeAlt,
color: "lightgrey",
opacity: 0
},{
barName: "None selected",
barPieceName: "dummy1",
barPieceValue: 0,
color: "#58ACFA",
opacity: 0
},{
barName: "None selected",
barPieceName: "dummy2",
barPieceValue: 0,
color: "#58ACFA",
opacity: 0
},{
barName: "None selected",
barPieceName: "dummy3",
barPieceValue: 0,
color: "lightgrey",
opacity: 0
}
];
}

function createSelectedGeneData(current_gene, setSizeUnalt, setSizeAlt){
// find the numbers in the table
var nrAltInAlt = 0;
var nrAltInUnalt = 0;
for (var i = 0; i < originalData.length; i++) {
if (current_gene == originalData[i]["Gene"]) {
// the cell contains something like 30////0.2345, so the first entry gives us our number
nrAltInAlt = Number(originalData[i]["percentage of alteration in altered group"].split("\/")[0]);
nrAltInUnalt = Number(originalData[i]["percentage of alteration in unaltered group"].split("\/")[0]);
break;
}
}

var selectedGeneData = [{
barName: current_gene,
barPieceName: "Query Genes Unaltered, "+current_gene+" Unaltered: "+(setSizeUnalt - nrAltInUnalt),
barPieceValue: setSizeUnalt - nrAltInUnalt,
color: "lightgrey"
}, {
barName: current_gene,
barPieceName: "Query Genes Unaltered, "+current_gene+" Altered: "+nrAltInUnalt,
barPieceValue: nrAltInUnalt,
color: "#58ACFA"
}, {
barName: current_gene,
barPieceName: "Query Genes Altered, "+current_gene+" Altered: "+nrAltInAlt,
barPieceValue: nrAltInAlt,
color: "#58ACFA"
}, {
barName: current_gene,
barPieceName: "Query Genes Altered, "+current_gene+" Unaltered: "+(setSizeAlt - nrAltInAlt),
barPieceValue: setSizeAlt - nrAltInAlt,
color: "lightgrey"
}];
return selectedGeneData;
}

// create or update the histogram
function buildMiniOnco(bardata){
// if there is no mini-onco yet, append the div and create the histogram
if (!stackedHistogram) {
$("#" + plotDiv).append("<div id='" + miniOncoDiv + "'/>");
stackedHistogram = new stacked_histogram("#" + miniOncoDiv);
stackedHistogram.createStackedHistogram(bardata);
stackedHistogram.addTextToLane("None selected", "Select gene in table or volcano plot");

}
else{
stackedHistogram.removeTextFromLane("None selected");
stackedHistogram.updateStackedHistogram(bardata);
$("#"+miniOncoDiv).css("display", "block");
}
}

}
Loading