[Experimental]

Creates a new GeneSpec object.

gene_spec(genes = NULL, fun = NULL, fun_name = deparse(substitute(fun)))

Arguments

genes

(named character or NULL)
the gene IDs, where the names are used as labels if available.

fun

(function or NULL)
summary function. If NULL is used then multiple genes are not summarized but returned as a matrix from the extract method.

fun_name

(string)
name of the summary function.

Value

A new GeneSpec object.

Examples

gene_spec("GeneID:11185")
#> <GeneSpec>
#>   Public:
#>     clone: function (deep = FALSE) 
#>     extract: function (assay) 
#>     extract_data_frame: function (assay) 
#>     get_gene_labels: function (genes = self$get_genes()) 
#>     get_genes: function () 
#>     get_label: function (genes = self$get_genes()) 
#>     initialize: function (genes = NULL, fun = NULL, fun_name = deparse(substitute(fun))) 
#>     returns_vector: function () 
#>   Private:
#>     fun: NULL
#>     fun_name: NULL
#>     gene_labels: GeneID:11185
#>     genes: GeneID:11185
gene_spec(c("GeneID:11185", "GeneID:10677", "GeneID:101928428"), fun = colMeans)
#> <GeneSpec>
#>   Public:
#>     clone: function (deep = FALSE) 
#>     extract: function (assay) 
#>     extract_data_frame: function (assay) 
#>     get_gene_labels: function (genes = self$get_genes()) 
#>     get_genes: function () 
#>     get_label: function (genes = self$get_genes()) 
#>     initialize: function (genes = NULL, fun = NULL, fun_name = deparse(substitute(fun))) 
#>     returns_vector: function () 
#>   Private:
#>     fun: function (x, na.rm = FALSE, dims = 1, ...) 
#>     fun_name: colMeans
#>     gene_labels: GeneID:11185 GeneID:10677 GeneID:101928428
#>     genes: GeneID:11185 GeneID:10677 GeneID:101928428