igvteam/igv.js

Inquiry About Highlighting SNPs in IGV.js

yrjia1015 opened this issue · 16 comments

Dear IGV.js Development Team,

I hope this message finds you well. I am currently utilizing the IGV.js tool and am particularly interested in replicating a feature similar to what is observed in the GTEx IGV, where specific SNPs influencing a gene are highlighted in red upon searching for that gene.

IGV

Could you kindly guide me on how to implement this functionality in IGV.js? Are there any tutorials, documentation, or code samples available that could assist in achieving this feature? My goal is to enhance the visual representation of gene-SNP relationships directly within the IGV.js viewer.

Thank you for any help or direction you can provide. I look forward to your valuable guidance.

GTEx uses igv.js, so this should be possible. The documentation is the code, my suggestion would be to start with the EQTL track and search for the string "gtex" throughout the code base. The functionality you mention is specific to gtex.

Leave the issue open, when I can find time I will look at generalizing this functionality. I have other priorities at the moment.

Thank you for your previous response and guidance regarding the use of igv.js for GTEx. I have been exploring the EQTL track functionality as you suggested but have encountered some challenges. Specifically, after changing the track type to "eqtl," the data does not display correctly.
Unfortunately, I was unable to find relevant tutorials or documentation for the eQTL track in the official igv.js resources. Could you kindly provide an example or further guidance on how to properly utilize the eQTL track? This would be incredibly helpful for our implementation.

Sorry I'm not able to do that, but if you would like to open an issue as a feature request for this functionality please feel free to do so. I would need a good description of what you are trying to achieve, as well as a test data case.

Thank you for your response. We appreciate your suggestion to open an issue as a feature request. We have already sent test data and a detailed description of our needs via email to igv-team@broadinstitute.org. If possible, please consider this feature request for future updates. Thank you!

From private email

Request: Would it be possible to create an xQTL track based on the GWAS track format that includes five columns: CHR, SNP, BP, Phenotype, and P? This track should allow searching and highlighting data points where the Phenotype column matches specified values. We believe this functionality would greatly enhance our ability to analyze various xQTLs directly within IGV.

Thank you for considering our request.

Hi, I'm working on this now. Is this format a recognized standard in the field for xQTL data? If not is there a recognized standard? We do not need to use the gwas format if there is a better one.

CHR	SNP	BP	P	Phenotype
10	rs146165798	50023438	0.000106	A1CF
10	rs1937725	51879303	0.000485	A1CF

If find a somewhat different format from this resource https://www.ncbi.nlm.nih.gov/pmc/articles/PMC5785926/

sID,chr,pos,A1,A2,ENSG,geneSym,TSS,beta,se,t,p
rs376835509,10,65030,C,A,ENSG00000015171,ZMYND11,180405,1.64981083e-02,7.19706854e-03,2.29233725e+00,2.22757220e-02

The "Phenotype" field is problematic. For eQTL data we can associate the locus with a gene, as we do for gtex. But there is no way to know from the data in this file if these are gene names. In the hQTL file, for example, it contains the following

H3K27ac(chr10:100005048-100011461)

I am guessing this means that this feature is associated with H3K27ac at the location in the parentheses, but there really isn't much igv.js can do with this information. What were you hoping to implement here?

Thank you very much for considering this request. Your understanding is correct: in eQTL data, the "Phenotype" typically correlates with specific genes, akin to what you do with the gtex project. However, for other types of xQTL data such as mQTL and hQTL, the "Phenotype" might refer to specific molecular phenotypes affected by SNPs, not just gene names. For instance, mQTLs often relate to changes in DNA methylation patterns, while hQTLs involve specific histone modifications like the H3K27ac mentioned in the file.

In this context, I am hoping to implement a feature in IGV that allows users to search for a specific phenotype (e.g., "H3K27ac(chr10:100005048-100011461)") to highlight and navigate to the corresponding genomic region. This would greatly enhance IGV’s capability, especially in handling and displaying complex xQTL data, providing more direct and detailed biological insights.

Therefore, I would like to inquire if it's possible to add support for the "Phenotype" field in IGV's search functionality, allowing matches based on the values in the Phenotype column to be highlighted. This way, users could quickly locate relevant genomic areas directly through phenotype information.

For this to work we are going to need a track for the "phenotype", when it is not a gene. We already have a track for genes. So, for example, you might load a BED file track for the histone modifications with entries like this

chr10 100005047 100011461 H3K27ac(chr10:100005048-100011461)

This would enable users to search by the phenotype name. We could generalize the GTEX portal behavior to highlight the phenotype feature and associated xQTLs as GTEX does for genes.

Thank you very much for considering this request. I will create several sample xQTL test files and then send them to igv-team@broadinstitute.org

@yrjia1015 I am making progress on this, I don't need any additional data at this time.

Hi,

Thank you for reaching out.
The data we have shared with you (B.cell_eQTL.tsv and Monocyte_hQTL.tsv) is not considered sensitive. We appreciate your efforts in creating public examples for this feature.

This is now supported, I used the files you provided. There is an example here

Also from the igv.org test app. https://tinyurl.com/22t9mzrp

To highlight eqtls or phenotypes you search from the track gear menu, rather than the top level locus/search box as you do at GTEx. Also, it is assumed you are zoomed into the general region of interest. To see how it works try searching for the following from the "Search for..." menu item from the B Cell eqtl track

  • rs5751764
  • SMARCB1

You can also right-click on an eqtl and select "highlight associated features". If any tracks are loaded containing the phenotype features they will be highlighted. For an eQTL this is often the gene track. For other types you will need to load a track with the phenotypes if you want to see them. I created a track for the histone peaks from your file to illustrate.

More info will follow on the file format but the files you used will work. You can tabix-index them if you wish, as I did for the examples.

            {
                type: "qtl",
                format: "qtl",
                name: "B cell eQTL",
                url: "https://igv-genepattern-org.s3.amazonaws.com/test/qtl/B.cell_eQTL.tsv.gz",
                indexURL: "https://igv-genepattern-org.s3.amazonaws.com/test/qtl/B.cell_eQTL.tsv.gz.tbi",
                visibilityWindow: 4000000
            }

Thank you for the detailed instructions and the example on the igv.org test app. The new search and highlight features are particularly useful.
Thank you again for your support and the valuable enhancements you've implemented.