From 2a2aa8a2916e711b3e638decb764fc5dfba37477 Mon Sep 17 00:00:00 2001 From: Eric Weitz Date: Sun, 12 Apr 2020 18:55:31 -0400 Subject: [PATCH 1/9] Add local dog genome, with telocentric centromeres --- data/bands/native/canis-lupus-familiaris.json | 82 +++++++++++++++++++ data/bands/native/felis-catus.json | 43 +++++++++- .../bands/native/canis-lupus-familiaris.json | 1 + src/js/init/organism-metadata.js | 7 ++ src/js/lib.js | 6 +- 5 files changed, 136 insertions(+), 3 deletions(-) create mode 100644 data/bands/native/canis-lupus-familiaris.json create mode 100644 dist/data/bands/native/canis-lupus-familiaris.json diff --git a/data/bands/native/canis-lupus-familiaris.json b/data/bands/native/canis-lupus-familiaris.json new file mode 100644 index 00000000..0cc611cf --- /dev/null +++ b/data/bands/native/canis-lupus-familiaris.json @@ -0,0 +1,82 @@ +{ + "chrBands": [ + "1 p 1 0 1 0 1", + "1 q 1 1 122678785 1 122678785", + "2 p 1 0 1 0 1", + "2 q 1 1 85426708 1 85426708", + "3 p 1 0 1 0 1", + "3 q 1 1 91889043 1 91889043", + "4 p 1 0 1 0 1", + "4 q 1 1 88276631 1 88276631", + "5 p 1 0 1 0 1", + "5 q 1 1 88915250 1 88915250", + "6 p 1 0 1 0 1", + "6 q 1 1 77573801 1 77573801", + "7 p 1 0 1 0 1", + "7 q 1 1 80974532 1 80974532", + "8 p 1 0 1 0 1", + "8 q 1 1 74330416 1 74330416", + "9 p 1 0 1 0 1", + "9 q 1 1 61074082 1 61074082", + "10 p 1 0 1 0 1", + "10 q 1 1 69331447 1 69331447", + "11 p 1 0 1 0 1", + "11 q 1 1 74389097 1 74389097", + "12 p 1 0 1 0 1", + "12 q 1 1 72498081 1 72498081", + "13 p 1 0 1 0 1", + "13 q 1 1 63241923 1 63241923", + "14 p 1 0 1 0 1", + "14 q 1 1 60966679 1 60966679", + "15 p 1 0 1 0 1", + "15 q 1 1 64190966 1 64190966", + "16 p 1 0 1 0 1", + "16 q 1 1 59632846 1 59632846", + "17 p 1 0 1 0 1", + "17 q 1 1 64289059 1 64289059", + "18 p 1 0 1 0 1", + "18 q 1 1 55844845 1 55844845", + "19 p 1 0 1 0 1", + "19 q 1 1 53741614 1 53741614", + "20 p 1 0 1 0 1", + "20 q 1 1 58134056 1 58134056", + "21 p 1 0 1 0 1", + "21 q 1 1 50858623 1 50858623", + "22 p 1 0 1 0 1", + "22 q 1 1 61439934 1 61439934", + "23 p 1 0 1 0 1", + "23 q 1 1 52294480 1 52294480", + "24 p 1 0 1 0 1", + "24 q 1 1 47698779 1 47698779", + "25 p 1 0 1 0 1", + "25 q 1 1 51628933 1 51628933", + "26 p 1 0 1 0 1", + "26 q 1 1 38964690 1 38964690", + "27 p 1 0 1 0 1", + "27 q 1 1 45876710 1 45876710", + "28 p 1 0 1 0 1", + "28 q 1 1 41182112 1 41182112", + "29 p 1 0 1 0 1", + "29 q 1 1 41845238 1 41845238", + "30 p 1 0 1 0 1", + "30 q 1 1 40214260 1 40214260", + "31 p 1 0 1 0 1", + "31 q 1 1 39895921 1 39895921", + "32 p 1 0 1 0 1", + "32 q 1 1 38810281 1 38810281", + "33 p 1 0 1 0 1", + "33 q 1 1 31377067 1 31377067", + "34 p 1 0 1 0 1", + "34 q 1 1 42124431 1 42124431", + "35 p 1 0 1 0 1", + "35 q 1 1 26524999 1 26524999", + "36 p 1 0 1 0 1", + "36 q 1 1 30810995 1 30810995", + "37 p 1 0 1 0 1", + "37 q 1 1 30902991 1 30902991", + "38 p 1 0 1 0 1", + "38 q 1 1 23914537 1 23914537", + "X p 1 0 1 0 1", + "X q 1 1 123869142 1 123869142" + ] +} \ No newline at end of file diff --git a/data/bands/native/felis-catus.json b/data/bands/native/felis-catus.json index 3e89f51a..b5c5dfe7 100644 --- a/data/bands/native/felis-catus.json +++ b/data/bands/native/felis-catus.json @@ -1 +1,42 @@ -{"chrBands": ["A1 p 1 0 3713 0 89880064", "A1 q 1 3714 10000.0 89880064 242100913", "A2 p 1 0 2523 0 61080734", "A2 q 1 2524 7082.655941904689 61080734 171471747", "A3 p 1 0 2142 0 51856977", "A3 q 1 2143 5914.9882264177995 51856977 143202405", "B1 p 1 0 1623 0 39294480", "B1 q 1 1624 8600.25211883443 39294480 208212889", "B2 p 1 0 1246 0 30165856", "B2 q 1 1247 6414.789439476422 30165856 155302638", "B3 p 1 0 1225 0 29663499", "B3 q 1 1226 6185.5119480693575 29663499 149751809", "B4 p 1 0 1851 0 44808485", "B4 q 1 1852 5969.770754230902 44808485 144528695", "C1 p 1 0 4498 0 108907037", "C1 q 1 4499 9202.366865919254 108907037 222790142", "C2 p 1 0 3148 0 76225444", "C2 q 1 3149 6658.097567769189 76225444 161193150", "D1 p 1 0 1371 0 33184684", "D1 q 1 1372 4859.462384596625 33184684 117648028", "D2 p 1 0 860 0 20812855", "D2 q 1 861 3725.16810789557 20812855 90186660", "D3 p 1 0 1313 0 31780724", "D3 q 1 1314 4001.8108481895733 31780724 96884206", "D4 p 1 0 1343 0 32525998", "D4 q 1 1344 3986.835522590532 32525998 96521652", "E1 p 1 0 1068 0 25862966", "E1 q 1 1069 2622.6538435235066 25862966 63494689", "E2 p 1 0 1030 0 24929418", "E2 q 1 1031 2657.5816754561347 24929418 64340295", "E3 p 1 0 753 0 18233305", "E3 q 1 754 1844.2013888646509 18233305 44648284", "F1 p 1 0 41 0 1000001", "F1 q 1 42 2960.0980067349024 1000001 71664243", "F2 p 1 0 41 0 1000001", "F2 q 1 42 3542.012912607232 1000001 85752456", "X p 1 0 2128 0 51521357", "X q 1 2129 5392.669006580739 51521357 130557009"]} \ No newline at end of file +{ + "chrBands": [ + "A1 p 1 0 3713 0 89880064", + "A1 q 1 3714 10000.0 89880064 242100913", + "A2 p 1 0 2523 0 61080734", + "A2 q 1 2524 7082.655941904689 61080734 171471747", + "A3 p 1 0 2142 0 51856977", + "A3 q 1 2143 5914.9882264177995 51856977 143202405", + "B1 p 1 0 1623 0 39294480", + "B1 q 1 1624 8600.25211883443 39294480 208212889", + "B2 p 1 0 1246 0 30165856", + "B2 q 1 1247 6414.789439476422 30165856 155302638", + "B3 p 1 0 1225 0 29663499", + "B3 q 1 1226 6185.5119480693575 29663499 149751809", + "B4 p 1 0 1851 0 44808485", + "B4 q 1 1852 5969.770754230902 44808485 144528695", + "C1 p 1 0 4498 0 108907037", + "C1 q 1 4499 9202.366865919254 108907037 222790142", + "C2 p 1 0 3148 0 76225444", + "C2 q 1 3149 6658.097567769189 76225444 161193150", + "D1 p 1 0 1371 0 33184684", + "D1 q 1 1372 4859.462384596625 33184684 117648028", + "D2 p 1 0 860 0 20812855", + "D2 q 1 861 3725.16810789557 20812855 90186660", + "D3 p 1 0 1313 0 31780724", + "D3 q 1 1314 4001.8108481895733 31780724 96884206", + "D4 p 1 0 1343 0 32525998", + "D4 q 1 1344 3986.835522590532 32525998 96521652", + "E1 p 1 0 1068 0 25862966", + "E1 q 1 1069 2622.6538435235066 25862966 63494689", + "E2 p 1 0 1030 0 24929418", + "E2 q 1 1031 2657.5816754561347 24929418 64340295", + "E3 p 1 0 753 0 18233305", + "E3 q 1 754 1844.2013888646509 18233305 44648284", + "F1 p 1 0 41 0 1000001", + "F1 q 1 42 2960.0980067349024 1000001 71664243", + "F2 p 1 0 41 0 1000001", + "F2 q 1 42 3542.012912607232 1000001 85752456", + "X p 1 0 2128 0 51521357", + "X q 1 2129 5392.669006580739 51521357 130557009" + ] +} \ No newline at end of file diff --git a/dist/data/bands/native/canis-lupus-familiaris.json b/dist/data/bands/native/canis-lupus-familiaris.json new file mode 100644 index 00000000..c7385b0d --- /dev/null +++ b/dist/data/bands/native/canis-lupus-familiaris.json @@ -0,0 +1 @@ +{"chrBands": ["1 p 1 0 1 0 1", "1 q 1 1 122678785 1 122678785","2 p 1 0 1 0 1", "2 q 1 1 85426708 1 85426708","3 p 1 0 1 0 1", "3 q 1 1 91889043 1 91889043","4 p 1 0 1 0 1", "4 q 1 1 88276631 1 88276631","5 p 1 0 1 0 1", "5 q 1 1 88915250 1 88915250","6 p 1 0 1 0 1", "6 q 1 1 77573801 1 77573801","7 p 1 0 1 0 1", "7 q 1 1 80974532 1 80974532","8 p 1 0 1 0 1", "8 q 1 1 74330416 1 74330416","9 p 1 0 1 0 1", "9 q 1 1 61074082 1 61074082","10 p 1 0 1 0 1", "10 q 1 1 69331447 1 69331447","11 p 1 0 1 0 1", "11 q 1 1 74389097 1 74389097","12 p 1 0 1 0 1", "12 q 1 1 72498081 1 72498081","13 p 1 0 1 0 1", "13 q 1 1 63241923 1 63241923","14 p 1 0 1 0 1", "14 q 1 1 60966679 1 60966679","15 p 1 0 1 0 1", "15 q 1 1 64190966 1 64190966","16 p 1 0 1 0 1", "16 q 1 1 59632846 1 59632846","17 p 1 0 1 0 1", "17 q 1 1 64289059 1 64289059","18 p 1 0 1 0 1", "18 q 1 1 55844845 1 55844845","19 p 1 0 1 0 1", "19 q 1 1 53741614 1 53741614","20 p 1 0 1 0 1", "20 q 1 1 58134056 1 58134056","21 p 1 0 1 0 1", "21 q 1 1 50858623 1 50858623","22 p 1 0 1 0 1", "22 q 1 1 61439934 1 61439934","23 p 1 0 1 0 1", "23 q 1 1 52294480 1 52294480","24 p 1 0 1 0 1", "24 q 1 1 47698779 1 47698779","25 p 1 0 1 0 1", "25 q 1 1 51628933 1 51628933","26 p 1 0 1 0 1", "26 q 1 1 38964690 1 38964690","27 p 1 0 1 0 1", "27 q 1 1 45876710 1 45876710","28 p 1 0 1 0 1", "28 q 1 1 41182112 1 41182112","29 p 1 0 1 0 1", "29 q 1 1 41845238 1 41845238","30 p 1 0 1 0 1", "30 q 1 1 40214260 1 40214260","31 p 1 0 1 0 1", "31 q 1 1 39895921 1 39895921","32 p 1 0 1 0 1", "32 q 1 1 38810281 1 38810281","33 p 1 0 1 0 1", "33 q 1 1 31377067 1 31377067","34 p 1 0 1 0 1", "34 q 1 1 42124431 1 42124431","35 p 1 0 1 0 1", "35 q 1 1 26524999 1 26524999","36 p 1 0 1 0 1", "36 q 1 1 30810995 1 30810995","37 p 1 0 1 0 1", "37 q 1 1 30902991 1 30902991","38 p 1 0 1 0 1", "38 q 1 1 23914537 1 23914537","X p 1 0 1 0 1", "X q 1 1 123869142 1 123869142"]} \ No newline at end of file diff --git a/src/js/init/organism-metadata.js b/src/js/init/organism-metadata.js index 5a2dc58e..d994889d 100644 --- a/src/js/init/organism-metadata.js +++ b/src/js/init/organism-metadata.js @@ -177,6 +177,13 @@ var organismMetadata = { assemblies: { default: '' } + }, + 9615: { + commonName: 'Dog', + scientificName: 'Canis lupus familiaris', + assemblies: { + default: '' + } } }; diff --git a/src/js/lib.js b/src/js/lib.js index 82136218..e64204e4 100644 --- a/src/js/lib.js +++ b/src/js/lib.js @@ -174,10 +174,12 @@ function getScientificName(taxid) { } /** -* e.g. "Homo sapiens" -> "homo-sapiens" +* Examples: +* "Homo sapiens" -> "homo-sapiens" +* "Canis lupus familiaris" -> "canis-lupus-familiaris" */ function slug(value) { - return value.toLowerCase().replace(' ', '-'); + return value.toLowerCase().replace(/ /g, '-'); } export { From 8a4789ad1d7834395e44743d5d0c5c93395698d8 Mon Sep 17 00:00:00 2001 From: Eric Weitz Date: Sun, 12 Apr 2020 19:36:11 -0400 Subject: [PATCH 2/9] Fix multi-row layout for many chromosomes, as in dog --- src/js/layouts/small-layout.js | 2 +- src/js/views/draw-chromosomes.js | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/js/layouts/small-layout.js b/src/js/layouts/small-layout.js index 3eb32679..b230d350 100644 --- a/src/js/layouts/small-layout.js +++ b/src/js/layouts/small-layout.js @@ -61,7 +61,7 @@ class SmallLayout extends Layout { var numChrs = this._ideo.config.chromosomes[taxid].length; // Number of chromosomes per row - var chrsPerRow = numChrs / this._config.rows; + var chrsPerRow = Math.ceil(numChrs / this._config.rows); var xOffset; var yOffset; diff --git a/src/js/views/draw-chromosomes.js b/src/js/views/draw-chromosomes.js index 75dd86bd..4169d5c3 100644 --- a/src/js/views/draw-chromosomes.js +++ b/src/js/views/draw-chromosomes.js @@ -126,7 +126,9 @@ function setOverflowScroll() { config.perspective !== 'comparative' && config.geometry !== 'collinear' ) { - ideoWidth = (ideo.numChromosomes + 2) * (config.chrWidth + config.chrMargin + ploidyPad); + ideoWidth = + (ideo.numChromosomes + 2) * + (config.chrWidth + config.chrMargin + ploidyPad); } else { return; // chrOffset = ideoSvg.select('.chromosome').nodes()[0].getBoundingClientRect(); @@ -137,8 +139,8 @@ function setOverflowScroll() { return; } - ideoWidth = Math.round(ideoWidth * ploidy / config.rows); - if (ideo._layout._class === 'SmallLayout') ideoWidth += 40; + ideoWidth = Math.ceil(ideoWidth * ploidy / config.rows); + if (ideo._layout._class === 'SmallLayout') ideoWidth += 100; // Ensures absolutely-positioned elements, e.g. heatmap overlaps, display // properly if ideogram container also has position: absolute From ccd20f44f4641fde570dd2dbbde7efddd153bf05 Mon Sep 17 00:00:00 2001 From: Eric Weitz Date: Sun, 12 Apr 2020 22:44:48 -0400 Subject: [PATCH 3/9] Refine ideogram height for multi-row ideograms --- src/js/layouts/small-layout.js | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/src/js/layouts/small-layout.js b/src/js/layouts/small-layout.js index b230d350..f7d83bb6 100644 --- a/src/js/layouts/small-layout.js +++ b/src/js/layouts/small-layout.js @@ -11,6 +11,13 @@ class SmallLayout extends Layout { left: 36.5, top: 10 }; + + var taxid = this._ideo.getTaxid(this._ideo.config.organism); + + var numChrs = config.chromosomes[taxid].length; + + // Number of chromosomes per row + this.chrsPerRow = Math.ceil(numChrs / config.rows); } // rotateForward(setIndex, chrIndex, chrElement, callback) { @@ -38,8 +45,9 @@ class SmallLayout extends Layout { // } getHeight() { - var chrHeight = this._config.chrHeight; - return this._config.rows * (chrHeight + this.margin.top * 1.5); + var config = this._config; + var chrHeight = config.chrHeight * 1.25; + return this._config.rows * (chrHeight + this.margin.top); } getWidth() { @@ -55,20 +63,11 @@ class SmallLayout extends Layout { } getChromosomeSetTranslate(setIndex) { - var taxid = this._ideo.getTaxid(this._ideo.config.organism); - - // Get first organism chromosomes amount - var numChrs = this._ideo.config.chromosomes[taxid].length; - - // Number of chromosomes per row - var chrsPerRow = Math.ceil(numChrs / this._config.rows); - - var xOffset; - var yOffset; + var xOffset, yOffset; - if (setIndex > chrsPerRow - 1) { - xOffset = this.margin.left + this._config.chrHeight * 1.4; - yOffset = this.getChromosomeSetYTranslate(setIndex - chrsPerRow); + if (setIndex > this.chrsPerRow - 1) { + xOffset = this.margin.left + this._config.chrHeight * 1.3; + yOffset = this.getChromosomeSetYTranslate(setIndex - this.chrsPerRow); } else { xOffset = this.margin.left; yOffset = this.getChromosomeSetYTranslate(setIndex); From 1b21432c4ca60cbf9945d406a4ae0357ad629146 Mon Sep 17 00:00:00 2001 From: Eric Weitz Date: Sun, 12 Apr 2020 22:53:33 -0400 Subject: [PATCH 4/9] Use 50 Mb as dog X centromere position Per Figure 6 in Lindblad-Toh et al., 2005 (PMID: 16341006) --- data/bands/native/canis-lupus-familiaris.json | 4 +- .../bands/native/canis-lupus-familiaris.json | 83 ++++++++++++++++++- 2 files changed, 84 insertions(+), 3 deletions(-) diff --git a/data/bands/native/canis-lupus-familiaris.json b/data/bands/native/canis-lupus-familiaris.json index 0cc611cf..49f9307b 100644 --- a/data/bands/native/canis-lupus-familiaris.json +++ b/data/bands/native/canis-lupus-familiaris.json @@ -76,7 +76,7 @@ "37 q 1 1 30902991 1 30902991", "38 p 1 0 1 0 1", "38 q 1 1 23914537 1 23914537", - "X p 1 0 1 0 1", - "X q 1 1 123869142 1 123869142" + "X p 1 0 1 0 50000000", + "X q 1 50000001 123869142 50000001 123869142" ] } \ No newline at end of file diff --git a/dist/data/bands/native/canis-lupus-familiaris.json b/dist/data/bands/native/canis-lupus-familiaris.json index c7385b0d..49f9307b 100644 --- a/dist/data/bands/native/canis-lupus-familiaris.json +++ b/dist/data/bands/native/canis-lupus-familiaris.json @@ -1 +1,82 @@ -{"chrBands": ["1 p 1 0 1 0 1", "1 q 1 1 122678785 1 122678785","2 p 1 0 1 0 1", "2 q 1 1 85426708 1 85426708","3 p 1 0 1 0 1", "3 q 1 1 91889043 1 91889043","4 p 1 0 1 0 1", "4 q 1 1 88276631 1 88276631","5 p 1 0 1 0 1", "5 q 1 1 88915250 1 88915250","6 p 1 0 1 0 1", "6 q 1 1 77573801 1 77573801","7 p 1 0 1 0 1", "7 q 1 1 80974532 1 80974532","8 p 1 0 1 0 1", "8 q 1 1 74330416 1 74330416","9 p 1 0 1 0 1", "9 q 1 1 61074082 1 61074082","10 p 1 0 1 0 1", "10 q 1 1 69331447 1 69331447","11 p 1 0 1 0 1", "11 q 1 1 74389097 1 74389097","12 p 1 0 1 0 1", "12 q 1 1 72498081 1 72498081","13 p 1 0 1 0 1", "13 q 1 1 63241923 1 63241923","14 p 1 0 1 0 1", "14 q 1 1 60966679 1 60966679","15 p 1 0 1 0 1", "15 q 1 1 64190966 1 64190966","16 p 1 0 1 0 1", "16 q 1 1 59632846 1 59632846","17 p 1 0 1 0 1", "17 q 1 1 64289059 1 64289059","18 p 1 0 1 0 1", "18 q 1 1 55844845 1 55844845","19 p 1 0 1 0 1", "19 q 1 1 53741614 1 53741614","20 p 1 0 1 0 1", "20 q 1 1 58134056 1 58134056","21 p 1 0 1 0 1", "21 q 1 1 50858623 1 50858623","22 p 1 0 1 0 1", "22 q 1 1 61439934 1 61439934","23 p 1 0 1 0 1", "23 q 1 1 52294480 1 52294480","24 p 1 0 1 0 1", "24 q 1 1 47698779 1 47698779","25 p 1 0 1 0 1", "25 q 1 1 51628933 1 51628933","26 p 1 0 1 0 1", "26 q 1 1 38964690 1 38964690","27 p 1 0 1 0 1", "27 q 1 1 45876710 1 45876710","28 p 1 0 1 0 1", "28 q 1 1 41182112 1 41182112","29 p 1 0 1 0 1", "29 q 1 1 41845238 1 41845238","30 p 1 0 1 0 1", "30 q 1 1 40214260 1 40214260","31 p 1 0 1 0 1", "31 q 1 1 39895921 1 39895921","32 p 1 0 1 0 1", "32 q 1 1 38810281 1 38810281","33 p 1 0 1 0 1", "33 q 1 1 31377067 1 31377067","34 p 1 0 1 0 1", "34 q 1 1 42124431 1 42124431","35 p 1 0 1 0 1", "35 q 1 1 26524999 1 26524999","36 p 1 0 1 0 1", "36 q 1 1 30810995 1 30810995","37 p 1 0 1 0 1", "37 q 1 1 30902991 1 30902991","38 p 1 0 1 0 1", "38 q 1 1 23914537 1 23914537","X p 1 0 1 0 1", "X q 1 1 123869142 1 123869142"]} \ No newline at end of file +{ + "chrBands": [ + "1 p 1 0 1 0 1", + "1 q 1 1 122678785 1 122678785", + "2 p 1 0 1 0 1", + "2 q 1 1 85426708 1 85426708", + "3 p 1 0 1 0 1", + "3 q 1 1 91889043 1 91889043", + "4 p 1 0 1 0 1", + "4 q 1 1 88276631 1 88276631", + "5 p 1 0 1 0 1", + "5 q 1 1 88915250 1 88915250", + "6 p 1 0 1 0 1", + "6 q 1 1 77573801 1 77573801", + "7 p 1 0 1 0 1", + "7 q 1 1 80974532 1 80974532", + "8 p 1 0 1 0 1", + "8 q 1 1 74330416 1 74330416", + "9 p 1 0 1 0 1", + "9 q 1 1 61074082 1 61074082", + "10 p 1 0 1 0 1", + "10 q 1 1 69331447 1 69331447", + "11 p 1 0 1 0 1", + "11 q 1 1 74389097 1 74389097", + "12 p 1 0 1 0 1", + "12 q 1 1 72498081 1 72498081", + "13 p 1 0 1 0 1", + "13 q 1 1 63241923 1 63241923", + "14 p 1 0 1 0 1", + "14 q 1 1 60966679 1 60966679", + "15 p 1 0 1 0 1", + "15 q 1 1 64190966 1 64190966", + "16 p 1 0 1 0 1", + "16 q 1 1 59632846 1 59632846", + "17 p 1 0 1 0 1", + "17 q 1 1 64289059 1 64289059", + "18 p 1 0 1 0 1", + "18 q 1 1 55844845 1 55844845", + "19 p 1 0 1 0 1", + "19 q 1 1 53741614 1 53741614", + "20 p 1 0 1 0 1", + "20 q 1 1 58134056 1 58134056", + "21 p 1 0 1 0 1", + "21 q 1 1 50858623 1 50858623", + "22 p 1 0 1 0 1", + "22 q 1 1 61439934 1 61439934", + "23 p 1 0 1 0 1", + "23 q 1 1 52294480 1 52294480", + "24 p 1 0 1 0 1", + "24 q 1 1 47698779 1 47698779", + "25 p 1 0 1 0 1", + "25 q 1 1 51628933 1 51628933", + "26 p 1 0 1 0 1", + "26 q 1 1 38964690 1 38964690", + "27 p 1 0 1 0 1", + "27 q 1 1 45876710 1 45876710", + "28 p 1 0 1 0 1", + "28 q 1 1 41182112 1 41182112", + "29 p 1 0 1 0 1", + "29 q 1 1 41845238 1 41845238", + "30 p 1 0 1 0 1", + "30 q 1 1 40214260 1 40214260", + "31 p 1 0 1 0 1", + "31 q 1 1 39895921 1 39895921", + "32 p 1 0 1 0 1", + "32 q 1 1 38810281 1 38810281", + "33 p 1 0 1 0 1", + "33 q 1 1 31377067 1 31377067", + "34 p 1 0 1 0 1", + "34 q 1 1 42124431 1 42124431", + "35 p 1 0 1 0 1", + "35 q 1 1 26524999 1 26524999", + "36 p 1 0 1 0 1", + "36 q 1 1 30810995 1 30810995", + "37 p 1 0 1 0 1", + "37 q 1 1 30902991 1 30902991", + "38 p 1 0 1 0 1", + "38 q 1 1 23914537 1 23914537", + "X p 1 0 1 0 50000000", + "X q 1 50000001 123869142 50000001 123869142" + ] +} \ No newline at end of file From 1e59864f19804857a5d9269d7e8df9f741f3bdf5 Mon Sep 17 00:00:00 2001 From: Eric Weitz Date: Sun, 12 Apr 2020 23:16:56 -0400 Subject: [PATCH 5/9] Add dog chromosome Y, per Li et al. 2013 (PMID: 23788650) --- data/bands/native/canis-lupus-familiaris.json | 4 +++- dist/data/bands/native/canis-lupus-familiaris.json | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/data/bands/native/canis-lupus-familiaris.json b/data/bands/native/canis-lupus-familiaris.json index 49f9307b..ea83913b 100644 --- a/data/bands/native/canis-lupus-familiaris.json +++ b/data/bands/native/canis-lupus-familiaris.json @@ -77,6 +77,8 @@ "38 p 1 0 1 0 1", "38 q 1 1 23914537 1 23914537", "X p 1 0 1 0 50000000", - "X q 1 50000001 123869142 50000001 123869142" + "X q 1 50000001 123869142 50000001 123869142", + "Y p 1 0 1 0 10000000", + "Y q 1 10000001 20000000 10000001 20000000" ] } \ No newline at end of file diff --git a/dist/data/bands/native/canis-lupus-familiaris.json b/dist/data/bands/native/canis-lupus-familiaris.json index 49f9307b..ea83913b 100644 --- a/dist/data/bands/native/canis-lupus-familiaris.json +++ b/dist/data/bands/native/canis-lupus-familiaris.json @@ -77,6 +77,8 @@ "38 p 1 0 1 0 1", "38 q 1 1 23914537 1 23914537", "X p 1 0 1 0 50000000", - "X q 1 50000001 123869142 50000001 123869142" + "X q 1 50000001 123869142 50000001 123869142", + "Y p 1 0 1 0 10000000", + "Y q 1 10000001 20000000 10000001 20000000" ] } \ No newline at end of file From f1939aec9c946c2939921db7f8a515617f832e8a Mon Sep 17 00:00:00 2001 From: Eric Weitz Date: Mon, 13 Apr 2020 21:49:09 -0400 Subject: [PATCH 6/9] Draft refined getHeight for SmallLayout --- src/js/layouts/small-layout.js | 48 +++++++++++++++++++++++++++++++++- 1 file changed, 47 insertions(+), 1 deletion(-) diff --git a/src/js/layouts/small-layout.js b/src/js/layouts/small-layout.js index f7d83bb6..cac12a22 100644 --- a/src/js/layouts/small-layout.js +++ b/src/js/layouts/small-layout.js @@ -14,7 +14,8 @@ class SmallLayout extends Layout { var taxid = this._ideo.getTaxid(this._ideo.config.organism); - var numChrs = config.chromosomes[taxid].length; + this.chrs = ideo.chromosomes[taxid]; + var numChrs = Object.entries(this.chrs).length; // Number of chromosomes per row this.chrsPerRow = Math.ceil(numChrs / config.rows); @@ -44,12 +45,57 @@ class SmallLayout extends Layout { // .on('end', callback); // } + /** + * eweitz 2020-04-13: + * This height metric is crude because it is calculated before + * the height ("width") of each chromosome is calculated. + * + * It calculates height by multiplying the max height of all chromosomes + * (specified in the Ideogram configuration object) by the number of rows. + * This ensures the ideogram height doesn't truncate in cases like dog + * (where chrX on the second row is longer than chr1 on the first), but it + * often leaves too much space on the second row, e.g. for human. + * + * Ideally, ideogram height would be cumulative height per row, plus top + * margin. This would require calling getHeight _after_ all chromosomes + * have had their height (technically, chr.width) assigned. See draft new + * getHeight method below this getHeight method. + */ getHeight() { var config = this._config; var chrHeight = config.chrHeight * 1.25; return this._config.rows * (chrHeight + this.margin.top); } + /** + * eweitz 2020-04-13: + * Draft refinement of getHeight. See note in classic version above. + * + * Total height is cumulative height per row, plus top margin + */ + // getHeight() { + // let height = 0; + // const rows = this._config.rows; + // const chrEntries = Object.entries(this.chrs); + + // for (let i = 0; i < rows; i++) { + // let rowHeight = 0; + // // Starting and ending indexes of chromosomes of this row + // const startIndex = this.chrsPerRow * i; + // const endIndex = this.chrsPerRow * (i + 1) - 1; + + // for (let j = startIndex; j < endIndex; j++) { + // const thisChrHeight = chrEntries[j][1].width; + // if (thisChrHeight > rowHeight) { + // rowHeight = thisChrHeight; + // } + // } + // height += rowHeight + this.margin.top; + // } + + // return height; + // } + getWidth() { return '97%'; } From 4c11fb7fdb331184a33273b67c79b5646320bd8e Mon Sep 17 00:00:00 2001 From: Eric Weitz Date: Mon, 13 Apr 2020 21:58:36 -0400 Subject: [PATCH 7/9] Restore default to OrthoDB; it is back up --- examples/vanilla/orthologs.html | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/vanilla/orthologs.html b/examples/vanilla/orthologs.html index 5bd4cfe9..fd9ba3cb 100644 --- a/examples/vanilla/orthologs.html +++ b/examples/vanilla/orthologs.html @@ -35,8 +35,8 @@

Orthologs | Ideogram