createSnapFromGmat: Create a snap object from cell-by-gene matrix

View source: R/snap-utilities.R

createSnapFromGmatR Documentation

Create a snap object from cell-by-gene matrix

Description

This function takes a cell-by-gene count matrix as input and returns a snap object.

Usage

createSnapFromGmat(mat, barcodes, gene.names)

Arguments

mat

A sparse matrix

barcodes

An array of characters for barcodes

gene.names

An array of characters for gene names

Examples

mat = Matrix(sample(0:10, 100, replace=TRUE),sparse=TRUE, ncol=5);
barcodes = paste("barcode", seq(nrow(mat)), sep=".");
gene.names = paste("genes", seq(ncol(mat)), sep=".");
x.sp = createSnapFromGmat(
mat, 
barcodes=barcodes,
gene.names=gene.names
);

r3fang/SnapATAC documentation built on March 29, 2022, 4:33 p.m.