convert_geneid: convert the gene ids of a SingleCellExperiment object

Description Usage Arguments Details Value Examples

View source: R/biomart_methods.R

Description

convert the gene ids of a SingleCellExperiment object

Usage

1
convert_geneid(sce, returns = "external_gene_name", all = TRUE)

Arguments

sce

a SingleCellExperiment object

returns

the gene id which is set as return. Default to be 'external_gene_name' A possible list of attributes can be retrieved using the function listAttributes from biomaRt package. The commonly used id types are 'external_gene_name', 'ensembl_gene_id' or 'entrezgene'.

all

logic. For genes that cannot covert to new gene id, keep them with the old id or delete them. The default is keep them.

Details

convert the gene id of all datas in the SingleCellExperiment object

Value

sce with converted id

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# the gene id in example data are `external_gene_name`
# the following example will convert it to `external_gene_name`.
data("sc_sample_data")
data("sc_sample_qc")
sce = SingleCellExperiment(assays = list(counts = as.matrix(sc_sample_data)))
organism(sce) = "mmusculus_gene_ensembl"
gene_id_type(sce) = "ensembl_gene_id"
QC_metrics(sce) = sc_sample_qc
demultiplex_info(sce) = cell_barcode_matching
UMI_dup_info(sce) = UMI_duplication
head(rownames(sce))
sce = convert_geneid(sce, return="external_gene_name")
head(rownames(sce))

scPipe documentation built on Nov. 8, 2020, 8:28 p.m.