eweitz / ideogram

Chromosome visualization for the web
https://eweitz.github.io/ideogram
Other
294 stars 71 forks source link

Annotations on diploid / triploid chromosomes #277

Open MarilyneSummo opened 3 years ago

MarilyneSummo commented 3 years ago

Hi Eric,

I'm trying to display an annotation track on diploid / triploid genomes but I'm having a problem.

The chromosome number seems misinterpreted. For example the annotation of the chromosome 2 appear on the 2nd chromosome displayed by ideogram, which is in reality the 2nd copy of the chromosome 1.

Capture d’écran 2021-08-05 à 14 02 36

I thought of multiplying the number of chromosomes by 2 for the diploid / by 3 for the triploid etc...

from :
{
        "name": "gene",
        "chr": "5",
        "start": 40489525,
        "stop": 40493890,
    },

to :
{
        "name": "gene",
        "chr": "10",
        "start": 40489525,
        "stop": 40493890,
    },

but that generates an error like below, because the chromosomes number does not correspond to the length anymore.

coordinate-converters.js:13 Uncaught (in promise) Error: Base pair out of range.  bp: 40489525; length of chr10: 37674811
    at coordinate-converters.js:13
    at dc.Ls [as convertBpToPx] (coordinate-converters.js:64)
    at Fa (process.js:158)
    at process.js:197
    at dc.Oa [as processAnnotData] (process.js:245)
    at dc.pa [as drawAnnots] (draw.js:64)
    at dc.ri [as finishInit] (finish-init.js:103)
    at dc.fi [as writeContainer] (write-container.js:113)
    at init.js:234

Is there any way to specify the chromosome more precisely? For example like in the range-set table? ploidy: [0, 1, 0]

eweitz commented 3 years ago

Hi Marilyne, thanks for this great use case. Annotations on polyploid chromosomes would be awesome, and I've had them in my mental backlog for a long time.

Unfortunately they're not supported yet. I would happily review a PR for this!