Skip to content

Commit

Permalink
Merge 6653859 into 0974571
Browse files Browse the repository at this point in the history
  • Loading branch information
nathandunn committed Jun 21, 2017
2 parents 0974571 + 6653859 commit b6db524
Show file tree
Hide file tree
Showing 321 changed files with 31,230 additions and 3,329 deletions.
11 changes: 9 additions & 2 deletions apollo
Expand Up @@ -17,6 +17,7 @@ function usage(){
echo "test: Runs test-suite.";
echo "debug: Runs from current directory in debug mode (non-minimized javascript).";
echo "watchman: Creates watchman daemon to autocopy plugin files (non-minimized javascript).";
echo "watch-jbrowse: Creates watchman daemon to autocopy jbrowse files (non-minimized javascript).";
echo "compile: Compiled the build.";
echo "clean: Removes class files.";
echo "clean-all: Removes class files and jbrowse files.";
Expand Down Expand Up @@ -167,8 +168,8 @@ function clean_all(){

if [[ $1 == "devmode" ]];then
check_configs
$gradle_executable handleJBrowse copyResourcesDev devmode &
$grails_executable -reloading run-app
$gradle_executable handleJBrowse copy-resources copyResourcesDev devmode &
$grails_executable run-app
elif [[ $1 == "run-local" ]];then
check_configs
if [[ $# == 2 ]]; then
Expand All @@ -182,6 +183,12 @@ elif [[ $1 == "watchman" ]]; then
echo "Watchman not found. Install watchman to automatically update the client side plugins for apollo development modes"
fi
if [ -x "$watchman_executable" ]; then $watchman_executable -- trigger $(PWD) jsfilescopy 'client/apollo/**/*.js' -- scripts/copy_client.sh; fi;
elif [[ $1 == "watch-jbrowse" ]]; then
watchman_executable=$(which watchman)
if ! [ -x "$watchman_executable" ] ; then
echo "Watchman not found. Install watchman to automatically update the client side plugins for apollo development modes"
fi
if [ -x "$watchman_executable" ]; then $watchman_executable -- trigger $(PWD) jsfilescopy 'client/apollo/**/*.js' -- scripts/copy_client.sh -- ant copy-resources-dev; fi;
elif [[ $1 == "run-app" ]];then
check_configs
if [[ $# == 2 ]]; then
Expand Down
2 changes: 1 addition & 1 deletion application.properties
Expand Up @@ -3,4 +3,4 @@
app.grails.version=2.5.5
app.name=apollo
app.servlet.version=3.0
app.version=2.0.7-snapshot
app.version=2.1.0-SNAPSHOT
21 changes: 19 additions & 2 deletions build.gradle
Expand Up @@ -14,15 +14,19 @@ import org.apache.tools.ant.taskdefs.condition.Os
buildscript {
repositories {
mavenCentral()
jcenter()
}
// https://github.com/steffenschaefer/gwt-gradle-plugin
dependencies {
classpath 'de.richsource.gradle.plugins:gwt-gradle-plugin:0.6'
}
}

plugins {

//plugins {
// id "com.eriwen.gradle.js" version "1.12.1"
// id "com.moowork.node" version "0.12"
}
//}

// In this section you declare where to find the dependencies of your project
repositories {
Expand All @@ -46,6 +50,8 @@ apply plugin: 'java'
apply plugin: 'groovy'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'gwt'
apply plugin: 'gwt-compiler'
//apply plugin: "de.qaware.seu.as.code.git"

// In this section you declare the dependencies for your production and test code
Expand Down Expand Up @@ -453,3 +459,14 @@ def gitPull(File file) {
if(outputStream.length()>0) println "Out: " + outputStream
if(errorStream.length()>0) println "Error: " + errorStream
}

gwt {
gwtVersion='2.7.0'
modules 'org.bbop.apollo.gwt.Annotator'
compiler {
strict = true;
enableClosureCompiler = true;
disableClassMetadata = true;
disableCastChecking = true;
}
}
37 changes: 22 additions & 15 deletions build.xml
Expand Up @@ -39,8 +39,8 @@
</classpath>
<arg line="-war"/>
<arg value="web-app"/>
<!-- <arg line="-style"/>-->
<!-- <arg value="PRETTY"/>-->
<arg line="-style"/>
<arg value="PRETTY"/>
<!-- Additional arguments like -style PRETTY or -logLevel DEBUG -->
<arg line="${gwt.args}"/>
<arg value="org.bbop.apollo.gwt.Annotator"/>
Expand Down Expand Up @@ -75,6 +75,7 @@
<property name="apollo.webapp.directory" location="web-app" relative="true" basedir="."/>
<property name="apollo.jbrowse.directory" location="${apollo.webapp.directory}/jbrowse"/>
<property name="apollo.client.directory" location="${basedir}/client/apollo" basedir="." relative="true"/>
<property name="apollo.label.client.directory" location="${basedir}/client/ApolloLabelProc" basedir="." relative="true"/>
<property name="apollo.plugin.directory" location="${apollo.jbrowse.directory}/plugins/WebApollo"/>
<property name="jbrowse.download.directory" location="jbrowse-download"/>
<property name="jbrowse.webapp.test.file" location="${apollo.jbrowse.directory}/src/dojo/dojo.js"/>
Expand All @@ -83,11 +84,13 @@
location="${apollo.plugin.directory}/js/main.js.uncompressed.js"/>
<property name="scripts.directory" location="scripts"/>
<property name="jbrowse.git.test.file" location="${jbrowse.download.directory}/src/dojo/dojo.js"/>
<property name="jbrowse.github" value="https://github.com/gmod/jbrowse"/>
<!-- <property name="jbrowse.github" value="https://github.com/gmod/jbrowse"/>-->
<property name="jbrowse.github" value="https://github.com/nathandunn/jbrowse"/>
<property name="jbrowse.version" value="dev"/>
<property name="jbrowse.perl.dependency.test.file" value="bin/flatfile-to-json.pl"/>

<property name="jbrowse.release.version" value="1.11.6-release"/>
<!-- <property name="jbrowse.release.version" value="1.11.6-release"/>-->
<property name="jbrowse.release.version" value="multiple_highlights"/>

<available file=".git" type="dir" property="git.present"/>
<available file="${jbrowse.git.test.file}" type="file" property="jbrowse.git.present"/>
Expand Down Expand Up @@ -162,7 +165,11 @@
</exec>
<exec executable="git" failifexecutionfails="false" errorproperty="" dir="${jbrowse.download.directory}">
<arg value="checkout"/>
<arg value="tags/${jbrowse.release.version}"/>
<!--<arg value="tags/${jbrowse.release.version}"/>-->
<!--<arg value="master"/>-->
<!-- <arg value="multiple_highlights"/>-->
<!-- <arg value="apollo2_build"/>-->
<arg value="projection_v2_server"/>
</exec>
</target>

Expand Down Expand Up @@ -195,6 +202,7 @@
</target>



<target name="setup-jbrowse" unless="jbrowse.webapp.installed">
<antcall target="cloneJBrowse"/>
<antcall target="copy.apollo.plugin.jbrowse"/>
Expand All @@ -203,30 +211,30 @@
<echo>Will be setting up jbrowse</echo>
<delete dir="${apollo.jbrowse.directory}"/>

<copy todir="${apollo.jbrowse.directory}">
<fileset dir="${jbrowse.download.directory}">
<not>
<filename name="sample_data/**"/>
</not>
</fileset>
</copy>
<antcall target="copy-jbrowse-into-webapp"/>
<antcall target="install.jbrowse.perl"/>

</target>

<target name="copy.apollo.plugin.jbrowse">
<echo>copying plugin to jbrowse git ...</echo>
<copy todir="${jbrowse.download.directory}/plugins/WebApollo" failonerror="true">
<copy todir="${jbrowse.download.directory}/plugins/WebApollo" failonerror="true" overwrite="true">
<fileset dir="${apollo.client.directory}"/>
</copy>
<copy todir="${jbrowse.download.directory}/plugins/ApolloLabelProc" failonerror="true" overwrite="true">
<fileset dir="${apollo.label.client.directory}"/>
</copy>
</target>

<target name="copy.apollo.plugin.webapp" unless="jbrowse.precompiled" if="jbrowse.webapp.installed"
description="Copy client into webapp plugin directory.">
<echo>Copying WebApollo plugin to jbrowse webapp ...</echo>
<copy todir="${apollo.jbrowse.directory}/plugins/WebApollo" failonerror="true">
<copy todir="${apollo.jbrowse.directory}/plugins/WebApollo" failonerror="true" overwrite="true">
<fileset dir="${apollo.client.directory}"/>
</copy>
<copy todir="${apollo.jbrowse.directory}/plugins/ApolloLabelProc" failonerror="true" overwrite="true">
<fileset dir="${apollo.label.client.directory}"/>
</copy>
</target>

<target name="copy-jbrowse-into-webapp">
Expand All @@ -247,7 +255,6 @@
</target>



<target name="copy-resources"
depends="copy.apollo.plugin.webapp,setup-jbrowse"
description="This is called externally by shell script.">
Expand Down
24 changes: 24 additions & 0 deletions client/ApolloLabelProc/README.md
@@ -0,0 +1,24 @@
ApolloLabelProc is a JBrowse plugin.
Update location bar with 'label' (if it exists), when the locationBar content is JSON, which is expected from Apollo.
Install / Activate:

For JBrowse 1.11.6+, copy the ApolloLabelProc directory to the 'plugins' directory.
Add this to appropriate trackList.json under the plugins section (create one if it doesn't exist):

"plugins": [
"ApolloLabelProc"
],

For Apollo 2.x, copy the ApolloLabelProc directory to the web-apps/jbrowse/plugins directory.
Add this to web-apps/jbrowse/plugins/WebApollo/json/annot.json:

"plugins" : [
{
"location" : "./plugins/WebApollo",
"name" : "WebApollo"
},
{
"location" : "./plugins/ApolloLabelProc",
"name" : "ApolloLabelProc"
}
],
Empty file.
81 changes: 81 additions & 0 deletions client/ApolloLabelProc/js/main.js
@@ -0,0 +1,81 @@
/*
* ApolloLabelProc
* Update location bar with label (if it exists), when the locationBar content is JSON, which is expected from Apollo.
*/

define([
'dojo/_base/declare',
'dojo/_base/lang',
'dojo/Deferred',
'JBrowse/Plugin',
'JBrowse/Util'
],
function(
declare,
lang,
Deferred,
JBrowsePlugin,
Util
) {
return declare( JBrowsePlugin,
{
constructor: function( args ) {
console.log("plugin: ApolloLabelProc");
var counter = 0 ;

var thisB = this;

var currentBookmark ;

// this traps the event that happens directly after onCoarseMove function, where the label gets updates.
dojo.subscribe("/jbrowse/v1/n/navigate", function(currRegion){
var locationStr = Util.assembleLocStringWithLength( currRegion );
//console.log("locationStr="+locationStr);

// is locationStr JSON?
if (locationStr.charAt(0)=='{') {
locationStr = locationStr.substring(0,locationStr.lastIndexOf('}')+1);
var obj = JSON.parse(locationStr);

// look for the "label" property
if(obj.hasOwnProperty('sequenceList')) {
//console.log("label="+obj.label);
currentBookmark = obj ;

// if( thisB.browser.locationBox ){
// // thisB.browser.locationBox.set('value',obj.label, false);
// // dojo.style(dojo.byId('widget_location'), "display", "none");
// dojo.style(dojo.byId('widget_location'), "width", "0");
// }

dojo.addOnLoad(function() {
// console.log(borderContainer);

if(counter==0){
var searchBox = dojo.byId('search-box');
dojo.style(searchBox, "display", "none");
if(obj.hasOwnProperty("label")){
// TODO: add something next to search-box that displays something slightly different
// bookmark name + location . . . pasting it in should call browser "GO" function
// should call Browser.navigateTo . . with the browser location stuff
// we cann actually store the bookmark data here

}
var borderContainer = dijit.byId('GenomeBrowser');
borderContainer.resize();
}
counter = 1 ;

// dojo.style(dojo.byId('search-refseq'), "display", "none");
});

}
else{
currentBookmark = null ;
}
}

});
}
});
});
44 changes: 44 additions & 0 deletions client/apollo/css/genome.css
Expand Up @@ -65,3 +65,47 @@ div.locationThumb {
#menubar_about {
display: none;
}

/*.projectionGridline{*/
/*position: absolute;*/
/*display: none;*/
/*cursor: crosshair;*/
/*left: -2px;*/
/*height: 100%;*/
/*width: 5px;*/
/*background-color: #FF0000;*/
/*z-index: 15;*/
/*top: 0;*/
/*}*/

/*.projectionLabel {*/
/*color: black;*/
/*position: fixed;*/
/*font-weight: bold;*/
/*font-size: 9px;*/
/*display: none;*/
/*background: #fefefe;*/
/*padding: 0 0.7em;*/
/*z-index: 1000;*/
/*text-align: center;*/
/*cursor: crosshair;*/
/*border: 1px solid #888;*/
/*}*/

.projectionGridline {
position: absolute;
left: 0px;
top: 0px;
width: 20px;
height: 100%;
border-style: solid;
border-width: 3px;
border-color: red;
z-index: 0;
}
.projectionGridline_major {
border-color: green;
}
.projectionGridline_minor {
border-color: blue;
}
9 changes: 9 additions & 0 deletions client/apollo/css/webapollo_track_styles.css
Expand Up @@ -791,3 +791,12 @@ div.track_webapollo_view_track_annotsequencetrack div.track-label .track-close-b
outline-width: 3px;
}

.boundary_left {
/*border-color: blue;*/
border: 5px pink solid;
}

.boundary_right{
/*border-color: green;*/
border: 5px red solid;
}
4 changes: 4 additions & 0 deletions client/apollo/js/JSONUtils.js
Expand Up @@ -134,6 +134,10 @@ JSONUtils.createJBrowseFeature = function( afeature ) {
return new JAFeature( afeature );
};

JSONUtils.numberWithCommas = function( x) {
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
};

JSONUtils.flattenFeature = function(feature, descendants) {
descendants.push(feature);
if (feature.children) {
Expand Down

0 comments on commit b6db524

Please sign in to comment.