Skip to content

Commit e42a4b7

Browse files
authored
Merge pull request #2 from jctrotter/21.4-jbrowse2-2.1.0
merge discvr-21.4 jbrowse2 implementation to fresh 21.3 branch
2 parents 0b33547 + 4493f4b commit e42a4b7

File tree

25 files changed

+55493
-786
lines changed

25 files changed

+55493
-786
lines changed

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

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import org.labkey.api.data.DisplayColumn;
1313
import org.labkey.api.data.DisplayColumnFactory;
1414
import org.labkey.api.data.JdbcType;
15+
import org.labkey.api.data.MutableColumnInfo;
1516
import org.labkey.api.data.RenderContext;
1617
import org.labkey.api.data.SQLFragment;
1718
import org.labkey.api.data.TableCustomizer;
@@ -99,21 +100,21 @@ private void customizeSharedCols(AbstractTableInfo ti)
99100
private enum COL_ENUM
100101
{
101102
refNtSequence(Integer.class, PageFlowUtil.set("sequenceid", "ref_nt_sequence")){
102-
public void customizeColumn(BaseColumnInfo col, AbstractTableInfo ti)
103+
public void customizeColumn(MutableColumnInfo col, AbstractTableInfo ti)
103104
{
104105
col.setLabel("Ref NT Sequence");
105106
addFk(ti.getUserSchema().getContainer(), ti.getUserSchema().getUser(), col, SequenceAnalysisSchema.SCHEMA_NAME, SequenceAnalysisSchema.TABLE_REF_NT_SEQUENCES, "rowid", "name");
106107
}
107108
},
108109
libraryId(Integer.class, PageFlowUtil.set("genomeId", "genome_id", "library_id")){
109-
public void customizeColumn(BaseColumnInfo col, AbstractTableInfo ti)
110+
public void customizeColumn(MutableColumnInfo col, AbstractTableInfo ti)
110111
{
111112
col.setLabel("Reference Genome");
112113
addFk(ti.getUserSchema().getContainer(), ti.getUserSchema().getUser(), col, SequenceAnalysisSchema.SCHEMA_NAME, SequenceAnalysisSchema.TABLE_REF_LIBRARIES, "rowid", "rowid");
113114
}
114115
},
115116
runid(Integer.class, PageFlowUtil.set("run_id")){
116-
public void customizeColumn(BaseColumnInfo col, AbstractTableInfo ti)
117+
public void customizeColumn(MutableColumnInfo col, AbstractTableInfo ti)
117118
{
118119
col.setLabel("Run");
119120
col.setShownInInsertView(false);
@@ -124,7 +125,7 @@ public void customizeColumn(BaseColumnInfo col, AbstractTableInfo ti)
124125
}
125126
},
126127
jobid(Integer.class, PageFlowUtil.set("job_id")){
127-
public void customizeColumn(BaseColumnInfo col, AbstractTableInfo ti)
128+
public void customizeColumn(MutableColumnInfo col, AbstractTableInfo ti)
128129
{
129130
col.setLabel("Job Id");
130131
col.setShownInInsertView(false);
@@ -134,21 +135,21 @@ public void customizeColumn(BaseColumnInfo col, AbstractTableInfo ti)
134135
}
135136
},
136137
dataId(Integer.class, PageFlowUtil.set("data_id")){
137-
public void customizeColumn(BaseColumnInfo col, AbstractTableInfo ti)
138+
public void customizeColumn(MutableColumnInfo col, AbstractTableInfo ti)
138139
{
139140
col.setLabel("File Id");
140141
addFk(ti.getUserSchema().getContainer(), ti.getUserSchema().getUser(), col, "exp", "data", "rowid", null);
141142
}
142143
},
143144
readset(Integer.class, PageFlowUtil.set("readsetId", "readset_id")){
144-
public void customizeColumn(BaseColumnInfo col, AbstractTableInfo ti)
145+
public void customizeColumn(MutableColumnInfo col, AbstractTableInfo ti)
145146
{
146147
col.setLabel("Readset");
147148
addFk(ti.getUserSchema().getContainer(), ti.getUserSchema().getUser(), col, SequenceAnalysisSchema.SCHEMA_NAME, SequenceAnalysisSchema.TABLE_READSETS, "rowid", null);
148149
}
149150
},
150151
analysisId(Integer.class, PageFlowUtil.set("analysis_id")){
151-
public void customizeColumn(BaseColumnInfo col, AbstractTableInfo ti)
152+
public void customizeColumn(MutableColumnInfo col, AbstractTableInfo ti)
152153
{
153154
col.setLabel("Analysis Id");
154155
addFk(ti.getUserSchema().getContainer(), ti.getUserSchema().getUser(), col, SequenceAnalysisSchema.SCHEMA_NAME, SequenceAnalysisSchema.TABLE_ANALYSES, "rowid", null);
@@ -176,7 +177,7 @@ private static void setNonEditable(BaseColumnInfo col)
176177
col.setShownInUpdateView(false);
177178
}
178179

179-
private static void addFk(Container c, User u, BaseColumnInfo col, String schema, String query, String pkCol, @Nullable String displayCol)
180+
private static void addFk(Container c, User u, MutableColumnInfo col, String schema, String query, String pkCol, @Nullable String displayCol)
180181
{
181182
if (col.getFk() == null)
182183
{
@@ -186,9 +187,9 @@ private static void addFk(Container c, User u, BaseColumnInfo col, String schema
186187
}
187188
}
188189

189-
abstract public void customizeColumn(BaseColumnInfo col, AbstractTableInfo ti);
190+
abstract public void customizeColumn(MutableColumnInfo col, AbstractTableInfo ti);
190191

191-
public static void processColumn(BaseColumnInfo col, AbstractTableInfo ti)
192+
public static void processColumn(MutableColumnInfo col, AbstractTableInfo ti)
192193
{
193194
for (COL_ENUM colEnum : COL_ENUM.values())
194195
{

jbrowse/.DS_Store

6 KB
Binary file not shown.

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: 1 addition & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -18,87 +18,4 @@ dependencies {
1818
BuildUtils.addLabKeyDependency(project: project, config: "modules", depProjectPath: ":server:modules:LabDevKitModules:LDK", depProjectConfig: "published", depExtension: "module")
1919
BuildUtils.addLabKeyDependency(project: project, config: "modules", depProjectPath: ":server:modules:DiscvrLabKeyModules:SequenceAnalysis", depProjectConfig: "published", depExtension: "module")
2020
BuildUtils.addLabKeyDependency(project: project, config: "modules", depProjectPath: BuildUtils.getPlatformModuleProjectPath(project.gradle, "pipeline"), depProjectConfig: "published", depExtension: "module")
21-
}
22-
23-
ConfigurableFileTree copyDestination = fileTree("./resources/web/jbrowseApp/");
24-
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-
}
32-
).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-
}
37-
}).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())
51-
52-
println("Source last modified: " + new Date(lastModifiedSourceFile.lastModified()))
53-
println("Last modified file: " + lastModifiedSourceFile.getPath())
54-
55-
return true;
56-
}
57-
else {
58-
println("Up to date, no need to copy")
59-
return false;
60-
}
61-
}
62-
63-
return true;
64-
})
65-
66-
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-
}
74-
).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-
}
80-
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-
}
86-
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-
}
94-
})
95-
96-
97-
project.tasks.copyJBrowse.dependsOn(project.tasks.npmInstall)
98-
99-
project.tasks.copyJBrowse.mustRunAfter("npmRunBuild")
100-
project.tasks.copyJBrowse.mustRunAfter("npmRunBuildProd")
101-
102-
project.tasks.copyJBrowseCss.dependsOn(project.tasks.copyJBrowse)
103-
project.tasks.processModuleResources.dependsOn(project.tasks.copyJBrowse)
104-
project.tasks.processModuleResources.dependsOn(project.tasks.copyJBrowseCss)
21+
}

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)