COTAN-Legacy: Handle legacy 'scCOTAN'-class and related symmetric matrix...

COTAN-LegacyR Documentation

Handle legacy scCOTAN-class and related symmetric matrix <-> vector conversions

Description

A class and some functions related to the V1 version of the COTAN package

Usage

vec2mat_rfast(x, genes = "all")

mat2vec_rfast(mat)

Arguments

x

a list formed by two arrays: genes with the unique gene names and values with all the values.

genes

an array with all wanted genes or the string "all". When equal to "all" (the default), it recreates the entire matrix.

mat

a square (possibly symmetric) matrix with all genes as row and column names.

Details

Define the legacy scCOTAN-class

This is a legacy function related to old scCOTAN objects. Use the more appropriate Matrix::dspMatrix type for similar functionality.

mat2vec_rfast converts a compacted symmetric matrix (that is an array) into a symmetric matrix.

This is a legacy function related to old scCOTAN objects. Use the more appropriate Matrix::dspMatrix type for similar functionality.

vec2mat_rfast converts a symmetric matrix into a compacted symmetric matrix. It will forcibly make its argument symmetric.

Value

a scCOTAN object

mat2vec_rfast returns a list formed by two arrays:

  • "genes" with the unique gene names,

  • "values" with all the values.

vec2mat_rfast returns the reconstructed symmetric matrix

Slots

raw

ANY. To store the raw data matrix

raw.norm

ANY. To store the raw data matrix divided for the cell efficiency estimated (nu)

coex

ANY. The coex matrix

nu

vector.

lambda

vector.

a

vector.

hk

vector.

n_cells

numeric.

meta

data.frame.

yes_yes

ANY. Unused and deprecated. Kept for backward compatibility only

clusters

vector.

cluster_data

data.frame.

Examples

v <- list("genes" = paste0("gene_", c(1:9)), "values" = c(1:45))

M <- vec2mat_rfast(v)
all.equal(rownames(M), v[["genes"]])
all.equal(colnames(M), v[["genes"]])

genes <- paste0("gene_", sample.int(ncol(M), 3))

m <- vec2mat_rfast(v, genes)
all.equal(rownames(m), v[["genes"]])
all.equal(colnames(m), genes)

v2 <- mat2vec_rfast(M)
all.equal(v, v2)


seriph78/COTAN documentation built on May 2, 2024, 11:17 a.m.