Skip to content

Commit

Permalink
Fix remaining style issues in source code
Browse files Browse the repository at this point in the history
  • Loading branch information
eweitz committed Aug 15, 2019
1 parent 03f9bb4 commit 0d3aa69
Show file tree
Hide file tree
Showing 15 changed files with 56 additions and 57 deletions.
32 changes: 16 additions & 16 deletions src/js/assembly-manifest.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
assemblyManifest = { 'brachypodium-distachyon': [ 'GCF_000005505.3',
'Brachypodium_distachyon_v3.0'],
'chlorocebus-sabaeus': ['GCF_000409795.2', 'Chlorocebus_sabeus 1.1'],
'ciona-intestinalis': ['GCF_000224145.3', 'KH'],
'felis-catus': ['GCF_000181335.3', 'Felis_catus_9.0'],
'gallus-gallus': ['GCF_000002315.6', 'GRCg6a'],
'gorilla-gorilla': ['GCF_000151905.2', 'gorGor4'],
'homo-sapiens': ['GCF_000001405.38', 'GRCh38.p12'],
'macaca-fascicularis': ['GCF_000364345.1', 'Macaca_fascicularis_5.0'],
'macaca-mulatta': ['GCF_003339765.1', 'Mmul_10'],
'mus-musculus': ['GCF_000001635.26', 'GRCm38.p6'],
'nomascus-leucogenys': ['GCF_000146795.2', 'Nleu_3.0'],
'ornithorhynchus-anatinus': [ 'GCF_000002275.2',
'Ornithorhynchus_anatinus-5.0.1'],
'pan-paniscus': ['GCF_000258655.2', 'panpan1.1'],
'pan-troglodytes': ['GCF_002880755.1', 'Clint_PTRv2']}
assemblyManifest = {
'brachypodium-distachyon': ['GCF_000005505.3', 'Brachypodium_distachyon_v3.0'],
'chlorocebus-sabaeus': ['GCF_000409795.2', 'Chlorocebus_sabeus 1.1'],
'ciona-intestinalis': ['GCF_000224145.3', 'KH'],
'felis-catus': ['GCF_000181335.3', 'Felis_catus_9.0'],
'gallus-gallus': ['GCF_000002315.6', 'GRCg6a'],
'gorilla-gorilla': ['GCF_000151905.2', 'gorGor4'],
'homo-sapiens': ['GCF_000001405.38', 'GRCh38.p12'],
'macaca-fascicularis': ['GCF_000364345.1', 'Macaca_fascicularis_5.0'],
'macaca-mulatta': ['GCF_003339765.1', 'Mmul_10'],
'mus-musculus': ['GCF_000001635.26', 'GRCm38.p6'],
'nomascus-leucogenys': ['GCF_000146795.2', 'Nleu_3.0'],
'ornithorhynchus-anatinus': ['GCF_000002275.2', 'Ornithorhynchus_anatinus-5.0.1'],
'pan-paniscus': ['GCF_000258655.2', 'panpan1.1'],
'pan-troglodytes': ['GCF_002880755.1', 'Clint_PTRv2']
};
5 changes: 2 additions & 3 deletions src/js/brush.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ function getBasePairDomainAndPixelRange(chrModel, xOffset) {
pxRange = [1],
lastBand = chrModel.bands.slice(-1)[0];


for (i = 0; i < chrModel.bands.length; i++) {
band = chrModel.bands[i];
bpDomain.push(band.bp.start);
Expand Down Expand Up @@ -110,7 +109,7 @@ function writeBrush(chrModel, from, to, xOffset, width, ideo) {
}

function setSelectedRegion(from, to, ideo) {
// Genomics web UIs are 1-based, fully closed.
// Genomics web UIs are 1-based, fully closed.
// I.e. If start = 20 bp and stop = 10 bp, then extent = 11 bp.
// Details:
// http://genome.ucsc.edu/blog/the-ucsc-genome-browser-coordinate-counting-systems/
Expand Down Expand Up @@ -150,4 +149,4 @@ function createBrush(chr, from, to) {
writeBrush(chrModel, from, to, xOffset, width, ideo);
}

export {onBrushMove, createBrush};
export {onBrushMove, createBrush};
4 changes: 2 additions & 2 deletions src/js/collinear-vertical.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
// }

// /**
// * Get pixel coordinates to use for rearrangement
// * Get pixel coordinates to use for rearrangement
// */
// function getyOffsets(chrSets, ideo) {
// var yOffsets, i, index, prevChrSet, y, prevWidth, prevY, yBump;
Expand Down Expand Up @@ -83,4 +83,4 @@
// .style('position', 'absolute');
// }

// export default collinearizeVerticalChromosomes;
// export default collinearizeVerticalChromosomes;
25 changes: 13 additions & 12 deletions src/js/collinear.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ function rearrangeChromosomes(chrSets, xOffsets, y, ideo) {
chr = ideo.chromosomesArray[i];
taxid = chr.id.split('-')[1];
orgIndex = ideo.config.taxids.indexOf(taxid);
adjustedY = y + orgIndex*200;
adjustedY = y + orgIndex * 200;
if (orgIndex === 0) {
chrLabelY = 6;
adjustedY += ideo.config.chrWidth*2;
adjustedY += ideo.config.chrWidth * 2;
} else {
chrLabelY = ideo.config.chrWidth*2 + 10;
chrLabelY = ideo.config.chrWidth * 2 + 10;
}

if (ideo.config.showChromosomeLabels) {
Expand All @@ -38,7 +38,7 @@ function rearrangeChromosomes(chrSets, xOffsets, y, ideo) {
}

/**
* Get pixel coordinates to use for rearrangement
* Get pixel coordinates to use for rearrangement
*/
function getxOffsets(chrSets, ideo) {
var xOffsets, i, index, chr, prevChr, x, prevWidth, prevX, xBump, taxid,
Expand Down Expand Up @@ -68,13 +68,13 @@ function getxOffsets(chrSets, ideo) {
// /**
// * Track number of chromosomes in preceding organisms.
// * Adds an instance variable to the ideogram object to offset
// * chromosome indices. Needed for multiorganism collinear ideograms.
// * chromosome indices. Needed for multiorganism collinear ideograms.
// */
// function setTaxidChrOffsets(ideo) {
// var taxidChrOffsets, taxidChrOffset;

// taxidChrOffsets = {};

// taxidChrOffset = 0;
// ideo.config.organism.forEach((org) => {
// var taxid, numChrs;
Expand Down Expand Up @@ -103,7 +103,7 @@ function getxOffsets(chrSets, ideo) {
// }

function collinearizeChromosomes(ideo) {
var chrSets, xOffsets, y, xOffsets, height, width,
var chrSets, xOffsets, y, height, width,
config = ideo.config,
annotHeight = config.annotationHeight || 0;

Expand Down Expand Up @@ -131,14 +131,15 @@ function collinearizeChromosomes(ideo) {
xOffsets = getxOffsets(chrSets, ideo);
rearrangeChromosomes(chrSets, xOffsets, y, ideo);

height = y + config.chrWidth*2 + 20;
height = y + config.chrWidth * 2 + 20;

if (config.multiorganism) {
height *= 8;
var maxWidth = 0;
xOffsets.forEach(d => {if (d > maxWidth) maxWidth = d});
xOffsets.forEach(d => {
if (d > maxWidth) maxWidth = d;
});
width = maxWidth + 20;
console.log(ideo.chromosomes)
} else {
width = xOffsets.slice(-1)[0] + 20;
}
Expand All @@ -154,4 +155,4 @@ function collinearizeChromosomes(ideo) {
.style('position', 'absolute');
}

export default collinearizeChromosomes;
export default collinearizeChromosomes;
2 changes: 1 addition & 1 deletion src/js/color.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {Ploidy} from './ploidy';
export class Color {

constructor(config) {
// Ideogram config
// Ideogram config
this._config = config;
this._ploidy = new Ploidy(this._config);
}
Expand Down
14 changes: 6 additions & 8 deletions src/js/coordinate-converters.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,9 @@ function convertBpToPx(chr, bp) {
if (chr.bands.length > 1) {
[px, band] = getPx(chr, bp);
if (px !== null) return px;
} else {
if (bp >= 1 && bp <= chr.length) {
px = chr.scale.bp * bp;
return px;
}
} else if (bp >= 1 && bp <= chr.length) {
px = chr.scale.bp * bp;
return px;
}

throwBpToPxError(bp, chr, band);
Expand All @@ -74,7 +72,7 @@ function throwPxToBpError(px, chr, pxStop) {
}

function getBp(iscnStop, iscnStart, px, pxStop, pxStart, band, iscnLength) {
var iscnLength, pxLength, bpLength, pxToIscnScale, iscn, bp;
var pxLength, bpLength, pxToIscnScale, iscn, bp;

iscnLength = iscnStop - iscnStart;
pxLength = pxStop - pxStart;
Expand Down Expand Up @@ -116,7 +114,7 @@ function convertPxToBp(chr, px) {
return bp;
}
}
throwPxToBpError(px, chr, pxStop)
throwPxToBpError(px, chr, pxStop);
}

export {convertBpToPx, convertPxToBp};
export {convertBpToPx, convertPxToBp};
6 changes: 3 additions & 3 deletions src/js/filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ function initCrossFilter() {
facet = ideo.facets[i];
ideo.annotsByFacet[facet] =
ideo.crossfilter.dimension(function(d) {
return d[facet];
});
return d[facet];
});
}

if ('filterSelections' in ideo) {
Expand Down Expand Up @@ -153,4 +153,4 @@ function filterAnnots(selections) {
return counts;
}

export {unpackAnnots, packAnnots, initCrossFilter, filterAnnots}
export {unpackAnnots, packAnnots, initCrossFilter, filterAnnots};
7 changes: 3 additions & 4 deletions src/js/ideogram.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
drawProcessedAnnots, drawSynteny, startHideAnnotTooltipTimeout,
showAnnotTooltip, onWillShowAnnotTooltip, setOriginalTrackIndexes,
afterRawAnnots
} from './annotations/annotations'
} from './annotations/annotations';

import {
esearch, esummary, elink,
Expand Down Expand Up @@ -149,7 +149,7 @@ export default class Ideogram {
this.rotateAndToggleDisplay = rotateAndToggleDisplay;
this.setOverflowScroll = setOverflowScroll;

this.configure(config)
this.configure(config);
}

/**
Expand All @@ -173,7 +173,6 @@ export default class Ideogram {
return value.toLowerCase().replace(' ', '-');
}


/**
* Sorts two chromosome objects by type and name
* - Nuclear chromosomes come before non-nuclear chromosomes.
Expand Down Expand Up @@ -211,4 +210,4 @@ export default class Ideogram {
return -1;
}
}
}
}
4 changes: 2 additions & 2 deletions src/js/lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ function getDataDir() {
if ('src' in script && ideogramInLeaf) {
tmp = script.src.split('//');
protocol = tmp[0];
tmp = '/' + tmp[1].split('/').slice(0,-2).join('/');
tmp = '/' + tmp[1].split('/').slice(0, -2).join('/');
dataDir = protocol + '//' + tmp + '/data/bands/native/';
return dataDir;
}
Expand Down Expand Up @@ -118,7 +118,7 @@ function fetch(url, contentType) {
headers = new Headers();

if (config.accessToken) {
headers = new Headers({'Authorization': 'Bearer ' + config.accessToken});
headers = new Headers({Authorization: 'Bearer ' + config.accessToken});
}

if (contentType === 'text') {
Expand Down
2 changes: 2 additions & 0 deletions src/js/model-adapter.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* eslint-disable no-use-before-define */

export class ModelAdapter {

constructor(model) {
Expand Down
2 changes: 1 addition & 1 deletion src/js/model-no-bands-adapter.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {ModelAdapter} from './model-adapter';
// import {ModelAdapter} from './model-adapter';

// export class ModelNoBandsAdapter extends ModelAdapter {
//
Expand Down
2 changes: 1 addition & 1 deletion src/js/range.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export class Range {
this._data = data;
this.start = data.start;
this.stop = data.stop;
this.length = this.stop - this.start
this.length = this.stop - this.start;
}

getColor(chrIndex) {
Expand Down
4 changes: 2 additions & 2 deletions src/js/services/organisms.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ function getTaxids(callback) {
ideo.config.multiorganism = getIsMultiorganism(taxidInit, ideo);

if ('organism' in ideo.config) {
getTaxidsForOrganismInConfig(taxids, callback, ideo)
getTaxidsForOrganismInConfig(taxids, callback, ideo);
} else {
getTaxidsForOrganismNotInConfig(taxids, taxidInit, callback, ideo);
}
Expand Down Expand Up @@ -241,4 +241,4 @@ function getOrganismFromEutils(callback) {

export {
getTaxids, getOrganismFromEutils
}
};
2 changes: 1 addition & 1 deletion src/js/services/services.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ function parseChloroplastOrPlastid(ideo) {
function parseApicoplast(ideo) {
if (ideo.config.showNonNuclearChromosomes) {
return ['AP', 'apicoplast'];
}
}
return [null, null];
}

Expand Down
2 changes: 1 addition & 1 deletion src/js/version.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
var version = '1.11.0';
export default version;
export default version;

0 comments on commit 0d3aa69

Please sign in to comment.