Skip to content

Commit

Permalink
Change PairUtils name
Browse files Browse the repository at this point in the history
  • Loading branch information
cmdcolin committed Nov 18, 2018
1 parent b4ed334 commit 4c45607
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 17 deletions.
6 changes: 3 additions & 3 deletions src/JBrowse/View/FeatureGlyph/Alignment.js
Expand Up @@ -2,14 +2,14 @@ define([
'dojo/_base/declare',
'dojo/_base/array',
'JBrowse/View/FeatureGlyph/Box',
'JBrowse/View/FeatureGlyph/PairUtils',
'JBrowse/View/FeatureGlyph/AlignmentColoring',
'JBrowse/Store/SeqFeature/_MismatchesMixin'
],
function(
declare,
array,
BoxGlyph,
PairUtils,
AlignmentColoring,
MismatchesMixin
) {

Expand All @@ -32,7 +32,7 @@ return declare( [BoxGlyph,MismatchesMixin], {
{
//maxFeatureScreenDensity: 400
style: {
color: PairUtils.colorAlignment,
color: AlignmentColoring.colorAlignment,
color_fwd_strand_not_proper: '#ECC8C8',
color_rev_strand_not_proper: '#BEBED8',
color_fwd_strand: '#EC8B8B',
Expand Down
Expand Up @@ -3,14 +3,14 @@ define( [
],
function(Util) {

var PairUtils = {
var AlignmentColoring = {
colorAlignment(feature, score, glyph, track) {
var strand = feature.get('strand');
if (Math.abs(strand) != 1 && strand != '+' && strand != '-') {
return track.colorForBase('reference');
}
else if (track.config.colorByOrientation) {
return PairUtils.colorByOrientation(feature, score, glyph, track)
return AlignmentColoring.colorByOrientation(feature, score, glyph, track)
}
else if (track.config.useXS) {
var xs = feature.get('xs')
Expand Down Expand Up @@ -92,21 +92,21 @@ var PairUtils = {

colorArcs(feature, score, glyph, track) {
if (track.config.colorByOrientation) {
return PairUtils.colorByOrientation(feature, score, glyph, track)
return AlignmentColoring.colorByOrientation(feature, score, glyph, track)
} else {
return PairUtils.colorByInsertDistance(feature, score, glyph, track)
return AlignmentColoring.colorByInsertDistance(feature, score, glyph, track)
}
},

colorConnector(feature, score, glyph, track) {
if (track.config.colorByOrientation) {
return PairUtils.colorByOrientation(feature, score, glyph, track)
return AlignmentColoring.colorByOrientation(feature, score, glyph, track)
} else {
return 'black'
}
}
};

return PairUtils;
return AlignmentColoring;

});
6 changes: 3 additions & 3 deletions src/JBrowse/View/FeatureGlyph/PairedAlignment.js
Expand Up @@ -3,14 +3,14 @@ define([
'dojo/_base/array',
'dojo/_base/lang',
'JBrowse/View/FeatureGlyph/Alignment',
'JBrowse/View/FeatureGlyph/PairUtils'
'JBrowse/View/FeatureGlyph/AlignmentColoring'
],
function(
declare,
array,
lang,
Alignment,
PairUtils
AlignmentColoring
) {


Expand Down Expand Up @@ -65,7 +65,7 @@ _defaultConfig() {
readCloudLog: true,
readCloudStretch: 20,
style: {
connectorColor: PairUtils.colorConnector,
connectorColor: AlignmentColoring.colorConnector,
connectorThickness: 1,
}
});
Expand Down
6 changes: 3 additions & 3 deletions src/JBrowse/View/FeatureGlyph/PairedArc.js
Expand Up @@ -3,21 +3,21 @@ define([
'dojo/_base/array',
'dojo/_base/lang',
'JBrowse/View/FeatureGlyph/Box',
'JBrowse/View/FeatureGlyph/PairUtils'
'JBrowse/View/FeatureGlyph/AlignmentColoring'
],
function(
declare,
array,
lang,
FeatureGlyph,
PairUtils
AlignmentColoring
) {
return declare(FeatureGlyph, {

_defaultConfig: function() {
return this._mergeConfigs(lang.clone(this.inherited(arguments)), {
style: {
color: PairUtils.colorArcs,
color: AlignmentColoring.colorArcs,
color_pair_lr: 'grey',
color_pair_rr: 'navy',
color_pair_rl: 'teal',
Expand Down
14 changes: 12 additions & 2 deletions src/JBrowse/View/Track/Alignments2.js
Expand Up @@ -33,11 +33,11 @@ return declare( [ CanvasFeatureTrack, AlignmentsMixin ], {
hideUnmapped: true,
hideUnsplicedReads: false,
hideMissingMatepairs: false,
hideForwardStrant: false,
hideForwardStrand: false,
hideReverseStrand: false,
useXS: false,
useTS: false,
useReverseTemplate: false,
useXSOption: true,
useReverseTemplateOption: true,
viewAsPairs: false,
readCloud: false,
Expand Down Expand Up @@ -135,6 +135,16 @@ return declare( [ CanvasFeatureTrack, AlignmentsMixin ], {
thisB.browser.publish('/jbrowse/v1/v/tracks/replace', [thisB.config]);
}
});

c.children.push({
label: 'Color by TS tag (RNA-seq strandedness)',
type: 'dijit/CheckedMenuItem',
checked: this.config.useTS,
onClick: function(event) {
thisB.config.useTS = this.get('checked');
thisB.browser.publish('/jbrowse/v1/v/tracks/replace', [thisB.config]);
}
});
c.children.push({
label: 'Color mate pair as flipped (RNA-seq strandedness)',
type: 'dijit/CheckedMenuItem',
Expand Down

0 comments on commit 4c45607

Please sign in to comment.