Skip to content

Commit 0c0076c

Browse files
authored
Merge pull request #37 from jctrotter/discvr-21.3-jbrowse2
Discvr 21.3 jbrowse2 react linear genome view
2 parents 4c528d3 + fc5a6f9 commit 0c0076c

File tree

20 files changed

+18595
-755
lines changed

20 files changed

+18595
-755
lines changed

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,9 @@
88
/jbrowse/jb_run.js
99
/jbrowse/jb_setup.js
1010
/jbrowse/.gradle
11+
12+
# Ignore labkey-npm build artifacts
13+
**/gen/**
14+
15+
# Ignore MacOS .DS_Store artifacts
16+
**/.DS_Store

SequenceAnalysis/src/org/labkey/sequenceanalysis/query/SequenceAnalysisCustomizer.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ public void customizeColumn(BaseColumnInfo col, AbstractTableInfo ti)
161161
COL_ENUM(Class dataType, @Nullable Collection<String> alternateNames){
162162
this.dataType = dataType;
163163
if (alternateNames != null)
164-
this.alternateNames.addAll(alternateNames);
164+
this.alternateNames.addAll(alternateNames);
165165
}
166166

167167
public Collection<String> getAlternateNames()
@@ -181,8 +181,8 @@ private static void addFk(Container c, User u, BaseColumnInfo col, String schema
181181
if (col.getFk() == null)
182182
{
183183
col.setFk(QueryForeignKey.from(DefaultSchema.get(u,c),null)
184-
.schema(schema, c)
185-
.to(query, pkCol, displayCol));
184+
.schema(schema, c)
185+
.to(query, pkCol, displayCol));
186186
}
187187
}
188188

@@ -269,4 +269,4 @@ public void renderGridCellContents(RenderContext ctx, Writer out) throws IOExcep
269269
};
270270
}
271271
}
272-
}
272+
}

jbrowse/.npmrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Set registry for @labkey scopes
2+
@labkey:registry=https://artifactory.labkey.com/artifactory/api/npm/libs-client/

jbrowse/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Page is visible at http://localhost:8080/labkey/home/jbrowse-jbrowse.view?

jbrowse/build.gradle

Lines changed: 59 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -22,75 +22,75 @@ dependencies {
2222

2323
ConfigurableFileTree copyDestination = fileTree("./resources/web/jbrowseApp/");
2424
project.task("copyJBrowse",
25-
type: Copy,
26-
group: "Build",
27-
description: "Copy jbrowse app into webapp directory",
28-
{ CopySpec copy ->
29-
copy.from fileTree("./node_modules/@gmod/jbrowse").exclude('css/main.css')
30-
copy.into copyDestination.getDir()
31-
}
25+
type: Copy,
26+
group: "Build",
27+
description: "Copy jbrowse app into webapp directory",
28+
{ CopySpec copy ->
29+
copy.from fileTree("./node_modules/@gmod/jbrowse").exclude('css/main.css')
30+
copy.into copyDestination.getDir()
31+
}
3232
).doFirst({
33-
File f = project.file('./node_modules/@gmod/jbrowse');
34-
if (!f.exists()){
35-
throw new GradleException("Input source for copyJBrowse doesn't exist: " + f.getAbsolutePath())
36-
}
33+
File f = project.file('./node_modules/@gmod/jbrowse');
34+
if (!f.exists()){
35+
throw new GradleException("Input source for copyJBrowse doesn't exist: " + f.getAbsolutePath())
36+
}
3737
}).onlyIf({
38-
//this is a very expensive step and the input should rarely change
39-
if (copyDestination.getDir().exists()) {
40-
List<File> copiedFiles = copyDestination.exclude("./resources/web/jbrowseApp/css/").sort {it.lastModified()};
41-
if (copiedFiles.isEmpty()) {
42-
return true;
43-
}
44-
45-
File firstModifiedCopiedFile = copiedFiles.first()
46-
File lastModifiedSourceFile = fileTree('./node_modules/@gmod/jbrowse').exclude('package.json').sort {it.lastModified()}.last()
47-
if (firstModifiedCopiedFile.lastModified() < lastModifiedSourceFile.lastModified()) {
48-
println("Source has been modified, need to copy again")
49-
println("Copy last copied: " + new Date(firstModifiedCopiedFile.lastModified()))
50-
println("First modified file: " + firstModifiedCopiedFile.getPath())
38+
//this is a very expensive step and the input should rarely change
39+
if (copyDestination.getDir().exists()) {
40+
List<File> copiedFiles = copyDestination.exclude("./resources/web/jbrowseApp/css/").sort {it.lastModified()};
41+
if (copiedFiles.isEmpty()) {
42+
return true;
43+
}
44+
45+
File firstModifiedCopiedFile = copiedFiles.first()
46+
File lastModifiedSourceFile = fileTree('./node_modules/@gmod/jbrowse').exclude('package.json').sort {it.lastModified()}.last()
47+
if (firstModifiedCopiedFile.lastModified() < lastModifiedSourceFile.lastModified()) {
48+
println("Source has been modified, need to copy again")
49+
println("Copy last copied: " + new Date(firstModifiedCopiedFile.lastModified()))
50+
println("First modified file: " + firstModifiedCopiedFile.getPath())
5151

52-
println("Source last modified: " + new Date(lastModifiedSourceFile.lastModified()))
53-
println("Last modified file: " + lastModifiedSourceFile.getPath())
52+
println("Source last modified: " + new Date(lastModifiedSourceFile.lastModified()))
53+
println("Last modified file: " + lastModifiedSourceFile.getPath())
5454

55-
return true;
56-
}
57-
else {
58-
println("Up to date, no need to copy")
59-
return false;
60-
}
61-
}
55+
return true;
56+
}
57+
else {
58+
println("Up to date, no need to copy")
59+
return false;
60+
}
61+
}
6262

63-
return true;
63+
return true;
6464
})
6565

6666
project.task("copyJBrowseCss",
67-
type: Copy,
68-
group: "Build",
69-
description: "Copy jbrowse main.css into webapp directory",
70-
{ CopySpec copy ->
71-
copy.from new File("./webpack/main.css")
72-
copy.into new File("./resources/web/jbrowseApp/css/")
73-
}
67+
type: Copy,
68+
group: "Build",
69+
description: "Copy jbrowse main.css into webapp directory",
70+
{ CopySpec copy ->
71+
copy.from new File("./webpack/main.css")
72+
copy.into new File("./resources/web/jbrowseApp/css/")
73+
}
7474
).doFirst({
75-
File f = project.file('./resources/web/jbrowseApp/index.html');
76-
if (!f.exists())
77-
{
78-
throw new GradleException("copyJBrowse was not successful. missing: " + f.getAbsolutePath())
79-
}
75+
File f = project.file('./resources/web/jbrowseApp/index.html');
76+
if (!f.exists())
77+
{
78+
throw new GradleException("copyJBrowse was not successful. missing: " + f.getAbsolutePath())
79+
}
8080

81-
File f2 = project.file('./resources/web/jbrowseApp/src/dijit/themes/dijit.css');
82-
if (!f2.exists())
83-
{
84-
throw new GradleException("copyJBrowse was not successful. missing jbrowse dependencies: " + f2.getAbsolutePath())
85-
}
81+
File f2 = project.file('./resources/web/jbrowseApp/src/dijit/themes/dijit.css');
82+
if (!f2.exists())
83+
{
84+
throw new GradleException("copyJBrowse was not successful. missing jbrowse dependencies: " + f2.getAbsolutePath())
85+
}
8686

87-
// NOTE: due to bug/inconsistency in how the jbrowse postinstall script is run, several modules may not be copied to /src. This is a check against this.
88-
// There's a jbrowse PR around this as well.
89-
File f3 = project.file('./resources/web/jbrowseApp/src/jszlib');
90-
if (!f3.exists())
91-
{
92-
throw new GradleException("copyJBrowse was not successful. missing jbrowse dependencies: " + f3.getAbsolutePath())
93-
}
87+
// NOTE: due to bug/inconsistency in how the jbrowse postinstall script is run, several modules may not be copied to /src. This is a check against this.
88+
// There's a jbrowse PR around this as well.
89+
File f3 = project.file('./resources/web/jbrowseApp/src/jszlib');
90+
if (!f3.exists())
91+
{
92+
throw new GradleException("copyJBrowse was not successful. missing jbrowse dependencies: " + f3.getAbsolutePath())
93+
}
9494
})
9595

9696

@@ -101,4 +101,4 @@ project.tasks.copyJBrowse.mustRunAfter("npmRunBuildProd")
101101

102102
project.tasks.copyJBrowseCss.dependsOn(project.tasks.copyJBrowse)
103103
project.tasks.processModuleResources.dependsOn(project.tasks.copyJBrowse)
104-
project.tasks.processModuleResources.dependsOn(project.tasks.copyJBrowseCss)
104+
project.tasks.processModuleResources.dependsOn(project.tasks.copyJBrowseCss)

jbrowse/config/dev.config.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/*
2+
* Copyright (c) 2019 LabKey Corporation
3+
*
4+
* Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0
5+
*/
6+
7+
const devConfig = require('../node_modules/@labkey/build/webpack/dev.config')
8+
9+
const entryPoints = require('../src/client/entryPoints');
10+
const constants = require('../node_modules/@labkey/build/webpack/constants');
11+
const webpack = require('webpack');
12+
const NodePolyfillPlugin = require("node-polyfill-webpack-plugin")
13+
14+
const clientConfig = devConfig
15+
16+
clientConfig.resolve.fallback =
17+
{
18+
"buffer": require.resolve("buffer"),
19+
"path": require.resolve("path-browserify"),
20+
"stream": require.resolve("stream-browserify"),
21+
"zlib": require.resolve("browserify-zlib"),
22+
"vm": require.resolve("vm-browserify"),
23+
"fs": false
24+
}
25+
26+
clientConfig.plugins =
27+
[new webpack.ProvidePlugin({regeneratorRuntime: 'regenerator-runtime'}),
28+
new NodePolyfillPlugin()].concat(constants.processPlugins(entryPoints))
29+
30+
31+
module.exports = [clientConfig]

jbrowse/config/prod.config.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/*
2+
* Copyright (c) 2019 LabKey Corporation
3+
*
4+
* Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0
5+
*/
6+
7+
const prodConfig = require('../node_modules/@labkey/build/webpack/prod.config')
8+
9+
const entryPoints = require('../src/client/entryPoints');
10+
const constants = require('../node_modules/@labkey/build/webpack/constants');
11+
const webpack = require('webpack');
12+
const NodePolyfillPlugin = require("node-polyfill-webpack-plugin")
13+
14+
const clientConfig = prodConfig
15+
16+
clientConfig.resolve.fallback =
17+
{
18+
"buffer": require.resolve("buffer"),
19+
"path": require.resolve("path-browserify"),
20+
"stream": require.resolve("stream-browserify"),
21+
"zlib": require.resolve("browserify-zlib"),
22+
"vm": require.resolve("vm-browserify"),
23+
"fs": false
24+
}
25+
26+
clientConfig.plugins =
27+
[new webpack.ProvidePlugin({regeneratorRuntime: 'regenerator-runtime'}),
28+
new NodePolyfillPlugin()].concat(constants.processPlugins(entryPoints))
29+
30+
31+
module.exports = [clientConfig]

jbrowse/config/watch.config.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/*
2+
* Copyright (c) 2019 LabKey Corporation
3+
*
4+
* Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0
5+
*/
6+
7+
const watchConfig = require('../node_modules/@labkey/build/webpack/watch.config')
8+
9+
const entryPoints = require('../src/client/entryPoints');
10+
const constants = require('../node_modules/@labkey/build/webpack/constants');
11+
const webpack = require('webpack');
12+
const NodePolyfillPlugin = require("node-polyfill-webpack-plugin")
13+
14+
const clientConfig = watchConfig
15+
16+
clientConfig.resolve.fallback =
17+
{
18+
"buffer": require.resolve("buffer"),
19+
"path": require.resolve("path-browserify"),
20+
"stream": require.resolve("stream-browserify"),
21+
"zlib": require.resolve("browserify-zlib"),
22+
"vm": require.resolve("vm-browserify"),
23+
"fs": false
24+
}
25+
26+
clientConfig.plugins =
27+
[new webpack.ProvidePlugin({regeneratorRuntime: 'regenerator-runtime'}),
28+
new NodePolyfillPlugin()].concat(constants.processPlugins(entryPoints))
29+
30+
31+
module.exports = [clientConfig]

0 commit comments

Comments
 (0)