eweitz / ideogram

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

Change annotation info displayed #163

Closed kokyriakidis closed 5 years ago

kokyriakidis commented 5 years ago

Hi! How can I change the annotation info when I hover or click on an annotation shape (triangle etc). I would like it to show more things instead of Gene name and position.

eweitz commented 5 years ago

Use onWillShowAnnotTooltip to change annot.displayName.

See the example in Annotations, external data. Relevant source:

  function hyperlinkGene(annot) {
    var term = '(' + annot.name + '[gene])+AND+(Homo+sapiens[orgn])';
    var url = 'https://ncbi.nlm.nih.gov/gene/?term=' + term;
    annot.displayName =
      '<a target="_blank" href="' + url + '">' + annot.name + '</a>';
    return annot
  }
  var d3 = Ideogram.d3;
  var config = {
    organism: 'human',
    orientation: 'vertical',
    resolution: 550,
    chrHeight: 300,
    annotationHeight: 4,
    onLoad: getAndDrawAcmgGenes,
    onWillShowAnnotTooltip: hyperlinkGene
  };

If more would help, let me know!

kokyriakidis commented 5 years ago

Hi! Thank you for your reply.

Because I am not so familiar with code, is there any way to use as external data variants from a vcf? I want to show each variant from a vcf file with this report

eweitz commented 5 years ago

Ideogram has no direct support for VCF, but if you convert your VCF file to a BED file then you could depict the BED contents as shown in the Annotations, file URL example.

Alternatively, if you could elaborate on what in a VCF file you'd like to see depicted in Ideogram, that might help shape direct handling of VCFs in Ideogram.

kokyriakidis commented 5 years ago

I want to depict variants, produced from a certain interval file in the regions I want, from a vcf file with the ideograms. The best solution is to use as input the bed file with the regions I want and with a script to look out in the vcf for variants in these positions and plot them in ideograms. This could be HUGE. I would like to have the ability to hyperlink them to the PharmGKB database when I move the mouse over AND if possible have hyperlinked legend. I can think of many improments but these are the most important. I do not know if they can be implemented

Στις Πέμ, 8 Αυγ 2019 στις 2:00 μμ ο χρήστης Eric Weitz < notifications@github.com> έγραψε:

Ideogram has no direct support for VCF, but if you convert your VCF file to a BED file then you could depict the BED contents as shown in the Annotations, file URL http://localhost:8080/examples/vanilla/annotations-file-url?asm=GRCh37&annotsUrl=https://raw.githubusercontent.com/NCBI-Hackathons/Scan2CNV/master/files/201113910010_R08C02.PennCnvOut.bed example.

Alternatively, if you could elaborate on what in a VCF file you'd like to see depicted in Ideogram, that might help shape direct handling of VCFs in Ideogram.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/eweitz/ideogram/issues/163?email_source=notifications&email_token=AIBLFXP7BQYREUGHHH7FECDQDP4CRA5CNFSM4IKFJ262YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD33IEZY#issuecomment-519471719, or mute the thread https://github.com/notifications/unsubscribe-auth/AIBLFXIUQG2HYXYQAQIPY7LQDP4CRANCNFSM4IKFJ26Q .

kokyriakidis commented 5 years ago

I want to know if I can add more columns in the bed file and show this information in the legend

Στις Πέμ, 8 Αυγ 2019 στις 2:23 μμ ο χρήστης Konstantinos Kyriakidis < kokyriakidis@gmail.com> έγραψε:

I want to depict variants, produced from a certain interval file in the regions I want, from a vcf file with the ideograms. The best solution is to use as input the bed file with the regions I want and with a script to look out in the vcf for variants in these positions and plot them in ideograms. This could be HUGE. I would like to have the ability to hyperlink them to the PharmGKB database when I move the mouse over AND if possible have hyperlinked legend. I can think of many improments but these are the most important. I do not know if they can be implemented

Στις Πέμ, 8 Αυγ 2019 στις 2:00 μμ ο χρήστης Eric Weitz < notifications@github.com> έγραψε:

Ideogram has no direct support for VCF, but if you convert your VCF file to a BED file then you could depict the BED contents as shown in the Annotations, file URL http://localhost:8080/examples/vanilla/annotations-file-url?asm=GRCh37&annotsUrl=https://raw.githubusercontent.com/NCBI-Hackathons/Scan2CNV/master/files/201113910010_R08C02.PennCnvOut.bed example.

Alternatively, if you could elaborate on what in a VCF file you'd like to see depicted in Ideogram, that might help shape direct handling of VCFs in Ideogram.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/eweitz/ideogram/issues/163?email_source=notifications&email_token=AIBLFXP7BQYREUGHHH7FECDQDP4CRA5CNFSM4IKFJ262YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD33IEZY#issuecomment-519471719, or mute the thread https://github.com/notifications/unsubscribe-auth/AIBLFXIUQG2HYXYQAQIPY7LQDP4CRANCNFSM4IKFJ26Q .

eweitz commented 5 years ago

I want to know if I can add more columns in the bed file and show this information in the legend

No, not trivially, after reviewing bed-parser.js.

The best solution is to use as input the bed file with the regions I want and with a script to look out in the vcf for variants in these positions and plot them in ideograms. This could be HUGE.

How huge, roughly?

I would like to have the ability to hyperlink them to the PharmGKB database when I move the mouse over AND if possible have hyperlinked legend.

If you could provide a small file with example data, that would help.

eweitz commented 5 years ago

I think the original question has been answered. A new GitHub issue would be best for any desired follow-up on the later discussion topics.