getGENESYMBOL: Find gene symbols

Description Usage Arguments Details Value Note Author(s) References See Also Examples

View source: R/getGENESYMBOL.R

Description

Takes a vector of probe set identifiers and an annotation table and retrieves the corresponding gene symbols.

Usage

1
getGENESYMBOL(ps, annot, diagnose = FALSE, GScol = 15, noGSsymbol = NA, noGSprovidedSymbol = "---", sep = " /// ")

Arguments

ps

character vector containing the probe sets identifiers.

annot

annotation table (data frame) where each row is a record and each column is an annotation field.

diagnose

logical. If TRUE, 3 (logical) vectors used for diagnostic purpose are returned in addition to the annotation. If FALSE (default) only the annotation is returned.

GScol

column in annotation table containing the gene IDs.

noGSsymbol

character string to be used in output list 'symbols' if no gene symbol is found or provided in the annotation table.

noGSprovidedSymbol

character string used in annotation table and indicating missing gene symbol.

sep

character string used in annotation table to separate multiple gene symbols.

Details

This function can be used with Affymetrix annotation files (e.g. 'HG-U133\_Plus\_2\_annot.csv'). It retrieves the gene symbols corresponding to particular probe set identifiers.

Gene symbols are returned as elements of list 'symbols'. If multiple gene symbols are provided for 'ps[i]' (with 'sep' separating gene symbols in the annotation table), a vector containing all gene symbols is returned as the 'i-th' element of list 'symbols'.

The default values for 'GScol', 'noGSsymbol', 'noGSprovidedSymbol' and 'sep' are chosen to suit the format of Affymetrix annotation files. However, these options can be set to look up any annotation table, provided the probe set identifiers are in the first column and occur only once.

Value

symbols

list of length 'length(ps)' the 'i'-th element of which contains the gene symbol for 'ps[i]'.

empty

logical vector of length 'length(ps)'. 'empty[i]' is TRUE if 'ps[i]' is empty or NA.

noentry

locial vector of length 'length(ps)'. 'noentry[i]' is TRUE if 'ps[i]' cannot be found in the first column of the annotation table.

nogs

locial vector of length 'length(ps)'. 'nogs[i]' is TRUE if 'symbols[i]==noIDprovidedSymbol' is TRUE.

Note

getANNOTATION provides a more flexible solution to be used with arbitrary annotation tables.

Author(s)

Alexandre Kuhn

References

Kuhn et al. Cross-species and cross-platform gene expression studies with the Bioconductor-compliant R package 'annotationTools'. BMC Bioinformatics, 9:26 (2008)

See Also

getANNOTATION

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
##example Affymetrix annotation file and its location
annotationFile<-system.file('extdata','HG-U133_Plus_2_annot_part.csv',package='annotationTools')

##load annotation file
annotation<-read.csv(annotationFile,colClasses='character',comment.char='#')

##get gene symbols
myPS<-c('117_at','1007_s_at','1552288_at',NA,'xyz_at')
getGENESYMBOL(myPS,annotation)

##track origin of annotation failure for the 3 last probe set IDs
getGENESYMBOL(myPS,annotation,diagnose=TRUE)

Example output

Warning: one or more empty probe sets in input
Warning: one or more probe sets not found in annotation
[[1]]
[1] "HSPA6"     "LOC652878"

[[2]]
[1] "DDR1"

[[3]]
[1] NA

[[4]]
[1] NA

[[5]]
[1] NA

Warning message:
In getGENESYMBOL(myPS, annotation) :
  One or more probe sets with no gene symbol provided in annotation
Warning: one or more empty probe sets in input
Warning: one or more probe sets not found in annotation
[[1]]
[[1]][[1]]
[1] "HSPA6"     "LOC652878"

[[1]][[2]]
[1] "DDR1"

[[1]][[3]]
[1] NA

[[1]][[4]]
[1] NA

[[1]][[5]]
[1] NA


[[2]]
[1] FALSE FALSE FALSE  TRUE FALSE

[[3]]
[1] FALSE FALSE FALSE FALSE  TRUE

[[4]]
[1] FALSE FALSE  TRUE FALSE FALSE

Warning message:
In getGENESYMBOL(myPS, annotation, diagnose = TRUE) :
  One or more probe sets with no gene symbol provided in annotation

annotationTools documentation built on Nov. 8, 2020, 6:58 p.m.