Skip to content

Commit

Permalink
Support unprocessed transcripts in neat features
Browse files Browse the repository at this point in the history
  • Loading branch information
cmdcolin committed Dec 28, 2018
1 parent 8236ade commit 4f0576e
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 25 deletions.
18 changes: 12 additions & 6 deletions plugins/NeatCanvasFeatures/js/View/FeatureGlyph/Gene.js
Expand Up @@ -4,22 +4,28 @@ define([
'dojo/_base/array',
'JBrowse/View/FeatureGlyph/Gene',
'./Box',
'./ProcessedTranscript'
'./ProcessedTranscript',
'./UnprocessedTranscript'
],
function (
declare,
lang,
array,
Gene,
BoxGlyph,
ProcessedTranscriptGlyph
Box,
ProcessedTranscript,
UnprocessedTranscript,

) {
return declare(Gene, {
_boxGlyph: function () {
return this.__boxGlyph || (this.__boxGlyph = new BoxGlyph({ track: this.track, browser: this.browser, config: this.config }));
return this.__boxGlyph || (this.__boxGlyph = new Box({ track: this.track, browser: this.browser, config: this.config }));
},
_ptGlyph: function () {
return this.__ptGlyph || (this.__ptGlyph = new ProcessedTranscriptGlyph({ track: this.track, browser: this.browser, config: this.config }));
}
return this.__ptGlyph || (this.__ptGlyph = new ProcessedTranscript({ track: this.track, browser: this.browser, config: this.config }));
},
_ntGlyph: function() {
return this.__ntGlyph || ( this.__ntGlyph = new UnprocessedTranscript({ track: this.track, browser: this.browser, config: this.config }) );
},
});
});
Expand Up @@ -12,23 +12,5 @@ function (
ProcessedTranscript,
Segments
) {
return declare([ProcessedTranscript, Segments], {

_getFeatureHeight: function( viewInfo, feature ) {
var h = this.getStyle( feature, 'height');

if( viewInfo.displayMode == 'compact' )
h = Math.round( 0.45 * h );

if( this.getStyle( feature, 'strandArrow' ) ) {
var strand = feature.get('strand');
if( strand == 1 )
h = Math.max( this._embeddedImages.plusArrow.height, h );
else if( strand == -1 )
h = Math.max( this._embeddedImages.minusArrow.height, h );
}

return h;
}
});
return declare([ProcessedTranscript, Segments])
});
@@ -0,0 +1,16 @@
define([
'dojo/_base/declare',
'dojo/_base/array',
'dojox/color/Palette',
'JBrowse/View/FeatureGlyph/UnprocessedTranscript',
'./Segments'
],
function (
declare,
array,
Palette,
UnprocessedTranscript,
Segments
) {
return declare([Segments,UnprocessedTranscript])
});

0 comments on commit 4f0576e

Please sign in to comment.