-
Notifications
You must be signed in to change notification settings - Fork 16
[DEPRECATED] 4. Customize KnetMiner server and client code
Now, you can copy/paste any of the available folders that are not “common” and use that as the base for your own project. As an example, let's make one for “human”. So, for example, copy “pig” (the KnetMiner Pig instance) to “human”:
cp -r pig human
There is one important file that has to be changed per project in the "client” folder: utils-config.js
-
In client/src/main/webapp/html/javascript/utils-config.js:
var api_url = "http://qtlnetminer-test.rothamsted.ac.uk/ws-example/arabidopsis/";
has to be replaced by a valid KnetMiner species-specific server path, for example, “http://localhost:8080/ws-example/human” (for Tomcat running locally)
Also change the other variables in utils-config.js to something reasonable for display purposes. For example, to adjust scaling in the GViewer (old) in case the first chromosome is not the longest, add the following line of code:
// specify value of the longest chromosome
var longest_chr= 196087864;
In client/src/main/webapp are also HTML and png files that have to be customized to fit to the new project.
Files that have to be changed:
client/src/main/webapp/html/index.jsp
Change information about the given organism.
client/src/main/webapp/html/release.html
Change details about the data used (url's). The stats about the network are added programmatically when the instance is deployed.
client/src/main/webapp/html/image/organism.png
Replace by appropriate compressed .png picture for organism image or delete (but then make sure to also delete the image in index.jsp).
client/src/main/webapp/html/data/basemap.xml
This file needs chromosome 'number', start, end positions and colors for all chromosomes.
client/src/main/webapp/html/data/sampleQuery.xml
Add details for sample queries. These can be simple queries with just search terms or have defined QTL regions and/or gene lists with them.
client/pom.xml
Replace the name of the organism in all fields.
client/src/main/webapp/WEB-INF/web.xml
Replace the name of the organism in all fields.
../pom.xml
The KnetMiner pom.xml file in the folder above client/ also needs to have the name of your project folder (as a “module”) in order for it to be built and packaged by Maven as a part of the main KnetMiner project.
Species-specific datasources are built separately to the server that will serve them. See section "5. Deploying your knetMiner server and client" to see how to deploy them.
The most important file to customize is datasource/src/main/resources/config.xml The directory under
<entry key="DataPath">
has to point to a temporary directory where files can be written for this species without conflicting with others. IMPORTANT: the server needs to be allowed to write into that directory. So for example, if you're using a Tomcat server, the folder will be owned by user "tomcat" in group "tomcat". Consider adding the user running the KnetMiner server to the "tomcat" group.
The OXL file for the species must be specified under
<entry key="DataFile">
Again, this file must be readable by the server.
Furthermore, the species taxonomy ID under
<entry key="SpeciesTaxId">
The following files have to be customized as well:
datasource/src/main/resources/SemanticMotifs.txt
Change to the motifs for this species.
datasource/pom.xml
Change species name in all entries
datasource/src/main/java/rres/knetminer/datasource/provider/Arabidopsis.java
Rename it to e.g. Human.java, and change all references inside it to the new species. The first parameter to the super() call in the constructor defines how this datasource will appear in URLS, e.g. putting "human" will cause it to appear in URLs as "/human".
The given OXL file has to point to the OXL file generated above using Ondex. You may have to adjust your server's Java parameters to accommodate the file in memory: -Xmx6G means that Java can use a maximum of 6 GB of RAM. Also change the path to Java from “/usr/java/latest/bin/java” to where it is on your server (use “which java” or just “java” should be enough, too).