feature-link-functions: Transform a column in feature table to web link for that...

.empty_link_functionR Documentation

Transform a column in feature table to web link for that feature.

Description

When listing features in an interactive table, it's often useful to link the feature to an external webpage that has more information about that feature. We include a series of functions to link entrez or ensembl id's to different web pages. The data.frame needs to have a 'feature_id' column which will be used to link out to the reference page.

If 'link.col' is not found in the data.frame 'x' then the provided functions are NO-OPS, ie. the same data.frame is simply returned.

Usage

.empty_link_function(x, link.col = NULL)

ncbi.entrez.link(x, link.col = "symbol")

genecards.entrez.link(x, link.col = "symbol")

Arguments

x

a data.frame from 'SparrowResult'

link.col

the column in 'x' that should be transformed to a link

Details

These were implemented a while ago when our world focused on entrez id's, we need to update.

Value

a modified 'x' with an html link in 'link.col'.

Functions

  • ncbi.entrez.link: links gene to ncbi web site by entrez id.

  • genecards.entrez.link: links a gene row to the genecards website by entrez id

Examples

sr <- sparrow::exampleSparrowResult()
lfc <- sparrow::logFC(sr)
# the symbol column in `lfhc` will be a linked to the entrez web page for
# each gene
linked <- ncbi.entrez.link(lfc, link.col = "symbol")
head(linked[["symbol"]])

lianos/sparrow.shiny documentation built on Oct. 12, 2023, 2:43 a.m.