A function to turn Gene Symbols into buttons in an Rmarkdown linking to various portals for further info about these genes.
Usage
buttonifier(
df,
create_buttons_to = c("PUBMED", "GC", "UNIPROT"),
col_to_use = "SYMBOL",
output_format = "DT",
ens_col = NULL,
ens_species = NULL
)
Arguments
- df
A dataframe with at least on column with gene Symbols named: SYMBOL
At least one of: "GC", "NCBI", "GTEX", "UNIPROT", "dbPTM", "HPA" "PUBMED"
- col_to_use
name of the columns were the gene symbols are stored. Default is SYMBOL
- output_format
a parameter deciding which output format to return, either a "DT" (
DT::datatable()
, recommended), or a simple dataframe ("DF"). In the latter case it is important that if the data is visualized with theDT::datatable
function the parameter escape must be set to FALSE- ens_col
Character string, name of the columns were the ENSEMBL IDs are stored.
- ens_species
The species you are working with to link to the correct gene on ENSEMBL
Value
A data.frame or a DT::datatable
object with columns adding HTML
objects that link to websites with further information on the genes in
question.
Examples
data(res_de_macrophage, package = "mosdef")
res_de <- res_macrophage_IFNg_vs_naive
res_df <- deresult_to_df(res_de)
## Subsetting for quicker run
res_df <- res_df[1:100, ]
buttonifier(res_df)
buttonifier(res_df,
create_buttons_to = c("NCBI", "HPA"),
ens_col = "id",
ens_species = "Homo_sapiens"
)