MariaNattestad / dot

Dot: An interactive dot plot viewer for comparative genomics
https://dot.sandbox.bio
MIT License
31 stars 9 forks source link

Two annotation tracks #6

Closed MrTomRod closed 3 years ago

MrTomRod commented 3 years ago

Hi Maria,

I love this tool and am currently incorporating into my software!

I noticed that I can only add one annotations track:

_dot.addAnnotationData({
    key: "0",
    data: [
        {"query": "query_scf1", "query_start": 0, "query_end": 142, "name": "query_gene1", "strand": "+"},
        ...
    ]
})

or:

_dot.addAnnotationData({
    key: "0",
    data: [
        {"ref": "ref_scf1", "ref_start": 0, "ref_end": 236, "name": "ref_gene1", "strand": "+"},
        ...
    ]
})

But if I try to add both, the second command has no apparent effect.

Is this expected behaviour, a bug or am I doing something wrong?

Thanks, MrTomRod

MrTomRod commented 3 years ago

If you're interested, your software is now integrated in my tool:

https://opengenomebrowser.github.io/opengenomebrowser/tutorials/dotplot.html

Example: https://opengenomebrowser.bioinformatics.unibe.ch/dotplot/?ref=FAM19036-p1-1.1&query=FAM19038-p1-1.1

MrTomRod commented 3 years ago

Fixed it: Simply had to change the key of the second track.

_dot.addAnnotationData({
    key: "0",
    data: [
        {"query": "query_scf1", "query_start": 0, "query_end": 142, "name": "query_gene1", "strand": "+"},
        ...
    ]
})

then:

_dot.addAnnotationData({
    key: "1",  // <<<=== this was the problem!
    data: [
        {"ref": "ref_scf1", "ref_start": 0, "ref_end": 236, "name": "ref_gene1", "strand": "+"},
        ...
    ]
})