library(GSNA)
# These gene symbols correspond to the `Gene Symbol` field from a GEO dataset:
gene_symbols.from <- c( "BNS///CSMH///DDS1///THC8///BKRNS///BRWS1///PS1TP5BP1///ACTB",
"IP3R///IP3R1///ITPR1",
"FOS///p55///AP-1///C-FOS",
"MYC///LMYC///MYCL1///bHLHe38///L-Myc///v-myc"
)
# Extract unique genes from the \code{Bai_gsc.tmod} gene set:
gene_symbols.to <- unique( unlist( tmod2gsc( Bai_gsc.tmod ) ) )
mapped_symbols <- pick_MappedGeneSymbol( .from = gene_symbols.from,
.to = gene_symbols.to )
# mapped_symbols returns: "ACTB", "ITPR1", "FOS", "MYC"
# \donttest{
# This example requires a web-based download of a GEO data set
# and takes > 20 seconds to run on some platforms.
# This function is particularly useful with when mapping
# the \code{`Gene symbol`} field of GEO feature data to
# gene symbols in a GSC:
library(GSNA)
library(GEOquery)
library(tmod)
gset <- getGEO("GSE75203", GSEMatrix =TRUE, AnnotGPL=TRUE)
GSE75203.fdata <- fData(gset$GSE75203_series_matrix.txt.gz)
# We can match the gene gene symbols in GSE75203.fdata with
# those in the provided Bai_gsc.tmod object, and add the
# mapped gene symbol to a new column in GSE75203.fdata,
# 'MappedGeneSymbol':
GSE75203.fdata$MappedGeneSymbol <-
pick_MappedGeneSymbol( .from = GSE75203.fdata$`Gene symbol`,
.to = Bai_gsc.tmod$GENES$ID )
# NOTE, if you were using a tmodGS object, the above
# would be this instead:
# GSE75203.fdata$MappedGeneSymbol <-
# pick_MappedGeneSymbol( .from = GSE75203.fdata$`Gene symbol`,
# .to = Bai_gsc.tmodGS$gv )
# }
Run the code above in your browser using DataLab