genoverse 4.0.5 → 4.0.8

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/index.html CHANGED
@@ -14,7 +14,7 @@
14
14
  </style>
15
15
  </head>
16
16
  <body>
17
- <a class="fork" href="https://github.com/wtsi-web/Genoverse" target="_blank"><img src="https://s3.amazonaws.com/github/ribbons/forkme_right_orange_ff7600.png" alt="Fork me on GitHub"></a>
17
+ <a class="fork" href="https://github.com/WTSI-decipher-grp/Genoverse" target="_blank"><img src="https://s3.amazonaws.com/github/ribbons/forkme_right_orange_ff7600.png" alt="Fork me on GitHub"></a>
18
18
  <div class="container">
19
19
  <div class="head"><h1>Genoverse - interactive HTML5 genome browser</h1></div>
20
20
  <div class="wrap">
@@ -25,7 +25,7 @@
25
25
  <p>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.</p>
26
26
  <p>Genoverse works with a variety of formats, such as XML, JSON, GFF, GFF3, BED (try drag-n-drop one), and can be customized to parse and display any data source as required.</p>
27
27
 
28
- <p class="help">If you have any questions or need help, please raise an issue at <a href="https://github.com/wtsi-web/Genoverse" target="_blank">https://github.com/wtsi-web/Genoverse</a></p>
28
+ <p class="help">If you have any questions or need help, please raise an issue at <a href="https://github.com/WTSI-decipher-grp/Genoverse" target="_blank">https://github.com/WTSI-decipher-grp/Genoverse</a></p>
29
29
  </div>
30
30
  </div>
31
31
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "genoverse",
3
- "version": "4.0.5",
3
+ "version": "4.0.8",
4
4
  "description": "Genoverse is a portable, customizable, back-end independent JavaScript and HTML5 based genome browser which allows the user to explore data in a dynamic and interactive manner.",
5
5
  "main": "src/js/Genoverse.js",
6
6
  "directories": {
@@ -16,14 +16,14 @@
16
16
  },
17
17
  "repository": {
18
18
  "type": "git",
19
- "url": "git+https://github.com/wtsi-web/Genoverse.git"
19
+ "url": "git+https://github.com/WTSI-decipher-grp/Genoverse.git"
20
20
  },
21
21
  "author": "Simon Brent",
22
22
  "license": "BSD-3-Clause",
23
23
  "bugs": {
24
- "url": "https://github.com/wtsi-web/Genoverse/issues"
24
+ "url": "https://github.com/WTSI-decipher-grp/Genoverse/issues"
25
25
  },
26
- "homepage": "https://wtsi-web.github.io/Genoverse/",
26
+ "homepage": "https://wtsi-decipher-grp.github.io/Genoverse/",
27
27
  "devDependencies": {
28
28
  "@babel/core": "^7.17.2",
29
29
  "@babel/eslint-parser": "^7.17.0",
@@ -1,7 +1,7 @@
1
1
  import Model from '../Sequence';
2
2
 
3
3
  export default Model.extend({
4
- url: 'https://wtsi-web.github.io/Genoverse/data/Homo_sapiens.GRCh37.72.dna.chromosome.1.fa', // Example url
4
+ url: 'https://wtsi-decipher-grp.github.io/Genoverse/data/Homo_sapiens.GRCh37.72.dna.chromosome.1.fa', // Example url
5
5
 
6
6
  // Following settings could be left undefined and will be detected automatically via .getStartByte()
7
7
  startByte : undefined, // Byte in the file where the sequence actually starts
@@ -1,46 +1,64 @@
1
1
  import View from '../Gene';
2
2
 
3
+ /**
4
+ * Provides a function setFeatureColor for defining the feature colour and legend label
5
+ * for ensembl genes and transcripts based on their logic_name and biotype properties.
6
+ *
7
+ * Biotypes are defined in
8
+ * https://www.ensembl.org/info/genome/genebuild/biotypes.html
9
+ *
10
+ * Ensembl colours are defined in
11
+ * https://github.com/Ensembl/ensembl-webcode/blob/main/conf/ini-files/COLOUR.ini
12
+ */
13
+
3
14
  export default View.extend({
4
15
  setFeatureColor: function (feature) {
5
16
  const processedTranscript = {
6
- 'sense_intronic' : 1,
7
- 'sense_overlapping' : 1,
8
- 'processed_transcript' : 1,
9
- 'nonsense_mediated_decay' : 1,
10
- 'non_stop_decay' : 1,
11
- 'antisense' : 1,
12
- 'retained_intron' : 1,
13
- 'tec' : 1,
14
- 'non_coding' : 1,
15
- 'ambiguous_orf' : 1,
16
- 'disrupted_domain' : 1,
17
- '3prime_overlapping_ncrna' : 1,
17
+ 'sense_intronic' : 1,
18
+ 'sense_overlapping' : 1,
19
+ 'processed_transcript' : 1,
20
+ 'nonsense_mediated_decay' : 1,
21
+ 'non_stop_decay' : 1,
22
+ 'antisense' : 1,
23
+ 'retained_intron' : 1,
24
+ 'tec' : 1,
25
+ 'non_coding' : 1,
26
+ 'ambiguous_orf' : 1,
27
+ 'disrupted_domain' : 1,
28
+ '3prime_overlapping_ncrna' : 1,
29
+ 'protein_coding_CDS_not_defined' : 1, // new in e108
18
30
  };
19
31
 
20
32
  feature.color = '#000000';
21
33
 
22
- if (feature.logic_name.indexOf('ensembl_havana') === 0) {
34
+ const logicName = feature.logic_name || '';
35
+ const biotype = (feature.biotype || '').toLowerCase();
36
+
37
+ if (logicName.indexOf('ensembl_havana') === 0) {
23
38
  feature.color = '#CD9B1D';
24
39
  feature.labelColor = '#B78000';
25
40
  feature.legend = 'Merged Ensembl/Havana';
26
- } else if (processedTranscript[feature.biotype.toLowerCase()]) {
41
+ } else if (processedTranscript[biotype]) {
27
42
  feature.color = '#0000FF';
28
43
  feature.legend = 'Processed transcript';
29
- } else if (feature.biotype === 'protein_coding') {
44
+ } else if (feature.biotype.indexOf('protein_coding') > -1) {
30
45
  feature.color = '#A00000';
31
46
  feature.legend = 'Protein coding';
32
- } else if (feature.biotype.indexOf('pseudogene') > -1) {
47
+ } else if (feature.biotype === 'artifact' || biotype.indexOf('pseudogene') > -1) {
33
48
  feature.color = '#666666';
34
49
  feature.legend = 'Pseudogene';
35
- } else if (/rna/i.test(feature.biotype) || feature.biotype === 'ribozyme') {
50
+ } else if (/rna/.test(biotype) || biotype === 'ribozyme') {
36
51
  feature.color = '#8B668B';
37
52
  feature.legend = 'RNA gene';
38
- } else if (/^tr_.+_gene$/i.test(feature.biotype)) {
53
+ } else if (/^tr(?:_.+)?_gene$/.test(biotype)) {
39
54
  feature.color = '#CD6600';
40
55
  feature.legend = 'TR gene';
41
- } else if (/^ig_.+_gene$/i.test(feature.biotype)) {
56
+ } else if (/^ig_.+_gene$/.test(biotype)) {
42
57
  feature.color = '#8B4500';
43
58
  feature.legend = 'IG gene';
59
+ } else if (biotype === 'lrg_gene') {
60
+ feature.color = '#8080FF';
61
+ feature.legend = 'LRG gene';
44
62
  }
45
63
 
46
64
  feature.labelColor = feature.labelColor || feature.color;
@@ -349,7 +349,7 @@ const plugin = function (pluginConf) {
349
349
  },
350
350
 
351
351
  afterAddDomElements: function () {
352
- this.wrapper.after('<div class="gv-powered-by">Powered by <a target="_blank" href="https://wtsi-web.github.io/Genoverse/">Genoverse</a></div>');
352
+ this.wrapper.after('<div class="gv-powered-by">Powered by <a target="_blank" href="https://wtsi-decipher-grp.github.io/Genoverse/">Genoverse</a></div>');
353
353
  this.superContainer.find('.gv-panel-left').append(this.labelContainer);
354
354
  },
355
355
 
@@ -0,0 +1,28 @@
1
+ const { $, Genoverse, afterTest } = require('../utils');
2
+
3
+ describe('All ensembl biotypes should be categorised by setFeatureColor:', () => {
4
+ afterEach(afterTest);
5
+
6
+ // select * from (select distinct(biotype) from transcript union select distinct(biotype) from gene) biotypes order by biotype;
7
+ const ensemblBiotypes = [ 'artifact', 'IG_C_gene', 'IG_C_pseudogene', 'IG_D_gene', 'IG_J_gene', 'IG_J_pseudogene', 'IG_pseudogene', 'IG_V_gene', 'IG_V_pseudogene', 'lncRNA', 'LRG_gene', 'miRNA', 'misc_RNA', 'Mt_rRNA', 'Mt_tRNA', 'nonsense_mediated_decay', 'non_stop_decay', 'processed_pseudogene', 'processed_transcript', 'protein_coding', 'protein_coding_LoF', 'pseudogene', 'retained_intron', 'ribozyme', 'rRNA', 'rRNA_pseudogene', 'scaRNA', 'scRNA', 'snoRNA', 'snRNA', 'sRNA', 'TEC', 'transcribed_processed_pseudogene', 'transcribed_unitary_pseudogene', 'transcribed_unprocessed_pseudogene', 'translated_processed_pseudogene', 'translated_unprocessed_pseudogene', 'TR_C_gene', 'TR_D_gene', 'TR_J_gene', 'TR_J_pseudogene', 'TR_V_gene', 'TR_V_pseudogene', 'unitary_pseudogene', 'unprocessed_pseudogene', 'vault_RNA' ];
8
+
9
+ ensemblBiotypes.forEach(
10
+ biotype => it(
11
+ `${biotype} should be categorised by setFeatureColor`, () => {
12
+ const feature = { logic_name: '', biotype: biotype };
13
+
14
+ const [ track ] = new Genoverse({
15
+ chr : 1,
16
+ start : 1,
17
+ end : 100,
18
+ chromosomeSize : 100,
19
+ tracks : [ Genoverse.Track.Gene.extend($.extend(true, {}, { data: [ feature ] })) ],
20
+ }).tracks;
21
+
22
+ track.view.setFeatureColor(feature);
23
+
24
+ expect(feature.legend).toBeDefined();
25
+ }
26
+ )
27
+ );
28
+ });