R/get_annotation.R
get_annotation_orgdb.Rd
Get an annotation data frame from org db packages
get_annotation_orgdb(dds, orgdb_species, idtype, key_for_genenames = "SYMBOL")
A DESeqDataSet()
object
Character string, named as the org.XX.eg.db
package which should be available in Bioconductor
Character, the ID type of the genes as in the row names of
dds
, to be used for the call to mapIds()
Character, corresponding to the column name for the
key in the orgDb package containing the official gene name (often called
gene symbol).
This parameter defaults to "SYMBOL", but can be adjusted in case the key is not
found in the annotation package (e.g. for org.Sc.sgd.db
).
A data frame for ready use in pcaExplorer
, retrieved from the
org db packages
library("airway")
data("airway", package = "airway")
airway
#> class: RangedSummarizedExperiment
#> dim: 63677 8
#> metadata(1): ''
#> assays(1): counts
#> rownames(63677): ENSG00000000003 ENSG00000000005 ... ENSG00000273492
#> ENSG00000273493
#> rowData names(10): gene_id gene_name ... seq_coord_system symbol
#> colnames(8): SRR1039508 SRR1039509 ... SRR1039520 SRR1039521
#> colData names(9): SampleName cell ... Sample BioSample
dds_airway <- DESeq2::DESeqDataSetFromMatrix(assay(airway),
colData = colData(airway),
design = ~dex+cell)
anno_df <- get_annotation_orgdb(dds_airway, "org.Hs.eg.db", "ENSEMBL")
#> Loading required package: org.Hs.eg.db
#> Loading required package: AnnotationDbi
#>
#> 'select()' returned 1:many mapping between keys and columns
head(anno_df)
#> gene_id gene_name
#> ENSG00000000003 ENSG00000000003 TSPAN6
#> ENSG00000000005 ENSG00000000005 TNMD
#> ENSG00000000419 ENSG00000000419 DPM1
#> ENSG00000000457 ENSG00000000457 SCYL3
#> ENSG00000000460 ENSG00000000460 FIRRM
#> ENSG00000000938 ENSG00000000938 FGR