Skip to content

Commit

Permalink
Merge pull request #249 from AjitPS/201710_new_Lucene
Browse files Browse the repository at this point in the history
fixes to 201710_new_lucene branch code
  • Loading branch information
AjitPS authored Feb 23, 2018
2 parents 7da68a5 + 6ba0337 commit 5eedc86
Show file tree
Hide file tree
Showing 23 changed files with 863 additions and 115 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ stdout.log
*swp
.vagrant/
common/client/nb-configuration.xml
*.oxl
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
//var data_url = "https://ondex.rothamsted.ac.uk/arabidopsis_data/";
var data_url = "http://knetminer.rothamsted.ac.uk/arabidopsis_data/";
//var data_url = "http://qtlnetminer-test.rothamsted.ac.uk/arabidopsis_data/"; // now, using HTTP instead of HTTPS
//var data_url = "http://maize-dev.rothamsted.ac.uk/arabidopsis_data/"; // test on maize-dev
//var applet_url = "https://ondex.rothamsted.ac.uk/OndexWebBeta/";
//var data_url = "http://qtlnetminer-test.rothamsted.ac.uk/arabidopsis_data/"; // test
//var data_url = "http://maize-dev.rothamsted.ac.uk/arabidopsis_data/"; // test
var species = "Arabidopsis Genome";
var reference_genome = true; //true if you are providing a reference genome
var multiorganisms = false; //true if you specified more than one taxid in the server file config.xml (ie: <entry key="SpeciesTaxId">4113,4081</entry>)
Expand Down
1 change: 1 addition & 0 deletions common/client/src/main/webapp/WEB-INF/tags/layout/page.tag
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
<script src="https://cdnjs.cloudflare.com/ajax/libs/qtip2/2.2.0/jquery.qtip.min.js"></script>
<script src="html/KnetMaps/libs/cytoscape-qtip.js"></script>
<script src="html/KnetMaps/libs/jquery.maskloader.js"></script>
<script src="html/KnetMaps/libs/FileSaver.min.js"></script>
<!-- Layouts -->
<script src="html/KnetMaps/libs/cose_bilkent/cytoscape-cose-bilkent.js"></script>
<script src="html/KnetMaps/libs/ngraph_forceLayout/cytoscape-ngraph.forcelayout.js"></script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,10 @@
* Filter visible table by selected Concept Type
*/
function filterTableByType(key) {
// console.log("filterTableByType: "+ key);
console.log("filterTableByType: "+ key);
// Check which Tab user is on: Gene View or Evidence View
if ($('#resultsTable').css('display') === 'block') {
// $("#loadingDiv_GeneView").css("display","block"); // notify
// get tbody
// $('#tablesorter').children('tbody');
var gvTable= /*$('#tablesorter');*/ document.getElementById("tablesorter");
Expand All @@ -93,7 +94,7 @@
var currentRow= gvTable.rows.item(i);
// get cells of current row
var gv_cells = currentRow.cells;
var gene_acc= gv_cells.item(0).innerHTML; // Accession
// var gene_acc= gv_cells.item(0).innerHTML; // Accession
var gene_evidences= gv_cells.item(gv_cells.length-2).innerHTML; // Evidences
// if this Accession doesn't have key in evidences, hide the row.
if(!gene_evidences.includes(key)) {
Expand All @@ -102,5 +103,6 @@
currentRow.style.display= 'none';
}
}
// $("#loadingDiv_GeneView").css("display","none"); // // clear
}
}
138 changes: 138 additions & 0 deletions common/client/src/main/webapp/html/KnetMaps/config/KnetMiner_style.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<vizmap documentVersion="3.0" id="VizMap-2017_10_13-15_16">
<visualStyle name="KnetMiner_networkStyle">
<network>
<visualProperty name="NETWORK_HEIGHT" default="400.0"/>
<visualProperty name="NETWORK_NODE_SELECTION" default="true"/>
<visualProperty name="NETWORK_CENTER_Z_LOCATION" default="0.0"/>
<visualProperty name="NETWORK_CENTER_Y_LOCATION" default="0.0"/>
<visualProperty name="NETWORK_TITLE" default=""/>
<visualProperty name="NETWORK_BACKGROUND_PAINT" default="#FFFFFF"/>
<visualProperty name="NETWORK_CENTER_X_LOCATION" default="0.0"/>
<visualProperty name="NETWORK_DEPTH" default="0.0"/>
<visualProperty name="NETWORK_WIDTH" default="550.0"/>
<visualProperty name="NETWORK_SCALE_FACTOR" default="1.0"/>
<visualProperty name="NETWORK_EDGE_SELECTION" default="true"/>
</network>
<node>
<dependency name="nodeCustomGraphicsSizeSync" value="true"/>
<dependency name="nodeSizeLocked" value="true"/>
<visualProperty name="NODE_HEIGHT" default="40.0"/>
<visualProperty name="NODE_LABEL_POSITION" default="C,C,c,0.00,0.00"/>
<visualProperty name="NODE_CUSTOMGRAPHICS_SIZE_7" default="0.0"/>
<visualProperty name="NODE_CUSTOMGRAPHICS_4" default="org.cytoscape.ding.customgraphics.NullCustomGraphics,0,[ Remove Graphics ],"/>
<visualProperty name="NODE_LABEL_FONT_FACE" default="SansSerif.plain,plain,12"/>
<visualProperty name="NODE_LABEL_WIDTH" default="200.0"/>
<visualProperty name="NODE_CUSTOMGRAPHICS_SIZE_5" default="0.0"/>
<visualProperty name="NODE_VISIBLE" default="true"/>
<visualProperty name="NODE_TRANSPARENCY" default="255"/>
<visualProperty name="NODE_Y_LOCATION" default="0.0"/>
<visualProperty name="NODE_SELECTED_PAINT" default="#FFFF00"/>
<visualProperty name="NODE_CUSTOMGRAPHICS_SIZE_4" default="0.0"/>
<visualProperty name="NODE_CUSTOMGRAPHICS_8" default="org.cytoscape.ding.customgraphics.NullCustomGraphics,0,[ Remove Graphics ],"/>
<visualProperty name="NODE_SIZE">
<discreteMapping attributeType="string" attributeName="conceptSize">
<discreteMappingEntry value="18.0" attributeValue="18px"/>
<discreteMappingEntry value="26.0" attributeValue="26px"/>
<discreteMappingEntry value="22.0" attributeValue="22px"/>
</discreteMapping>
</visualProperty>
<visualProperty name="NODE_NESTED_NETWORK_IMAGE_VISIBLE" default="true"/>
<visualProperty name="NODE_BORDER_WIDTH" default="2.0">
<discreteMapping attributeType="string" attributeName="conceptBorderWidth">
<discreteMappingEntry value="1.0" attributeValue="1px"/>
<discreteMappingEntry value="3.0" attributeValue="3px"/>
</discreteMapping>
</visualProperty>
<visualProperty name="NODE_CUSTOMGRAPHICS_POSITION_1" default="C,C,c,0.00,0.00"/>
<visualProperty name="NODE_CUSTOMGRAPHICS_POSITION_7" default="C,C,c,0.00,0.00"/>
<visualProperty name="NODE_CUSTOMGRAPHICS_POSITION_2" default="C,C,c,0.00,0.00"/>
<visualProperty name="NODE_LABEL_FONT_SIZE" default="12"/>
<visualProperty name="NODE_FILL_COLOR" default="#C80000">
<passthroughMapping attributeType="string" attributeName="conceptColor"/>
</visualProperty>
<visualProperty name="NODE_CUSTOMGRAPHICS_SIZE_1" default="0.0"/>
<visualProperty name="NODE_CUSTOMGRAPHICS_3" default="org.cytoscape.ding.customgraphics.NullCustomGraphics,0,[ Remove Graphics ],"/>
<visualProperty name="NODE_CUSTOMGRAPHICS_POSITION_3" default="C,C,c,0.00,0.00"/>
<visualProperty name="NODE_LABEL" default="">
<passthroughMapping attributeType="string" attributeName="value"/>
</visualProperty>
<visualProperty name="NODE_CUSTOMGRAPHICS_9" default="org.cytoscape.ding.customgraphics.NullCustomGraphics,0,[ Remove Graphics ],"/>
<visualProperty name="NODE_TOOLTIP" default=""/>
<visualProperty name="NODE_CUSTOMGRAPHICS_6" default="org.cytoscape.ding.customgraphics.NullCustomGraphics,0,[ Remove Graphics ],"/>
<visualProperty name="NODE_CUSTOMGRAPHICS_SIZE_3" default="0.0"/>
<visualProperty name="NODE_CUSTOMGRAPHICS_2" default="org.cytoscape.ding.customgraphics.NullCustomGraphics,0,[ Remove Graphics ],"/>
<visualProperty name="COMPOUND_NODE_PADDING" default="10.0"/>
<visualProperty name="NODE_LABEL_COLOR" default="#000000">
<passthroughMapping attributeType="string" attributeName="conceptTextBGcolor"/>
</visualProperty>
<visualProperty name="NODE_BORDER_STROKE" default="SOLID">
<discreteMapping attributeType="string" attributeName="conceptBorderStyle">
<discreteMappingEntry value="SOLID" attributeValue="solid"/>
<discreteMappingEntry value="PARALLEL_LINES" attributeValue="double"/>
</discreteMapping>
</visualProperty>
<visualProperty name="NODE_CUSTOMGRAPHICS_POSITION_8" default="C,C,c,0.00,0.00"/>
<visualProperty name="NODE_CUSTOMGRAPHICS_POSITION_9" default="C,C,c,0.00,0.00"/>
<visualProperty name="NODE_CUSTOMGRAPHICS_POSITION_6" default="C,C,c,0.00,0.00"/>
<visualProperty name="NODE_CUSTOMGRAPHICS_SIZE_9" default="0.0"/>
<visualProperty name="NODE_CUSTOMGRAPHICS_POSITION_4" default="C,C,c,0.00,0.00"/>
<visualProperty name="NODE_SHAPE" default="ELLIPSE">
<passthroughMapping attributeType="string" attributeName="conceptShape"/>
</visualProperty>
<visualProperty name="NODE_CUSTOMGRAPHICS_5" default="org.cytoscape.ding.customgraphics.NullCustomGraphics,0,[ Remove Graphics ],"/>
<visualProperty name="NODE_CUSTOMGRAPHICS_POSITION_5" default="C,C,c,0.00,0.00"/>
<visualProperty name="NODE_BORDER_PAINT" default="#000000">
<passthroughMapping attributeType="string" attributeName="conceptBorderColor"/>
</visualProperty>
<visualProperty name="NODE_CUSTOMGRAPHICS_SIZE_2" default="0.0"/>
<visualProperty name="NODE_CUSTOMGRAPHICS_7" default="org.cytoscape.ding.customgraphics.NullCustomGraphics,0,[ Remove Graphics ],"/>
<visualProperty name="NODE_CUSTOMGRAPHICS_SIZE_8" default="0.0"/>
<visualProperty name="NODE_CUSTOMGRAPHICS_1" default="org.cytoscape.ding.customgraphics.NullCustomGraphics,0,[ Remove Graphics ],"/>
<visualProperty name="NODE_LABEL_TRANSPARENCY" default="255"/>
<visualProperty name="NODE_SELECTED" default="false"/>
<visualProperty name="COMPOUND_NODE_SHAPE" default="ROUND_RECTANGLE"/>
<visualProperty name="NODE_WIDTH" default="60.0"/>
<visualProperty name="NODE_Z_LOCATION" default="0.0"/>
<visualProperty name="NODE_DEPTH" default="0.0"/>
<visualProperty name="NODE_BORDER_TRANSPARENCY" default="255"/>
<visualProperty name="NODE_X_LOCATION" default="0.0"/>
<visualProperty name="NODE_CUSTOMGRAPHICS_SIZE_6" default="0.0"/>
</node>
<edge>
<dependency name="arrowColorMatchesEdge" value="true"/>
<visualProperty name="EDGE_SELECTED" default="false"/>
<visualProperty name="EDGE_SOURCE_ARROW_UNSELECTED_PAINT" default="#000000"/>
<visualProperty name="EDGE_LINE_TYPE" default="SOLID"/>
<visualProperty name="EDGE_LABEL" default="">
<passthroughMapping attributeType="string" attributeName="label"/>
</visualProperty>
<visualProperty name="EDGE_TARGET_ARROW_SELECTED_PAINT" default="#FFFF00"/>
<visualProperty name="EDGE_TOOLTIP" default=""/>
<visualProperty name="EDGE_UNSELECTED_PAINT">
<passthroughMapping attributeType="string" attributeName="relationColor"/>
</visualProperty>
<visualProperty name="EDGE_TRANSPARENCY" default="255"/>
<visualProperty name="EDGE_BEND"/>
<visualProperty name="EDGE_SOURCE_ARROW_SELECTED_PAINT" default="#FFFF00"/>
<visualProperty name="EDGE_CURVED" default="true"/>
<visualProperty name="EDGE_WIDTH" default="1.0">
<discreteMapping attributeType="string" attributeName="relationSize">
<discreteMappingEntry value="1.0" attributeValue="1px"/>
<discreteMappingEntry value="3.0" attributeValue="3px"/>
</discreteMapping>
</visualProperty>
<visualProperty name="EDGE_LABEL_FONT_FACE" default="SansSerif.plain,plain,10"/>
<visualProperty name="EDGE_LABEL_FONT_SIZE" default="10"/>
<visualProperty name="EDGE_STROKE_SELECTED_PAINT" default="#FF0000"/>
<visualProperty name="EDGE_SOURCE_ARROW_SHAPE" default="NONE"/>
<visualProperty name="EDGE_TARGET_ARROW_UNSELECTED_PAINT" default="#000000"/>
<visualProperty name="EDGE_STROKE_UNSELECTED_PAINT" default="#404040"/>
<visualProperty name="EDGE_VISIBLE" default="true"/>
<visualProperty name="EDGE_LABEL_TRANSPARENCY" default="255"/>
<visualProperty name="EDGE_TARGET_ARROW_SHAPE" default="ARROW_SHORT"/>
<visualProperty name="EDGE_LABEL_WIDTH" default="200.0"/>
<visualProperty name="EDGE_LABEL_COLOR" default="#000000"/>
</edge>
</visualStyle>
</vizmap>
Original file line number Diff line number Diff line change
Expand Up @@ -73,22 +73,34 @@ function popupItemInfo() {
var cy= $('#cy').cytoscape('get'); // now we have a global reference to `cy`
var exportJson= cy.json(); // get JSON object for the network graph.

// Display in a new blank browser tab.
// window.open().document.write(exportJson); // for text data
window.open('data:application/json;' + (window.btoa?'base64,'+btoa(JSON.stringify(exportJson)):JSON.stringify(exportJson))); // for JSON data
// Display in a new blank browser tab, e.g, window.open().document.write("text"); // for text data
// window.open('data:application/json;' + (window.btoa?'base64,'+btoa(JSON.stringify(exportJson)):JSON.stringify(exportJson))); // for JSON data

/* TO DO: use FileSaverJS to open directly open file downloader & write to local file. */
//
// use FileSaver.js to save using file downloader
// var kNet_json_Blob= new Blob([JSON.stringify(exportJson)], {type: "text/plain;charset=utf-8"});
// saveAs(kNet_json_Blob, "kNetwork.cyjs.json");
var kNet_json= new File([JSON.stringify(exportJson)], "kNetwork.cyjs.json", {type: "text/plain;charset=utf-8"});
saveAs(kNet_json);
}

// Export the graph as a .png image and allow users to save it.
function exportAsImage() {
var cy= $('#cy').cytoscape('get'); // now we have a global reference to `cy`
// Export as .png image
var png64= cy.png(); // .setAttribute('crossOrigin', 'anonymous');

// Display the exported image in a new blank browser window instead of having it in the same window.
// Display the exported image in a new window.
window.open(png64,'Image','width=1200px,height=600px,resizable=1');

// use FileSaver.js to save using file downloader; fails (creates corrupted png)
/*cy_image= new Image();
cy_image.src=png64;
var canvas= document.getElementById('my-canvas'); // use canvas
context= canvas.getContext('2d');
context.drawImage(cy_image, 0,0); // draw image on canvas
// convert canvas to Blob & save using FileSaver.js.
canvas.toBlob(function(blob) {
saveAs(blob, "kNetwork.png");
}, "image/png");*/
}

// Remove hidden effect from nodes/ edges, if hidden.
Expand Down
Loading

0 comments on commit 5eedc86

Please sign in to comment.