genoverse 3.2.0 → 4.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +93 -162
- package/.github/workflows/test.yml +9 -10
- package/.github/workflows/update-gh-pages.yml +33 -0
- package/LICENSE.TXT +2 -2
- package/README.md +174 -3
- package/{i → assets}/sort_handle.png +0 -0
- package/babel.config.js +19 -0
- package/dist/129.css +334 -0
- package/dist/129.css.map +1 -0
- package/dist/129.genoverse.js +2 -0
- package/dist/129.genoverse.js.map +1 -0
- package/dist/15d98c18221c8bcb2334.ttf +0 -0
- package/dist/166.css +2 -0
- package/dist/166.genoverse.js +1 -0
- package/dist/216.css +20 -0
- package/dist/216.css.map +1 -0
- package/dist/232.css +114 -0
- package/dist/232.css.map +1 -0
- package/dist/232.genoverse.js +2 -0
- package/dist/232.genoverse.js.map +1 -0
- package/dist/2e659e443f3e98569e9f.png +0 -0
- package/dist/394.css +114 -0
- package/dist/394.css.map +1 -0
- package/dist/394.genoverse.js +2 -0
- package/dist/394.genoverse.js.map +1 -0
- package/dist/469.css +24 -0
- package/dist/469.css.map +1 -0
- package/dist/469.genoverse.js +2 -0
- package/dist/469.genoverse.js.map +1 -0
- package/dist/4896d4b04430cc3dfb06.woff2 +0 -0
- package/dist/530.css +39 -0
- package/dist/530.css.map +1 -0
- package/dist/530.genoverse.js +2 -0
- package/dist/530.genoverse.js.map +1 -0
- package/dist/547.css +469 -0
- package/dist/547.css.map +1 -0
- package/dist/547.genoverse.js +1 -0
- package/dist/729.css +315 -0
- package/dist/729.css.map +1 -0
- package/dist/79da213423ac0def2058.ttf +0 -0
- package/dist/804.genoverse.js +2 -0
- package/dist/804.genoverse.js.map +1 -0
- package/dist/842.genoverse.js +2 -0
- package/dist/842.genoverse.js.map +1 -0
- package/dist/893.genoverse.js +2 -0
- package/dist/893.genoverse.js.map +1 -0
- package/dist/949.css +315 -0
- package/dist/949.css.map +1 -0
- package/dist/949.genoverse.js +2 -0
- package/dist/949.genoverse.js.map +1 -0
- package/dist/952.css +315 -0
- package/dist/952.css.map +1 -0
- package/dist/952.genoverse.js +2 -0
- package/dist/952.genoverse.js.map +1 -0
- package/dist/d79c2ec96ab9ff1161a2.woff2 +0 -0
- package/dist/genoverse.js +2 -0
- package/dist/genoverse.js.map +1 -0
- package/index.html +13 -14
- package/jest.config.js +5 -0
- package/jest.setup.js +13 -0
- package/package.json +29 -12
- package/{css → src/css}/controlPanel.css +0 -0
- package/{css → src/css}/fileDrop.css +0 -0
- package/src/css/fontawesome.css +3 -0
- package/{css → src/css}/fullscreen.css +0 -0
- package/{css → src/css}/genoverse.css +1 -1
- package/{css → src/css}/karyotype.css +2 -0
- package/{css → src/css}/resizer.css +0 -0
- package/{css → src/css}/tooltips.css +0 -0
- package/{css → src/css}/trackControls.css +0 -0
- package/src/js/Genoverse.js +1747 -0
- package/{js → src/js}/Track/Controller/Sequence.js +6 -4
- package/src/js/Track/Controller/Stranded.js +83 -0
- package/{js → src/js}/Track/Controller.js +201 -160
- package/src/js/Track/Model/File/BAM.js +47 -0
- package/src/js/Track/Model/File/BED.js +122 -0
- package/src/js/Track/Model/File/GFF.js +42 -0
- package/src/js/Track/Model/File/VCF.js +109 -0
- package/src/js/Track/Model/File/WIG.js +82 -0
- package/src/js/Track/Model/File.js +36 -0
- package/src/js/Track/Model/Gene/Ensembl.js +24 -0
- package/{js → src/js}/Track/Model/Gene.js +3 -1
- package/src/js/Track/Model/Sequence/Ensembl.js +6 -0
- package/{js → src/js}/Track/Model/Sequence/Fasta.js +24 -17
- package/{js → src/js}/Track/Model/Sequence.js +10 -7
- package/{js → src/js}/Track/Model/SequenceVariation.js +17 -11
- package/{js → src/js}/Track/Model/Stranded.js +11 -8
- package/src/js/Track/Model/Transcript/Ensembl.js +73 -0
- package/{js → src/js}/Track/Model/Transcript.js +3 -1
- package/{js → src/js}/Track/Model.js +125 -93
- package/{js → src/js}/Track/View/Gene/Ensembl.js +6 -4
- package/src/js/Track/View/Gene.js +8 -0
- package/{js → src/js}/Track/View/Sequence.js +18 -22
- package/src/js/Track/View/SequenceVariation.js +117 -0
- package/src/js/Track/View/Transcript/Ensembl.js +17 -0
- package/src/js/Track/View/Transcript.js +32 -0
- package/{js → src/js}/Track/View.js +200 -159
- package/{js → src/js}/Track/library/Chromosome.js +18 -13
- package/src/js/Track/library/File/BAM.js +34 -0
- package/src/js/Track/library/File/BED.js +27 -0
- package/src/js/Track/library/File/BIGBED.js +51 -0
- package/src/js/Track/library/File/BIGWIG.js +54 -0
- package/src/js/Track/library/File/GFF.js +10 -0
- package/{js → src/js}/Track/library/File/VCF.js +29 -22
- package/src/js/Track/library/File/WIG.js +8 -0
- package/{js → src/js}/Track/library/File.js +4 -2
- package/src/js/Track/library/Gene.js +44 -0
- package/src/js/Track/library/Graph/Bar.js +263 -0
- package/src/js/Track/library/Graph/Line.js +335 -0
- package/{js → src/js}/Track/library/Graph.js +137 -114
- package/{js → src/js}/Track/library/HighlightRegion.js +118 -93
- package/src/js/Track/library/Legend.js +258 -0
- package/{js → src/js}/Track/library/Scalebar.js +69 -49
- package/{js → src/js}/Track/library/Scaleline.js +29 -27
- package/src/js/Track/library/Static.js +82 -0
- package/{js → src/js}/Track/library/dbSNP.js +47 -50
- package/src/js/Track.js +651 -0
- package/{js → src/js}/genomes/grch37.js +52 -52
- package/{js → src/js}/genomes/grch38.js +52 -52
- package/src/js/lib/BWReader.js +562 -0
- package/src/js/lib/VCFReader.js +296 -0
- package/src/js/lib/dalliance/bam.js +517 -0
- package/src/js/lib/dalliance/bin.js +317 -0
- package/src/js/lib/dalliance/jszlib-inflate.js +2159 -0
- package/src/js/lib/dalliance/lh3utils.js +105 -0
- package/src/js/lib/dalliance/sha1.js +334 -0
- package/src/js/lib/import-tracks.js +42 -0
- package/{js/lib → src/js/lib/jquery-plugins}/jquery.mousehold.js +0 -0
- package/{js/lib → src/js/lib/jquery-plugins}/jquery.mousewheel.js +0 -0
- package/{js/lib → src/js/lib/jquery-plugins}/jquery.tipsy.js +0 -0
- package/src/js/lib/jquery.js +26 -0
- package/src/js/lib/polyfills.js +11 -0
- package/src/js/lib/wrap-functions.js +88 -0
- package/src/js/plugins/controlPanel.js +388 -0
- package/src/js/plugins/fileDrop.js +81 -0
- package/src/js/plugins/focusRegion.js +13 -0
- package/{js → src/js}/plugins/fullscreen.js +18 -14
- package/{js → src/js}/plugins/karyotype.js +51 -45
- package/src/js/plugins/resizer.js +52 -0
- package/{js → src/js}/plugins/tooltips.js +31 -29
- package/src/js/plugins/trackControls.js +159 -0
- package/test/View/render-legends.test.js +1 -1
- package/test/change-width.test.js +71 -0
- package/test/create-and-destroy.test.js +2 -2
- package/test/track-ordering.test.js +3 -2
- package/test/track_config/config-settings.test.js +1 -1
- package/test/utils.js +4 -2
- package/webpack.config.js +103 -34
- package/css/font-awesome.css +0 -3
- package/expanded.html +0 -120
- package/fontawesome/css/fontawesome.min.css +0 -5
- package/fontawesome/css/regular.min.css +0 -5
- package/fontawesome/css/solid.min.css +0 -5
- package/fontawesome/webfonts/fa-brands-400.ttf +0 -0
- package/fontawesome/webfonts/fa-brands-400.woff +0 -0
- package/fontawesome/webfonts/fa-brands-400.woff2 +0 -0
- package/fontawesome/webfonts/fa-regular-400.ttf +0 -0
- package/fontawesome/webfonts/fa-regular-400.woff +0 -0
- package/fontawesome/webfonts/fa-regular-400.woff2 +0 -0
- package/fontawesome/webfonts/fa-solid-900.ttf +0 -0
- package/fontawesome/webfonts/fa-solid-900.woff +0 -0
- package/fontawesome/webfonts/fa-solid-900.woff2 +0 -0
- package/help.pdf +0 -0
- package/index.js +0 -83
- package/js/Genoverse.js +0 -1681
- package/js/Track/Controller/Stranded.js +0 -73
- package/js/Track/Model/File/BAM.js +0 -44
- package/js/Track/Model/File/BED.js +0 -116
- package/js/Track/Model/File/GFF.js +0 -40
- package/js/Track/Model/File/VCF.js +0 -101
- package/js/Track/Model/File/WIG.js +0 -67
- package/js/Track/Model/File.js +0 -36
- package/js/Track/Model/Gene/Ensembl.js +0 -22
- package/js/Track/Model/Sequence/Ensembl.js +0 -4
- package/js/Track/Model/Transcript/Ensembl.js +0 -67
- package/js/Track/View/Gene.js +0 -6
- package/js/Track/View/Sequence/Variation.js +0 -115
- package/js/Track/View/Transcript/Ensembl.js +0 -12
- package/js/Track/View/Transcript.js +0 -28
- package/js/Track/library/File/BAM.js +0 -30
- package/js/Track/library/File/BED.js +0 -24
- package/js/Track/library/File/BIGBED.js +0 -47
- package/js/Track/library/File/BIGWIG.js +0 -52
- package/js/Track/library/File/GFF.js +0 -9
- package/js/Track/library/File/WIG.js +0 -5
- package/js/Track/library/Gene.js +0 -37
- package/js/Track/library/Graph/Bar.js +0 -235
- package/js/Track/library/Graph/Line.js +0 -296
- package/js/Track/library/Legend.js +0 -224
- package/js/Track/library/Static.js +0 -78
- package/js/Track.js +0 -632
- package/js/genoverse.min.js +0 -2
- package/js/genoverse.min.js.map +0 -1
- package/js/lib/BWReader.js +0 -578
- package/js/lib/Base.js +0 -145
- package/js/lib/VCFReader.js +0 -286
- package/js/lib/dalliance/js/bam.js +0 -494
- package/js/lib/dalliance/js/bin.js +0 -185
- package/js/lib/dalliance/js/das.js +0 -749
- package/js/lib/dalliance/js/utils.js +0 -370
- package/js/lib/dalliance-lib.js +0 -3594
- package/js/lib/dalliance-lib.min.js +0 -68
- package/js/lib/jDataView.js +0 -2
- package/js/lib/jParser.js +0 -192
- package/js/lib/jquery-ui.js +0 -8
- package/js/lib/jquery.js +0 -2
- package/js/lib/rtree.js +0 -1
- package/js/plugins/controlPanel.js +0 -395
- package/js/plugins/fileDrop.js +0 -62
- package/js/plugins/focusRegion.js +0 -12
- package/js/plugins/resizer.js +0 -45
- package/js/plugins/trackControls.js +0 -143
- package/utils/expandedTemplate.html +0 -46
- package/utils/git-hooks/post-commit +0 -9
- package/utils/git-hooks/pre-commit +0 -7
- package/utils/git-hooks/setup +0 -6
- package/utils/makeExpanded.js +0 -19
package/.eslintrc.js
CHANGED
|
@@ -9,105 +9,109 @@ const noRestrictedProperies = require('eslint-config-airbnb-base/rules/best-prac
|
|
|
9
9
|
module.exports = {
|
|
10
10
|
env: {
|
|
11
11
|
browser : true,
|
|
12
|
-
|
|
12
|
+
es6 : true,
|
|
13
|
+
node : true,
|
|
13
14
|
},
|
|
14
|
-
|
|
15
|
+
plugins: [
|
|
16
|
+
'align-assignments',
|
|
17
|
+
],
|
|
18
|
+
extends: [
|
|
15
19
|
'airbnb-base',
|
|
16
20
|
],
|
|
21
|
+
parser : '@babel/eslint-parser',
|
|
22
|
+
parserOptions : {
|
|
23
|
+
requireConfigFile : false,
|
|
24
|
+
ecmaVersion : 8,
|
|
25
|
+
sourceType : 'module',
|
|
26
|
+
},
|
|
17
27
|
globals: {
|
|
18
|
-
|
|
19
|
-
Genoverse : true,
|
|
20
|
-
RTree : true,
|
|
21
|
-
dallianceLib : true,
|
|
22
|
-
VCFReader : true,
|
|
23
|
-
BWReader : true
|
|
28
|
+
Genoverse: true,
|
|
24
29
|
},
|
|
25
30
|
ignorePatterns: [
|
|
26
|
-
'.eslintrc.js',
|
|
27
31
|
'node_modules',
|
|
28
|
-
'
|
|
32
|
+
'dist',
|
|
29
33
|
'**/*.min.js',
|
|
30
|
-
'js/lib
|
|
34
|
+
'src/js/lib/dalliance/*.js',
|
|
35
|
+
'src/js/lib/jquery-plugins/*.js',
|
|
31
36
|
],
|
|
37
|
+
rules: {
|
|
38
|
+
'align-assignments/align-assignments' : [ 'error', { requiresOnly: false }],
|
|
39
|
+
'padding-line-between-statements' : [
|
|
40
|
+
'error', ...[
|
|
41
|
+
[ '*', [ 'multiline-block-like', 'return', 'break', 'export', 'throw', 'cjs-export' ]],
|
|
42
|
+
[ '*', [ 'cjs-import', 'import', 'const', 'let', 'var' ]],
|
|
43
|
+
[[ 'multiline-block-like', 'return', 'break', 'export', 'throw', 'cjs-export' ], '*' ],
|
|
44
|
+
[[ 'cjs-import', 'import', 'const', 'let', 'var' ], '*' ],
|
|
45
|
+
[ 'cjs-import', 'cjs-import', 'any' ],
|
|
46
|
+
[ 'import', 'import', 'any' ],
|
|
47
|
+
[ 'singleline-const', 'const', 'any' ],
|
|
48
|
+
[ 'singleline-let', 'let', 'any' ],
|
|
49
|
+
[ 'singleline-var', 'var', 'any' ],
|
|
50
|
+
[ 'expression', 'expression', 'any' ],
|
|
51
|
+
].map(
|
|
52
|
+
([ prev, next = '*', blankLine = 'always' ]) => ({ prev, next, blankLine })
|
|
53
|
+
),
|
|
54
|
+
],
|
|
55
|
+
'max-len' : 'off',
|
|
56
|
+
'no-multi-spaces' : 'off',
|
|
57
|
+
'no-multi-assign' : 'off',
|
|
58
|
+
'no-nested-ternary' : 'off',
|
|
59
|
+
'no-prototype-builtins' : 'off',
|
|
60
|
+
'no-plusplus' : 'off',
|
|
61
|
+
'operator-linebreak' : 'off',
|
|
62
|
+
'prefer-destructuring' : 'off',
|
|
63
|
+
'quote-props' : 'off',
|
|
64
|
+
'template-curly-spacing' : 'off',
|
|
65
|
+
'yoda' : 'off',
|
|
66
|
+
'no-underscore-dangle' : 'off',
|
|
67
|
+
'newline-per-chained-call' : 'off',
|
|
68
|
+
'default-param-last' : 'off',
|
|
69
|
+
'no-promise-executor-return' : 'off',
|
|
70
|
+
'no-continue' : 'off',
|
|
71
|
+
'no-fallthrough' : 'off',
|
|
72
|
+
'no-bitwise' : 'off',
|
|
73
|
+
'func-names' : 'off',
|
|
74
|
+
'no-param-reassign' : 'off',
|
|
75
|
+
|
|
76
|
+
'array-bracket-spacing' : [ 'warn', 'always', { objectsInArrays: false, arraysInArrays: false }],
|
|
77
|
+
'quotes' : [ 'warn', 'single', { avoidEscape: true }],
|
|
78
|
+
|
|
79
|
+
'arrow-parens' : [ 'error', 'as-needed', { requireForBlockBody: true }],
|
|
80
|
+
'function-paren-newline' : [ 'error', 'consistent' ],
|
|
81
|
+
'function-call-argument-newline' : [ 'error', 'consistent' ],
|
|
82
|
+
'linebreak-style' : [ 'error', 'unix' ],
|
|
83
|
+
'object-shorthand' : [ 'error', 'consistent' ],
|
|
84
|
+
|
|
85
|
+
'comma-dangle': [ 'error', {
|
|
86
|
+
arrays : 'always-multiline',
|
|
87
|
+
objects : 'always-multiline',
|
|
88
|
+
imports : 'always-multiline',
|
|
89
|
+
exports : 'always-multiline',
|
|
90
|
+
functions : 'never',
|
|
91
|
+
}],
|
|
92
|
+
'key-spacing': [ 'error', {
|
|
93
|
+
singleLine : { beforeColon: false, afterColon: true },
|
|
94
|
+
multiLine : { beforeColon: false, afterColon: true },
|
|
95
|
+
align : { beforeColon: true, afterColon: true, on: 'colon' },
|
|
96
|
+
}],
|
|
97
|
+
'object-curly-newline': [ 'error', {
|
|
98
|
+
ObjectExpression : { multiline: true, consistent: true },
|
|
99
|
+
ObjectPattern : { multiline: true, consistent: true },
|
|
100
|
+
}],
|
|
101
|
+
'import/no-extraneous-dependencies' : [ 'error' ],
|
|
102
|
+
'import/order' : [ 'error', {
|
|
103
|
+
alphabetize : { order: 'asc' },
|
|
104
|
+
groups : [ 'builtin', 'external', 'internal', 'parent', 'sibling' ],
|
|
105
|
+
}],
|
|
106
|
+
|
|
107
|
+
'no-restricted-globals' : [ 'error', 'event', 'isFinite' ],
|
|
108
|
+
'no-restricted-properties' : noRestrictedProperies,
|
|
109
|
+
|
|
110
|
+
'consistent-return': 'off', // FIXME: async functions and $.events
|
|
111
|
+
},
|
|
32
112
|
overrides: [
|
|
33
113
|
{
|
|
34
|
-
files
|
|
35
|
-
plugins : [ 'es' ],
|
|
36
|
-
extends : [
|
|
37
|
-
'airbnb-base',
|
|
38
|
-
'plugin:es/no-new-in-es2018',
|
|
39
|
-
'plugin:es/no-new-in-es2017',
|
|
40
|
-
'plugin:es/no-new-in-es2016',
|
|
41
|
-
'plugin:es/no-new-in-es2015'
|
|
42
|
-
],
|
|
43
|
-
parserOptions: {
|
|
44
|
-
parser : 'espree',
|
|
45
|
-
ecmaVersion : 5,
|
|
46
|
-
sourceType : 'script'
|
|
47
|
-
},
|
|
48
|
-
rules: {
|
|
49
|
-
'linebreak-style' : [ 'error', 'unix' ],
|
|
50
|
-
'comma-dangle' : [ 'error', 'never' ],
|
|
51
|
-
'quotes' : [ 'warn', 'single', { avoidEscape: true }], // be more permissive than airbnb - allow 'double quotes containing 'singles''
|
|
52
|
-
'object-shorthand' : [ 'error', 'never' ],
|
|
53
|
-
'array-bracket-spacing' : [ 'warn', 'always', {
|
|
54
|
-
objectsInArrays : false,
|
|
55
|
-
arraysInArrays : false
|
|
56
|
-
}],
|
|
57
|
-
'object-curly-newline': [ 'error', {
|
|
58
|
-
ObjectExpression : { multiline: true, consistent: true },
|
|
59
|
-
ObjectPattern : { multiline: true, consistent: true }
|
|
60
|
-
}],
|
|
61
|
-
'key-spacing': [ 'error', {
|
|
62
|
-
singleLine : { beforeColon: false, afterColon: true },
|
|
63
|
-
multiLine : { beforeColon: false, afterColon: true },
|
|
64
|
-
align : { beforeColon: true, afterColon: true, on: 'colon' },
|
|
65
|
-
}],
|
|
66
|
-
'quote-props' : 'off',
|
|
67
|
-
'no-multi-spaces' : 'off',
|
|
68
|
-
'prefer-destructuring' : 'off',
|
|
69
|
-
'no-prototype-builtins' : 'off',
|
|
70
|
-
'no-nested-ternary' : 'off',
|
|
71
|
-
'no-plusplus' : 'off',
|
|
72
|
-
'template-curly-spacing' : 'off',
|
|
73
|
-
'no-var' : 'off',
|
|
74
|
-
'one-var' : 'off',
|
|
75
|
-
'one-var-declaration-per-line' : 'off',
|
|
76
|
-
'vars-on-top' : 'off',
|
|
77
|
-
'func-names' : 'off',
|
|
78
|
-
'prefer-arrow-callback' : 'off',
|
|
79
|
-
'prefer-spread' : 'off',
|
|
80
|
-
'prefer-template' : 'off',
|
|
81
|
-
'prefer-rest-params' : 'off',
|
|
82
|
-
'no-param-reassign' : 'off',
|
|
83
|
-
'no-multi-assign' : 'off',
|
|
84
|
-
'no-underscore-dangle' : 'off',
|
|
85
|
-
'no-empty' : 'off',
|
|
86
|
-
'switch-colon-spacing' : 'off',
|
|
87
|
-
'max-len' : 'off',
|
|
88
|
-
'no-continue' : 'off',
|
|
89
|
-
'consistent-return' : 'off',
|
|
90
|
-
'operator-linebreak' : 'off',
|
|
91
|
-
'guard-for-in' : 'off',
|
|
92
|
-
'no-restricted-syntax' : 'off',
|
|
93
|
-
'no-restricted-globals' : 'off',
|
|
94
|
-
'function-paren-newline' : 'off',
|
|
95
|
-
'no-fallthrough' : 'off',
|
|
96
|
-
'no-bitwise' : 'off',
|
|
97
|
-
'no-cond-assign' : 'off',
|
|
98
|
-
'no-new' : 'off',
|
|
99
|
-
'newline-per-chained-call' : 'off',
|
|
100
|
-
'prefer-exponentiation-operator' : 'off',
|
|
101
|
-
'no-restricted-properties' : noRestrictedProperies
|
|
102
|
-
}
|
|
103
|
-
},
|
|
104
|
-
{
|
|
105
|
-
files : [ '**/*.js' ],
|
|
106
|
-
excludedFiles: 'js/**/*.js',
|
|
107
|
-
env : {
|
|
108
|
-
es6: true,
|
|
109
|
-
},
|
|
110
|
-
plugins : [ 'align-assignments' ],
|
|
114
|
+
files : [ 'test/**/*.js' ],
|
|
111
115
|
globals : {
|
|
112
116
|
jest : true,
|
|
113
117
|
describe : true,
|
|
@@ -119,79 +123,6 @@ module.exports = {
|
|
|
119
123
|
afterEach : true,
|
|
120
124
|
beforeEach : true,
|
|
121
125
|
},
|
|
122
|
-
rules: {
|
|
123
|
-
'align-assignments/align-assignments' : [ 'error', { requiresOnly: false }],
|
|
124
|
-
'padding-line-between-statements' : [
|
|
125
|
-
'error', ...[
|
|
126
|
-
[ '*', [ 'multiline-block-like', 'return', 'break', 'export', 'throw', 'cjs-export' ]],
|
|
127
|
-
[ '*', [ 'cjs-import', 'import', 'const', 'let', 'var' ]],
|
|
128
|
-
[[ 'multiline-block-like', 'return', 'break', 'export', 'throw', 'cjs-export' ], '*' ],
|
|
129
|
-
[[ 'cjs-import', 'import', 'const', 'let', 'var' ], '*' ],
|
|
130
|
-
[ 'cjs-import', 'cjs-import', 'any' ],
|
|
131
|
-
[ 'import', 'import', 'any' ],
|
|
132
|
-
[ 'singleline-const', 'const', 'any' ],
|
|
133
|
-
[ 'singleline-let', 'let', 'any' ],
|
|
134
|
-
[ 'singleline-var', 'var', 'any' ],
|
|
135
|
-
[ 'expression', 'expression', 'any' ],
|
|
136
|
-
].map(
|
|
137
|
-
([ prev, next = '*', blankLine = 'always' ]) => ({ prev, next, blankLine })
|
|
138
|
-
),
|
|
139
|
-
],
|
|
140
|
-
'max-len' : 'off',
|
|
141
|
-
'no-multi-spaces' : 'off',
|
|
142
|
-
'no-multi-assign' : 'off',
|
|
143
|
-
'no-nested-ternary' : 'off',
|
|
144
|
-
'no-prototype-builtins' : 'off',
|
|
145
|
-
'no-plusplus' : 'off',
|
|
146
|
-
'operator-linebreak' : 'off',
|
|
147
|
-
'prefer-destructuring' : 'off',
|
|
148
|
-
'quote-props' : 'off',
|
|
149
|
-
'template-curly-spacing' : 'off',
|
|
150
|
-
'yoda' : 'off',
|
|
151
|
-
'no-underscore-dangle' : 'off',
|
|
152
|
-
'newline-per-chained-call' : 'off',
|
|
153
|
-
'default-param-last' : 'off',
|
|
154
|
-
'no-promise-executor-return' : 'off',
|
|
155
|
-
'no-continue' : 'off',
|
|
156
|
-
'no-fallthrough' : 'off',
|
|
157
|
-
'no-bitwise' : 'off',
|
|
158
|
-
'func-names' : 'off',
|
|
159
|
-
'no-param-reassign' : 'off',
|
|
160
|
-
|
|
161
|
-
'array-bracket-spacing' : [ 'warn', 'always', { objectsInArrays: false, arraysInArrays: false }],
|
|
162
|
-
'quotes' : [ 'warn', 'single', { avoidEscape: true }],
|
|
163
|
-
|
|
164
|
-
'arrow-parens' : [ 'error', 'as-needed', { requireForBlockBody: true }],
|
|
165
|
-
'function-paren-newline' : [ 'error', 'consistent' ],
|
|
166
|
-
'function-call-argument-newline' : [ 'error', 'consistent' ],
|
|
167
|
-
'linebreak-style' : [ 'error', 'unix' ],
|
|
168
|
-
'object-shorthand' : [ 'error', 'consistent' ],
|
|
169
|
-
|
|
170
|
-
'comma-dangle': [ 'error', {
|
|
171
|
-
arrays : 'always-multiline',
|
|
172
|
-
objects : 'always-multiline',
|
|
173
|
-
imports : 'always-multiline',
|
|
174
|
-
exports : 'always-multiline',
|
|
175
|
-
functions : 'never',
|
|
176
|
-
}],
|
|
177
|
-
'key-spacing': [ 'error', {
|
|
178
|
-
singleLine : { beforeColon: false, afterColon: true },
|
|
179
|
-
multiLine : { beforeColon: false, afterColon: true },
|
|
180
|
-
align : { beforeColon: true, afterColon: true, on: 'colon' },
|
|
181
|
-
}],
|
|
182
|
-
'object-curly-newline': [ 'error', {
|
|
183
|
-
ObjectExpression : { multiline: true, consistent: true },
|
|
184
|
-
ObjectPattern : { multiline: true, consistent: true },
|
|
185
|
-
}],
|
|
186
|
-
'import/no-extraneous-dependencies' : [ 'error' ],
|
|
187
|
-
'import/order' : [ 'error', {
|
|
188
|
-
alphabetize : { order: 'asc' },
|
|
189
|
-
groups : [ 'builtin', 'external', 'internal', 'parent', 'sibling' ],
|
|
190
|
-
}],
|
|
191
|
-
|
|
192
|
-
'no-restricted-globals' : [ 'error', 'event', 'isFinite' ],
|
|
193
|
-
'no-restricted-properties' : noRestrictedProperies,
|
|
194
|
-
}
|
|
195
126
|
},
|
|
196
|
-
]
|
|
127
|
+
],
|
|
197
128
|
};
|
|
@@ -3,22 +3,21 @@ name: test
|
|
|
3
3
|
on:
|
|
4
4
|
push:
|
|
5
5
|
branches:
|
|
6
|
-
- gh-pages
|
|
7
6
|
- master
|
|
7
|
+
- develop
|
|
8
8
|
jobs:
|
|
9
9
|
test:
|
|
10
|
-
|
|
11
10
|
runs-on: ubuntu-latest
|
|
12
11
|
|
|
13
12
|
strategy:
|
|
14
13
|
matrix:
|
|
15
|
-
node-version: [
|
|
14
|
+
node-version: [16.x]
|
|
16
15
|
|
|
17
16
|
steps:
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
17
|
+
- uses: actions/checkout@v2
|
|
18
|
+
- uses: actions/setup-node@v1
|
|
19
|
+
with:
|
|
20
|
+
node-version: ${{ matrix.node-version }}
|
|
21
|
+
- run: yarn install
|
|
22
|
+
- run: yarn lint
|
|
23
|
+
- run: yarn test
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
name: update gh-pages
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- master
|
|
7
|
+
jobs:
|
|
8
|
+
build:
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
|
|
11
|
+
strategy:
|
|
12
|
+
matrix:
|
|
13
|
+
node-version: [16.x]
|
|
14
|
+
|
|
15
|
+
steps:
|
|
16
|
+
- uses: actions/checkout@v2
|
|
17
|
+
- uses: actions/setup-node@v1
|
|
18
|
+
with:
|
|
19
|
+
node-version: ${{ matrix.node-version }}
|
|
20
|
+
- run: yarn install
|
|
21
|
+
- run: yarn build --env public-path=/Genoverse/dist/
|
|
22
|
+
- name: Commit and push files
|
|
23
|
+
run: |
|
|
24
|
+
echo $GITHUB_ACTOR
|
|
25
|
+
git config --local user.email "$GITHUB_ACTOR@users.noreply.github.com"
|
|
26
|
+
git config --local user.name $GITHUB_ACTOR
|
|
27
|
+
git fetch --all
|
|
28
|
+
git checkout gh-pages
|
|
29
|
+
git pull
|
|
30
|
+
git reset --hard origin/master
|
|
31
|
+
git add -f dist
|
|
32
|
+
git commit -m "Added dist folder"
|
|
33
|
+
git push --force origin gh-pages
|
package/LICENSE.TXT
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Copyright (c) 2011 Genome Research Ltd.
|
|
2
|
-
Author: Evgeny Bragin
|
|
2
|
+
Author: Simon Brent, Evgeny Bragin
|
|
3
3
|
|
|
4
4
|
Redistribution and use in source and binary forms, with or without
|
|
5
5
|
modification, are permitted provided that the following conditions are met:
|
|
@@ -21,4 +21,4 @@ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
|
21
21
|
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
22
22
|
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
23
23
|
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
24
|
-
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
24
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
package/README.md
CHANGED
|
@@ -4,8 +4,179 @@ Genoverse is a portable, customizable, back-end independent JavaScript and HTML5
|
|
|
4
4
|
|
|
5
5
|
Data is visualized in the browser, meaning Genoverse can be installed on any website and show data from a wide range of online or local sources.
|
|
6
6
|
|
|
7
|
-
Genoverse works with a variety of formats, such as
|
|
7
|
+
Genoverse works with a variety of formats, such as JSON, BED, BAM, VCF, GFF, delimited text files, or XML, and can be customized to parse and display any data source as required.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Genoverse works using a system of [**tracks**](https://github.com/wtsi-web/Genoverse/wiki/Tracks) - essentially horizontal sections of the genome browser which display **features** - genes, variants, etc. with defined genomic start and end points. Each track has its own data set stored in a **model**, a method for displaying that data, stored in a **view**, and a **controller** to manage the creation of DOM elements, and user interactions with them.
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
Tracks can have multiple models and views, which allows for switching between displays at different zoom levels. An example of this would be a track where you show genes when looking at a large region of a chromosome, and then switch to showing transcripts as the user zooms in.
|
|
12
|
+
|
|
13
|
+
In addition to this, Genoverse has a set of [plugins](https://github.com/wtsi-web/Genoverse/wiki/Plugins), which allow additional functionality beyond the core genome browser. These include a control panel for adding and removing tracks, and interacting with the browser more easily, a way to add controls to each individual track, and a way to enable drag and drop of local data files onto the genome browser.
|
|
14
|
+
|
|
15
|
+
## Installation
|
|
16
|
+
|
|
17
|
+
Install from npm
|
|
18
|
+
```sh
|
|
19
|
+
yarn add genoverse
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
### Basic embedding
|
|
23
|
+
|
|
24
|
+
Embed Genoverse using
|
|
25
|
+
```html
|
|
26
|
+
<script src="/path/to/genoverse/dist/genoverse.js"></script>
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Add a script tag or JavaScript file which initializes Genoverse, e.g.
|
|
30
|
+
```html
|
|
31
|
+
<script>
|
|
32
|
+
const genoverse = new Genoverse({ ... configuration ... });
|
|
33
|
+
</script>
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Once initalized, the instance of Genoverse is avaliable as a jQuery data attribute on the container DOM element, and can be accessed by
|
|
37
|
+
```javascript
|
|
38
|
+
const genoverse = Genoverse.jQuery(container).data('genoverse');
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### Build options
|
|
42
|
+
|
|
43
|
+
By default, the Genoverse distribution in created with [Babel](https://babeljs.io/) and certain [polyfills](https://github.com/zloirock/core-js/blob/master/README.md), in order to support old web browsers like Internet Explorer 11.
|
|
44
|
+
|
|
45
|
+
If you want to create your own distribution bundle, see `devDependencies` in [package.json](https://github.com/wtsi-web/Genoverse/blob/master/package.json) for Webpack/Babel packages you need to install in order to be able to do so.
|
|
46
|
+
|
|
47
|
+
Once these dependencies are installed, distributions can be built with [webpack-cli](https://webpack.js.org/api/cli/).
|
|
48
|
+
|
|
49
|
+
Polyfills can be disabled, either with
|
|
50
|
+
```sh
|
|
51
|
+
yarn webpack --env no-polyfills
|
|
52
|
+
```
|
|
53
|
+
which still uses Babel to create ES5-compatible code, but doesn't include the polyfills (useful if the page already includes polyfills), or with
|
|
54
|
+
```
|
|
55
|
+
yarn webpack --env modern
|
|
56
|
+
```
|
|
57
|
+
which does not transpile to ES5-compatible code or include polyfills, and thus will not work in old browsers at all.
|
|
58
|
+
|
|
59
|
+
Additionally, you can set the [webpack `output.publicPath`](https://webpack.js.org/configuration/output/#outputpublicpath) with
|
|
60
|
+
```
|
|
61
|
+
yarn webpack --env public-path=/public/path/to/genoverse
|
|
62
|
+
```
|
|
63
|
+
This is necessary if `/path/to/genoverse/dist` is not your webserver's root directory for static files.
|
|
64
|
+
|
|
65
|
+
This option can be combined with `--env no-polyfills` or `--env modern`, e.g.
|
|
66
|
+
```
|
|
67
|
+
yarn webpack --env modern --env public-path=/public/path/to/genoverse
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### Importing into other webpack-bundled code
|
|
71
|
+
|
|
72
|
+
You can use webpack's [`import`](https://webpack.js.org/guides/ecma-script-modules/#importing) keyword to import Genoverse's source code into another application, without needing to build a distribution (or installing any additional packages):
|
|
73
|
+
|
|
74
|
+
```js
|
|
75
|
+
// static import
|
|
76
|
+
import Genoverse from 'genoverse';
|
|
77
|
+
|
|
78
|
+
// dynamic import, useful if you need to avoid server-side importing Genoverse,
|
|
79
|
+
// which doesn't work because it depends on `window`
|
|
80
|
+
const Genoverse = await import('genoverse').then(module => module.default);
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### Using `Genoverse.configure()`
|
|
84
|
+
|
|
85
|
+
The Genoverse class provides a `configure` function which allows you to change what code will be imported. This function is run automatically when an instance of Genoverse is constructed, but can also be called manually - only the first execution will have any affect.
|
|
86
|
+
|
|
87
|
+
The default arguments are as follows:
|
|
88
|
+
```js
|
|
89
|
+
Genoverse.configure({
|
|
90
|
+
tracks : {}, // see below
|
|
91
|
+
plugins : {}, // see below
|
|
92
|
+
genomes : {}, // see below
|
|
93
|
+
css : true, // if true, Genoverse's css file will by dynamically imported
|
|
94
|
+
fontawesome : true, // if true, fontawesome 6 will be dynamically imported. Set to false if fontawesome is already in use on the page
|
|
95
|
+
force : false, // if true, configuration is updated according to the other arguments
|
|
96
|
+
});
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
```js
|
|
100
|
+
tracks: {
|
|
101
|
+
// A list of tracks, controllers, models, or views which you don't want to appear in the Genoverse.Track namespace.
|
|
102
|
+
// Note: this does not stop files containing excluded code from being present in the webpack bundle.
|
|
103
|
+
exclude: [
|
|
104
|
+
// The code in src/js/Track/Model/Transcript/Ensembl.js will not be present as Genoverse.Track.Model.Transcript.Ensembl
|
|
105
|
+
'Model.Transcript.Ensembl',
|
|
106
|
+
|
|
107
|
+
// The code in src/js/Track/View/Sequence/Variation.js will not be present as Genoverse.Track.View.Sequence.Variation
|
|
108
|
+
'View/Sequence/Variation',
|
|
109
|
+
|
|
110
|
+
// The code in src/js/Track/library/Gene.js will not be present as Genoverse.Track.Gene
|
|
111
|
+
'Gene',
|
|
112
|
+
|
|
113
|
+
// The code in src/js/Track/library/dbSNP.js will not be present as Genoverse.Track.dbSNP
|
|
114
|
+
'library/dbSNP',
|
|
115
|
+
|
|
116
|
+
...
|
|
117
|
+
],
|
|
118
|
+
|
|
119
|
+
// A webpack `require.context` for a folder containing custom track definitions.
|
|
120
|
+
// This folder must be structured in the same way as src/js/Track, i.e. with some/or of the sub-folders Controller, Model, View, library
|
|
121
|
+
include: require.context('/path/to/custom/tracks/folder', true, /\.js$/),
|
|
122
|
+
}
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
```js
|
|
126
|
+
plugins: {
|
|
127
|
+
// A webpack `require.context` for a folder containing custom plugins.
|
|
128
|
+
include: require.context('/path/to/custom/plugins/folder', true, /\.js$/),
|
|
129
|
+
}
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
```js
|
|
133
|
+
genomes: {
|
|
134
|
+
// A webpack `require.context` for a folder containing custom genome definitions.
|
|
135
|
+
// The human genomes GRCh37 and GRCh38 are included in the Genoverse repo, and imported dynamically if needed (see src/js/genomes).
|
|
136
|
+
// Additional genomes can be loaded with the following option, or by using new Genoverse({ ... genome: aGenomeDefinitionObject ... })
|
|
137
|
+
include: require.context('/path/to/custom/genomes/folder', true, /\.js$/),
|
|
138
|
+
}
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
Before `Genoverse.configure` is executed, `Genoverse.Track`, `Genoverse.Track.Controller`, `Genoverse.Track.Model`, and `Genoverse.Track.View` all exist, but none of their children (i.e. `Genoverse.Track.Foo`) will.
|
|
142
|
+
|
|
143
|
+
Because of this, if you want to use track classes as options in `new Genoverse()`, you need to call `Genoverse.configure()` first, i.e.
|
|
144
|
+
|
|
145
|
+
```js
|
|
146
|
+
Genoverse.configure({ ... });
|
|
147
|
+
|
|
148
|
+
new Genoverse({
|
|
149
|
+
...
|
|
150
|
+
tracks: [
|
|
151
|
+
Genoverse.Track.Foo,
|
|
152
|
+
Genoverse.Track.Bar.extend({ foo: false, bar: true, ... }),
|
|
153
|
+
Genoverse.Track.extend({
|
|
154
|
+
controller : Genoverse.Track.Controller.Foo,
|
|
155
|
+
model : Genoverse.Track.Model.Foo.extend({ foo: true }),
|
|
156
|
+
view : Genoverse.Track.View.Foo.Bar,
|
|
157
|
+
}),
|
|
158
|
+
]
|
|
159
|
+
});
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
Alternatively, you can do the following without having to call `Genoverse.configure()` first:
|
|
163
|
+
|
|
164
|
+
```js
|
|
165
|
+
new Genoverse({
|
|
166
|
+
...
|
|
167
|
+
tracks: [
|
|
168
|
+
'Foo', // -> Genoverse.Track.Foo
|
|
169
|
+
[ 'Foo' ], // -> Genoverse.Track.Foo
|
|
170
|
+
[ 'Bar', { foo: false, bar: true, ... } ], // -> Genoverse.Track.Bar.extend({ foo: false, bar: true, ... })
|
|
171
|
+
{ // -> Genoverse.Track.extend({
|
|
172
|
+
foo : false, // -> foo : false,
|
|
173
|
+
bar : false, // -> bar : false,
|
|
174
|
+
controller : [ 'Foo' ], // -> controller : Genoverse.Track.Controller.Foo,
|
|
175
|
+
model : [ 'Foo', { foo: true }], // -> model : Genoverse.Track.Model.Foo.extend({ foo: true }),
|
|
176
|
+
view : 'Foo.Bar', // -> view : Genoverse.Track.View.Foo.Bar,
|
|
177
|
+
} // -> })
|
|
178
|
+
]
|
|
179
|
+
});
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
See [index.html](https://github.com/wtsi-web/Genoverse/blob/master/index.html) for example configuration, or the [documentation](https://github.com/wtsi-web/Genoverse/wiki/Genoverse-configuration) for more details about configuration properties.
|
|
File without changes
|
package/babel.config.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
module.exports = (api) => {
|
|
2
|
+
if (api.caller(({ name }) => name === 'babel-jest')) {
|
|
3
|
+
return {
|
|
4
|
+
presets: [
|
|
5
|
+
[
|
|
6
|
+
'@babel/preset-env',
|
|
7
|
+
{
|
|
8
|
+
targets: {
|
|
9
|
+
node: 'current',
|
|
10
|
+
},
|
|
11
|
+
},
|
|
12
|
+
],
|
|
13
|
+
],
|
|
14
|
+
plugins: [[ 'transform-amd-to-commonjs', { restrictToTopLevelDefine: false }], 'require-context-hook' ],
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
return {};
|
|
19
|
+
};
|