eweitz / ideogram

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

Request: Brush on multiple chromosomes #84

Open 6br opened 6 years ago

6br commented 6 years ago

Hello, I am grateful to this library!

I would appreciate it if you would add a support for brush on multiple chromosomes since I would like to provide an interface to select the position from multiple chromosomes. My request is below.

And following functions is not a so high priority but convenient for me.

An image is as follows: example

Thank you,

eweitz commented 6 years ago

@6br, thanks for these feature requests. I'll give your proposals a closer look once I'm done expanding support for cytobands (#83), likely within a few weeks.

In the meantime, if you could describe use cases for these potential enhancements, that would help me prioritize my work. I also accept pull requests!

6br commented 6 years ago

@eweitz, thanks for your reply!

My use cases are following.

In this case, annotations mean genes, SNPs or SVs, which is shown on each track. Here, I have already selected some chromosomes by annotations of genes such as related to cancer or metabolic pathway.

  1. The karyotypes of selected chromosomes are shown and they should be aligned in the order of chosen because the order is related to the priority of genomic locus to select, I think.

  2. If I set the genomic coordinate in advance, the brush should have been moved there. The selectedRegion of brush should be consistent with the given coordinate in advance.

I am trying to do so (https://github.com/eweitz/ideogram/compare/master...6br:master), but it does not seem to work well since it does not preserve the exact genomic coordinates.

  1. By selecting one region from multiple chromosomes with a brush, I can narrow down the SNPs and SVs that exist in the region selected. I will use ideogram.selectedRegion to narrow down the external SNPs table.

  2. Moreover, when I click the annotation of SNPs or SVs, details of these variants will be shown. Since I want to fetch what is clicked, it requires callbacks on annotations.

I think from 1 to 3 is the important part because it seems to be tightly coupled with library's implementation.

I would be pleased if it could help your work.

Regards,

eweitz commented 6 years ago

Option to draw brush with the initial position such as brush: "chr:start-stop"

This is implemented in the new v0.15.0 release. See Brush for an example.