diff --git a/src/js/assembly-manifest.js b/src/js/assembly-manifest.js index 271d2d1a..f4671ccc 100644 --- a/src/js/assembly-manifest.js +++ b/src/js/assembly-manifest.js @@ -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']} \ No newline at end of file +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'] +}; diff --git a/src/js/brush.js b/src/js/brush.js index 62a08aea..c10b9ce4 100644 --- a/src/js/brush.js +++ b/src/js/brush.js @@ -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); @@ -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/ @@ -150,4 +149,4 @@ function createBrush(chr, from, to) { writeBrush(chrModel, from, to, xOffset, width, ideo); } -export {onBrushMove, createBrush}; \ No newline at end of file +export {onBrushMove, createBrush}; diff --git a/src/js/collinear-vertical.js b/src/js/collinear-vertical.js index b6a8bf01..4636ba61 100644 --- a/src/js/collinear-vertical.js +++ b/src/js/collinear-vertical.js @@ -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; @@ -83,4 +83,4 @@ // .style('position', 'absolute'); // } -// export default collinearizeVerticalChromosomes; \ No newline at end of file +// export default collinearizeVerticalChromosomes; diff --git a/src/js/collinear.js b/src/js/collinear.js index da87face..ec7116c3 100644 --- a/src/js/collinear.js +++ b/src/js/collinear.js @@ -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) { @@ -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, @@ -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; @@ -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; @@ -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; } @@ -154,4 +155,4 @@ function collinearizeChromosomes(ideo) { .style('position', 'absolute'); } -export default collinearizeChromosomes; \ No newline at end of file +export default collinearizeChromosomes; diff --git a/src/js/color.js b/src/js/color.js index 101bd2ae..d3522bed 100644 --- a/src/js/color.js +++ b/src/js/color.js @@ -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); } diff --git a/src/js/coordinate-converters.js b/src/js/coordinate-converters.js index 20147fa5..62c9142f 100644 --- a/src/js/coordinate-converters.js +++ b/src/js/coordinate-converters.js @@ -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); @@ -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; @@ -116,7 +114,7 @@ function convertPxToBp(chr, px) { return bp; } } - throwPxToBpError(px, chr, pxStop) + throwPxToBpError(px, chr, pxStop); } -export {convertBpToPx, convertPxToBp}; \ No newline at end of file +export {convertBpToPx, convertPxToBp}; diff --git a/src/js/filter.js b/src/js/filter.js index b825e8af..79a164bc 100644 --- a/src/js/filter.js +++ b/src/js/filter.js @@ -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) { @@ -153,4 +153,4 @@ function filterAnnots(selections) { return counts; } -export {unpackAnnots, packAnnots, initCrossFilter, filterAnnots} +export {unpackAnnots, packAnnots, initCrossFilter, filterAnnots}; diff --git a/src/js/ideogram.js b/src/js/ideogram.js index 73ec46d2..c547ecb2 100644 --- a/src/js/ideogram.js +++ b/src/js/ideogram.js @@ -21,7 +21,7 @@ import { drawProcessedAnnots, drawSynteny, startHideAnnotTooltipTimeout, showAnnotTooltip, onWillShowAnnotTooltip, setOriginalTrackIndexes, afterRawAnnots -} from './annotations/annotations' +} from './annotations/annotations'; import { esearch, esummary, elink, @@ -149,7 +149,7 @@ export default class Ideogram { this.rotateAndToggleDisplay = rotateAndToggleDisplay; this.setOverflowScroll = setOverflowScroll; - this.configure(config) + this.configure(config); } /** @@ -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. @@ -211,4 +210,4 @@ export default class Ideogram { return -1; } } -} \ No newline at end of file +} diff --git a/src/js/lib.js b/src/js/lib.js index 9128a80c..7b2c774d 100644 --- a/src/js/lib.js +++ b/src/js/lib.js @@ -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; } @@ -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') { diff --git a/src/js/model-adapter.js b/src/js/model-adapter.js index 70e9f7c4..bc0ed688 100644 --- a/src/js/model-adapter.js +++ b/src/js/model-adapter.js @@ -1,3 +1,5 @@ +/* eslint-disable no-use-before-define */ + export class ModelAdapter { constructor(model) { diff --git a/src/js/model-no-bands-adapter.js b/src/js/model-no-bands-adapter.js index a143b051..54aa32f7 100644 --- a/src/js/model-no-bands-adapter.js +++ b/src/js/model-no-bands-adapter.js @@ -1,4 +1,4 @@ -import {ModelAdapter} from './model-adapter'; +// import {ModelAdapter} from './model-adapter'; // export class ModelNoBandsAdapter extends ModelAdapter { // diff --git a/src/js/range.js b/src/js/range.js index 7bea206b..7c4b5f1d 100644 --- a/src/js/range.js +++ b/src/js/range.js @@ -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) { diff --git a/src/js/services/organisms.js b/src/js/services/organisms.js index 73608492..594df1ea 100644 --- a/src/js/services/organisms.js +++ b/src/js/services/organisms.js @@ -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); } @@ -241,4 +241,4 @@ function getOrganismFromEutils(callback) { export { getTaxids, getOrganismFromEutils -} \ No newline at end of file +}; diff --git a/src/js/services/services.js b/src/js/services/services.js index d6949f5e..4c30ae98 100644 --- a/src/js/services/services.js +++ b/src/js/services/services.js @@ -112,7 +112,7 @@ function parseChloroplastOrPlastid(ideo) { function parseApicoplast(ideo) { if (ideo.config.showNonNuclearChromosomes) { return ['AP', 'apicoplast']; - } + } return [null, null]; } diff --git a/src/js/version.js b/src/js/version.js index c8fa10de..2b80c578 100644 --- a/src/js/version.js +++ b/src/js/version.js @@ -1,2 +1,2 @@ var version = '1.11.0'; -export default version; \ No newline at end of file +export default version;