Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ideogram annotations do not work or behave erractically. #524

Closed
tirohia opened this issue Oct 24, 2020 · 2 comments
Closed

Ideogram annotations do not work or behave erractically. #524

tirohia opened this issue Oct 24, 2020 · 2 comments

Comments

@tirohia
Copy link

tirohia commented Oct 24, 2020

Okay, I thought this was me not being able to figure out how the data was meant to be formatted. It's not though.

Annotation tracks are not being loaded for ideograms, either through a URL, or through a local list of dicts with the specified inputs (name, chr, start, stop) listed in the documentation.
If I load the example provided, using the url for the json in the example code, it works and annotations are loaded, but only for the X and Y chromosome. If I change the specified chromosomes to 1 and 2, the chromosomes display, but annotations do not. If I change only one of the chromosomes, i.e. to ["1","Y"], both chromosomes display, but neither have annotations. There are definitely annotations in the example json file for the specified chromosomes.

Loading annotations from a local file using annotationsPath does not work. I'm not the only person to report this. If I download the example file from the url and restrct the ideogram to the two chromosomes, X and Y, that work when loading from a url, then the chromosomes are displayed, but the annotations are not.

Loading from a list of dicts using the annotations identifier does not work. The documentation suggests that when using this method, one should specify name, chr, start and stop. Creating a list:

annotationList = [{"name":"wibble","chr":1,"start":1,"stop":10000}]

and then calling

  dashbio.Ideogram(
        id='my-dashbio-ideogram',
        annotationsLayout="overlay",
        annotations=annotationList
)

results in the chromosomes being displayed, but again, without annotations. If I switch to annotationsLayout="tracks", again, no annotations are displayed. Switching to annotationsLayout="histogram", annotations are displayed, though if you rotate the chromosome it causes the length of the chromosome to be compressed.

Additionally, it is not possible to have multiple tracks, as suggested by the documentation. Constructing the following annotation List and track list:

annotationsList = [{"name":"wibble","chr":"1","start":100000,"stop":10000001,"color":"#0F0", "track":"1"}, {"name":"wiaabble","chr":"4","start":100000,"stop":300001,"color":"#0F0", "track":"2"}]
trackList = [{"id":"1","name":"bob","color":"#0F0"},{"id":"2","name":"alic","color":"#00F"}]

and then using those in the layout

  dashbio.Ideogram(
        id='my-dashbio-ideogram',
        annotationsLayout="histogram",
        chromosomes=['1', '4'],
        annotationTracks=trackList,
        annotations=annotationsList,
        annotationHeight="1"
    ),

again results in no annotations being displayed.

In addition to annotations displaying in a single track, as best I can understand from the documentation, I should be able to specify multiple tracks with different colours using annotationTracks.

This is using Python 3.6.11 in a new conda.

@pajucon
Copy link

pajucon commented May 18, 2021

I would suggest first copying the example JSONs and hosting it somewhere yourself where you can edit later (try github pages for the easiest path). It is true the Dash ideogram can't yet serve local JSONs. I forget where I found specific info about this but it's related to remote HTTPS requests through flask running locally.

The annotations documentation is incorrect. Supply just a list of lists with your values and omit the dict/keys. Supplying an actual remote json (via https) requires the dicts/lists format you see in the examples.

The documentation for the ideogram.js is not great but the source is there to see the actual implementation. I think a lot of functionality from the source has not been ported to the Dash platform yet.

@HammadTheOne
Copy link
Contributor

Thanks for raising this issue, there's a lot of good feedback here.

One way to import local files for use with the Ideogram is to create an assets folder at the root of your app directory, and store your local datasets there.

Then, we can use annotationsPath=app.get_asset_url('10_virtual_cnvs.json') to set the local annotations path.

With #575, some of these annotation issues are fixed and annotations themselves are more consistent, but there's still a number of documentation updates planned which will make this a little more clear.

@emmeb emmeb closed this as completed Oct 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants