get_gene_prediction_scores: get_gene_prediction_scores

View source: R/get_gene_prediction_scores.R

get_gene_prediction_scoresR Documentation

get_gene_prediction_scores

Description

Calculates gene prediction scores by comparing True and Selection k-NN graphs.

Usage

get_gene_prediction_scores(
  sce,
  genes.selection,
  genes.all = rownames(sce),
  batch = NULL,
  n.neigh = 5,
  nPC.all = 50,
  nPC.selection = NULL,
  genes.predict = rownames(sce),
  method = "spearman",
  corr_all.thresh = 0.25,
  gene_stat_all = NULL,
  ...
)

Arguments

sce

SingleCellExperiment object containing gene counts matrix (stored in 'logcounts' assay).

genes.selection

Character vector containing names of selected genes.

genes.all

Character vector containing names of all (potentially relevant/variable) genes.

batch

Name of the field in colData(sce) to specify batch. Default batch=NULL if no batch is applied.

n.neigh

Positive integer > 1, specifying number of neighbors to use for kNN-graph. Default n.neigh=5.

nPC.all

Scalar (or NULL) specifying number of PCs to use for construction of True kNN-graph. Default nPC.all=50.

nPC.selection

Scalar (or NULL) specifying number of PCs to use for construction of Selection kNN-graph. Default nPC.selection=NULL (no PCA). We advise to set it to 50 if length(genes.selection) > 50.

genes.predict

Character vector containing names of genes for which we want to calculate gene prediction score. Default = genes.all.

method

Character specifying method for correlation. Availbale options are c("spearman", "pearson", "kendall"). Default method="spearman".

corr_all.thresh

Scalar specifying suitable threshold for correlation to consider (on True graph).

gene_stat_all

If not NULL (NULL is default), gene_stat_all is pre-calculated stat for True graph. This is useful if this variable will be used re-used multiple times. Use geneBasisR::get_gene_correlation_scores to calculate this.

...

Additional arguments

Value

data.frame, each row corresponds to gene, contains field gene_score = gene prediction score.

Examples

require(SingleCellExperiment)
n_row = 1000
n_col = 100
sce = SingleCellExperiment(assays = list(logcounts = matrix(rnorm(n_row*n_col), ncol=n_col)))
rownames(sce) = as.factor(1:n_row)
colnames(sce) = c(1:n_col)
sce$cell = colnames(sce)
genes.selection = sample(rownames(sce) , 20)
out = get_gene_prediction_scores(sce, genes.selection)


MarioniLab/geneBasisR documentation built on June 30, 2023, 2:04 p.m.