Skip to content

Instantly share code, notes, and snippets.

@millerh1
Created September 11, 2021 00:25
Show Gist options
  • Save millerh1/6631627e25e5a9b67548f223c6eb18c1 to your computer and use it in GitHub Desktop.
Save millerh1/6631627e25e5a9b67548f223c6eb18c1 to your computer and use it in GitHub Desktop.
Info links for Genomics Reports
# Create links in datatabels for gene info modal
createGeneInfoLink <- function(val) {
sprintf(paste0('<a href="https://www.genecards.org/cgi-bin/carddisp.pl?gene=', val ,'" target="_blank" class="tooltip-test" onClick="gene_click(this.id)" title="', val, '">', val, '</a>'))
}
# Create links in datatables for GSEA info from MSIGDB
createGSEAInfoLink <- function(val, valTitle) {
sprintf(paste0('<a href="http://software.broadinstitute.org/gsea/msigdb/cards/', val,'" id="', val ,'" target="_blank" class="tooltip-test" onClick="gsea_click(this.id)" title="', val, '">', valTitle, '</a>'))
}
# Create links in datatables for GEO accessions
createGEOInfoLink <- function(val) {
sprintf(paste0('<a href="https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=', val ,'" target="_blank" class="tooltip-test" onClick="gene_click(this.id)" title="', val, '">', val, '</a>'))
}
# Create links in datatables for SRA accessions
createSRAInfoLink <- function(val) {
sprintf(paste0('<a href="https://www.ncbi.nlm.nih.gov/sra/?term=', val ,'" target="_blank" class="tooltip-test" onClick="gene_click(this.id)" title="', val, '">', val, '</a>'))
}
@millerh1
Copy link
Author

Helper functions for creating various links useful in the presentation of genomics data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment