Skip to content

Commit

Permalink
Merge pull request #555 from jjgao/master
Browse files Browse the repository at this point in the history
release v0.1.2
  • Loading branch information
jjgao committed Dec 3, 2015
2 parents 813d948 + d68330d commit 8188cb8
Show file tree
Hide file tree
Showing 31 changed files with 5,645 additions and 5,285 deletions.
27 changes: 27 additions & 0 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
languages:
JavaScript: true
Python: true

exclude_paths:
- "test/*"

engines:
rubocop:
enabled: true
golint:
enabled: true
gofmt:
enabled: true
csslint:
enabled: true

ratings:
paths:
- app/**
- lib/**
- "**.rb"
- "**.go"

exclude_paths:
- spec/**/*
- vendor/**/*
2 changes: 1 addition & 1 deletion business/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>master</artifactId>
<groupId>org.mskcc.cbio</groupId>
<version>0.1.1</version>
<version>0.1.2</version>
</parent>

<!-- module metadata -->
Expand Down
2 changes: 1 addition & 1 deletion core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>master</artifactId>
<groupId>org.mskcc.cbio</groupId>
<version>0.1.1</version>
<version>0.1.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>core</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1228,6 +1228,7 @@ public static Collection<Map<String, Object>> countSamplesWithProteinPosStarts(
String hugo = gene.getHugoGeneSymbolAllCaps();

d.put("protein_pos_start", proteinPosStart);
d.put("protein_start_with_hugo", hugo+"_"+proteinPosStart);
d.put("hugo", hugo);
d.put("cancer_study", name);
d.put("cancer_type", cancerType);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,8 @@ private Map<String,List> initMap() {
map.put("end", new ArrayList());
map.put("entrez", new ArrayList());
map.put("gene", new ArrayList());
map.put("protein-start", new ArrayList());
map.put("protein-end", new ArrayList());
map.put("aa", new ArrayList());
map.put("aa-orig", new ArrayList());
map.put("ref", new ArrayList());
Expand Down Expand Up @@ -599,6 +601,8 @@ private void exportMutation(Map<String,List> data, Map<Long, Integer> mapMutatio
String symbol = mutation.getGeneSymbol();
data.get("entrez").add(mutation.getEntrezGeneId());
data.get("gene").add(symbol);
data.get("protein-start").add(mutation.getOncotatorProteinPosStart());
data.get("protein-end").add(mutation.getOncotatorProteinPosEnd());
data.get("aa").add(mutation.getProteinChange());
data.get("aa-orig").add(mutation.getAminoAcidChange());
data.get("ref").add(mutation.getReferenceAllele());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@
import java.io.IOException;
import java.io.PrintWriter;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.mskcc.cbio.portal.model.CanonicalGene;

/**
* @author Gideon Dresdner <dresdnerg@cbio.mskcc.org>
Expand Down Expand Up @@ -136,19 +139,31 @@ public Collection<Map<String, Object>> byProteinPosStarts(List<String> proteinPo
{
List<String> posWithEntrez = new ArrayList<String>();

DaoGeneOptimized daoGeneOptimized = DaoGeneOptimized.getInstance();

// assuming that protein position start string is in a format <GENE>_<POSITION>
Pattern p = Pattern.compile("(.+)_([0-9]+)");
for (String proteinPos: proteinPosStarts)
{
Matcher m = p.matcher(proteinPos);
if (m.find()) {
String symbol = m.group(1);
String position = m.group(2);
CanonicalGene gene = daoGeneOptimized.getGene(symbol);
if (gene!=null) {
long entrezId = gene.getEntrezGeneId();

// create the query string: (<ENTREZ ID>,<POSITION>)
posWithEntrez.add("(" + entrezId + "," + position + ")");
}
}

String[] parts = proteinPos.split("_");

// assuming that protein position start string is in a format <GENE>_<POSITION>
if (parts.length > 1)
{
// get entrez gene id corresponding to the gene symbol
long entrezId = DaoGeneOptimized.getInstance().getGene(parts[0]).getEntrezGeneId();
// create the query string: (<ENTREZ ID>,<POSITION>)
posWithEntrez.add("(" + entrezId + "," + parts[1] + ")");
}
}

if (posWithEntrez.isEmpty()) {
return Collections.emptySet();
}

return DaoMutation.countSamplesWithProteinPosStarts(posWithEntrez, internalGeneticProfileIds());
}
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<artifactId>master</artifactId>
<packaging>pom</packaging>
<name>Portal Master</name>
<version>0.1.1</version>
<version>0.1.2</version>
<description>master maven module</description>
<scm>
<developerConnection>scm:git:https://github.com/cBioPortal/cbioportal.git</developerConnection>
Expand Down
2 changes: 1 addition & 1 deletion portal/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>master</artifactId>
<groupId>org.mskcc.cbio</groupId>
<version>0.1.1</version>
<version>0.1.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>cbioportal</artifactId>
Expand Down
3 changes: 1 addition & 2 deletions portal/src/main/webapp/WEB-INF/jsp/cross_cancer_results.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,8 @@
var showHotspot = <%=showHotspot%>;
var enableMyCancerGenome = myCancerGenomeUrl?true:false;
OncoKB.setUrl('<%=oncokbUrl%>');
$(document).ready(function() {
OncoKB.setUrl('<%=oncokbUrl%>');
//Set Event listener for the modify query button (expand the hidden form)
$("#modify_query_btn").click(function () {
$("#query_form_on_results_page").toggle();
Expand Down
7 changes: 3 additions & 4 deletions portal/src/main/webapp/WEB-INF/jsp/mutation_details.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,9 @@
_mut3dVis = new Mutation3dVis("default3dView");
_mut3dVis.init();
OncoKB.setUrl('<%=oncokbUrl%>');
// Set up Mutation View
$(document).ready(function () {
OncoKB.setUrl('<%=oncokbUrl%>');
var sampleArray = _.keys(PortalGlobals.getPatientSampleIdMap());
var mutationProxy = DataProxyFactory.getDefaultMutationDataProxy();
Expand Down Expand Up @@ -168,7 +167,7 @@
}
if(showHotspot && mutation['isHotspot']) {
vars.changHotspotAlt = "<b>Recurrent Hotspot</b><br/>This mutated amino acid was identified as a recurrent hotspot (statistical significance, q-value < 0.01) in a set of 11,119 tumor samples of various cancer types (based on Chang, M. et al. Nature Biotech. 2015).";
vars.changHotspotAlt = "<b>Recurrent Hotspot</b><br/>This mutated amino acid was identified as a recurrent hotspot (statistical significance, q-value < 0.01) in a set of 11,119 tumor samples of various cancer types (based on <a href=&quot;http://www.ncbi.nlm.nih.gov/pubmed/26619011&quot; target=&quot;_blank&quot;>Chang, M. et al. Nature Biotech. 2015</a>).";
}
var templateFn = BackboneTemplateCache.getTemplateFn("mutation_table_protein_change_oncokb_template");
Expand Down Expand Up @@ -254,7 +253,7 @@
}
if(showHotspot && mutation['isHotspot']) {
vars.changHotspotAlt = "<b>Recurrent Hotspot</b><br/>This mutated amino acid was identified as a recurrent hotspot (statistical significance, q-value < 0.01) in a set of 11,119 tumor samples of various cancer types (based on Chang, M. et al. Nature Biotech. 2015).";
vars.changHotspotAlt = "<b>Recurrent Hotspot</b><br/>This mutated amino acid was identified as a recurrent hotspot (statistical significance, q-value < 0.01) in a set of 11,119 tumor samples of various cancer types (based on <a href=&quot;http://www.ncbi.nlm.nih.gov/pubmed/26619011&quot; target=&quot;_blank&quot;>Chang, M. et al. Nature Biotech. 2015</a>).";
}
var templateFn = BackboneTemplateCache.getTemplateFn("mutation_table_protein_change_oncokb_template");
Expand Down
2 changes: 1 addition & 1 deletion portal/src/main/webapp/WEB-INF/jsp/networks.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
<script type="text/javascript" src="js/lib/json2.js?<%=GlobalProperties.getAppVersion()%>"></script>
<script type="text/javascript" src="js/lib/cytoscape_js/cytoscape.js?<%=GlobalProperties.getAppVersion()%>"></script>
<script type="text/javascript" src="js/lib/cytoscape_js/cytoscape.js-panzoom.js?<%=GlobalProperties.getAppVersion()%>"></script>
<script type="text/javascript" src="js/lib/cytoscape_js/layout.cose2.js?<%=GlobalProperties.getAppVersion()%>"></script>
<script type="text/javascript" src="js/lib/cytoscape_js/layout.cose-bilkent.js?<%=GlobalProperties.getAppVersion()%>"></script>

<!-- <script type="text/javascript" src="js/src/network/network-ui.js?<%=GlobalProperties.getAppVersion()%>"></script> -->
<script type="text/javascript" src="js/src/network/network-visualization.js?<%=GlobalProperties.getAppVersion()%>"></script>
Expand Down
12 changes: 9 additions & 3 deletions portal/src/main/webapp/WEB-INF/jsp/step3_json.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,20 @@
Build Case Set
</a>
-->
<div style="padding-left: 10px">
</td>
</tr>
<tr>
<td></td>
<td>
<div>
<!-- add new link for the new functionality which links to the study view -->
<a id="build_case_set" onclick="openStudyView()" title="Build a Case Set via Study View">
<%= GlobalProperties.getStudyviewLinkText()%>
</a>
</div>
</td>
</tr>
</td>
<td></td>
</tr>
</table>

<div id="custom_case_set_dialog" title="Build a Case Set">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,19 @@
$(oTable).find('.pancan_mutations_histogram_count').each(function() {
if ($(this).hasClass("initialized")) return;
$(this).addClass("initialized");
var proteinPos = $(this).attr('protein_pos');
var keyword = $(this).attr('keyword');
var gene = $(this).attr('gene');
$(this).html(genomicEventObs.pancan_mutation_frequencies.countByKey(keyword));
$(this).html(genomicEventObs.pancan_mutation_frequencies.countByKey(proteinPos));
$(this).qtip({
content: {text: 'pancancer mutation bar chart is broken'},
events: {
render: function(event, api) {
var byPositionData = genomicEventObs.pancan_mutation_frequencies.data[proteinPos];
var byKeywordData = genomicEventObs.pancan_mutation_frequencies.data[keyword];
var byHugoData = genomicEventObs.pancan_mutation_frequencies.data[gene];
var invisible_container = document.getElementById("pancan_mutations_histogram_container");
var histogram = PancanMutationHistogram(byKeywordData, byHugoData, window.cancer_study_meta_data, invisible_container, {this_cancer_study: window.cancerStudyName});
var histogram = PancanMutationHistogram(byPositionData, byKeywordData, byHugoData, window.cancer_study_meta_data, invisible_container, {this_cancer_study: window.cancerStudyName});
var title = "<div><div><h3>"+gene+" mutations across all cancer studies</h3></div>" +
"<div style='float:right;'><button class='cross-cancer-download' file-type='pdf'>PDF</button>"+
Expand Down Expand Up @@ -704,10 +706,11 @@
if (type === 'display') {
var keyword = mutations.getValue(source[0], "key");
var hugo = mutations.getValue(source[0], "gene");
var proteinPos = hugo+"_"+mutations.getValue(source[0], "protein-start");
var ret = "<div class='pancan_mutations_histogram_thumbnail' gene='"+hugo+"' keyword='"+keyword+"'></div>";
var ret = "<div class='pancan_mutations_histogram_thumbnail' protein_pos='"+proteinPos+"' gene='"+hugo+"' keyword='"+keyword+"'></div>";
ret += "<img width='15' height='15' class='pancan_mutations_histogram_wait' src='images/ajax-loader.gif'/>";
ret += "<div class='pancan_mutations_histogram_count' style='float:right' gene='"+hugo+"' keyword='"+keyword+"'></div>";
ret += "<div class='pancan_mutations_histogram_count' style='float:right' protein_pos='"+proteinPos+"' gene='"+hugo+"' keyword='"+keyword+"'></div>";
return ret;
}
Expand Down Expand Up @@ -897,7 +900,7 @@
addNoteTooltip("."+table_id+"-tip");
addNoteTooltip("."+table_id+"-ma-tip",null,{my:'top right',at:'bottom center',viewport: $(window)});
if(showHotspot) {
addNoteTooltip('.'+table_id+'-hotspot', '<b>Recurrent Hotspot</b><br/>This mutated amino acid was identified as a recurrent hotspot (statistical significance, q-value < 0.01) in a set of 11,119 tumor samples of various cancer types (based on Chang, M. et al. Nature Biotech. 2015).');
addNoteTooltip('.'+table_id+'-hotspot', "<b>Recurrent Hotspot</b><br/>This mutated amino acid was identified as a recurrent hotspot (statistical significance, q-value < 0.01) in a set of 11,119 tumor samples of various cancer types (based on <a href='http://www.ncbi.nlm.nih.gov/pubmed/26619011' target='_blank'>Chang, M. et al. Nature Biotech. 2015</a>).");
}
addDrugsTooltip("."+table_id+"-drug-tip", 'top right', 'bottom center');
addCosmicTooltip(table_id);
Expand Down Expand Up @@ -1155,6 +1158,7 @@
var pancanMutationsUrl = "pancancerMutations.json";
var byKeywordResponse = [];
var byHugoResponse = [];
var byProteinPosResponse = [];
function munge(response, key) {
// munge data to get it into the format: keyword -> corresponding datum
Expand All @@ -1179,10 +1183,12 @@
cmd: cmd,
q: accData
}, function(batchData) {
if(cmd == "byKeywords") {
if(cmd === "byKeywords") {
byKeywordResponse = byKeywordResponse.concat(batchData);
} else if( cmd == "byHugos") {
} else if( cmd === "byHugos") {
byHugoResponse = byHugoResponse.concat(batchData);
} else if (cmd === "byProteinPos") {
byProteinPosResponse = byProteinPosResponse.concat(batchData);
} else {
console.trace("Ooops! Something is wrong!");
}
Expand All @@ -1195,11 +1201,17 @@
return jobs;
};
var jobs = splitJobs("byKeywords", genomicEventObs.mutations.data.key)
.concat(splitJobs("byHugos", genomicEventObs.mutations.data.gene));
var keys = genomicEventObs.mutations.data.key;
var genes = genomicEventObs.mutations.data.gene;
var positions = _.map(_.zip.apply(_, [genes, genomicEventObs.mutations.data['protein-start']]), function(pieces) {
return pieces[0]+"_"+pieces[1];
});
var jobs = splitJobs("byKeywords", keys)
.concat(splitJobs("byHugos", genes))
.concat(splitJobs("byProteinPos", positions));
$.when.apply($, jobs).done(function() {
genomicEventObs.pancan_mutation_frequencies.setData(
_.extend(munge(byKeywordResponse, "keyword"), munge(byHugoResponse, "hugo")));
_.extend(munge(byProteinPosResponse, "protein_start_with_hugo"), munge(byKeywordResponse, "keyword"), munge(byHugoResponse, "hugo")));
genomicEventObs.fire("pancan-mutation-frequency-built");
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -419,10 +419,8 @@ var caseMetaData = {
var oncokbGeneStatus = <%=oncokbGeneStatus%>;
var showHotspot = <%=showHotspot%>;
OncoKB.setUrl('<%=oncokbUrl%>');
$(document).ready(function(){
OncoKB.setUrl('<%=oncokbUrl%>');
if (print) $('#page_wrapper_table').css('width', '900px');
tweaksStyles();
outputClinicalData();
Expand Down Expand Up @@ -1190,6 +1188,11 @@ function outputClinicalData() {
diseaseInfo.push("Serum PSA: "+serumPsa);
}
var driverMutations = guessClinicalData(clinicalData,["DRIVER_MUTATIONS"]);
if (driverMutations!==null) {
diseaseInfo.push(driverMutations);
}
return diseaseInfo;
}
Expand Down
31 changes: 20 additions & 11 deletions portal/src/main/webapp/WEB-INF/jsp/visualize.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@
clearInterval(interval);
if (firstTime)
{
$(window).resize();
send2cytoscapeweb(window.networkGraphJSON, "cytoscapeweb", "network");
firstTime = false;
}
Expand All @@ -297,19 +298,27 @@
$("a.result-tab").click(function(){
if($(this).attr("href")=="#network") {
if(firstTime)
{
send2cytoscapeweb(window.networkGraphJSON, "cytoscapeweb", "network");
firstTime = false;
}
else
if($(this).attr("href")=="#network")
{
var interval = setInterval(function() {
if (window.networkGraphJSON != null)
{
// TODO this is a workaround to adjust cytoscape canvas
// and probably not the best way to do it...
$(window).resize();
}
clearInterval(interval);
if(firstTime)
{
$(window).resize();
send2cytoscapeweb(window.networkGraphJSON, "cytoscapeweb", "network");
firstTime = false;
}
else
{
// TODO this is a workaround to adjust cytoscape canvas
// and probably not the best way to do it...
$(window).resize();
}
}
}, 50);
} else {
if($(this).attr("href")=="#bookmark_email") {
$("#bookmark-link").attr("href",window.location.href);
Expand Down
Loading

0 comments on commit 8188cb8

Please sign in to comment.