buildCNR: Build a CNR bundle (Copy Number, -Rounded)

View source: R/buildCNR.R

buildCNRR Documentation

Build a CNR bundle (Copy Number, –Rounded)

Description

A CNR bundle is a 'list' composed of six matrices of class data.frame (mostly). The objective of the CNR is to keep single-cell data matrices syncronized and facilitate interaction with this data. The functions keepCells, excludeCells, addCells, subsetCNR, manipulate the complete bundle. Whereas addQC, addPheno, and addInfo, as the name implies they add columns to the QC, Y (phenotype), and chromInfo tables.

Usage

buildCNR(X, Y, qc, chromInfo, exprs = NULL, gene.index, bulk = FALSE, ...)

Arguments

X

bin or common segment copy number data. Can be in 'numeric' or integer form. By default it will be rounded by roundCNR.

Y

phenotype and additional cell-level annotation data nrow(Y) needs to equal ncol(X). There is no check for this yet. requires a 'cellID' column

qc

cell-level quality control metadata e.g. readcount, median bins, mapd, qc.status, or any other data that is technical about the cells. requires a 'cellID' column

chromInfo

bin chromosome and end position in base pairs. Needs to match X

exprs

slot for expression same-cell (same-sample) gene expression matrix. Must have cellID as rownames. default is NULL.

gene.index

a GRanges generated matrix to link bins to genes

bulk

logical specifying if data type is ratio from bulk DNA sequencing or integer copy number. If 'TRUE' data is an untransformed segment ratio. If 'FALSE' data is integer copy number

...

parameters passed to roundCNR

Value

A CNR bundle composed of genotype, phenotype, and metadata for a single-cell DNA copy number experiment. See 'getting_started.Rmd' vignette for additional details.

Examples


data(copynumbers)
data(pheno)
data(qc)
data(chromInfo)
data(gene.index)

cnr <- buildCNR(X = copynumbers, Y = pheno, qc = qc, exprs = NULL,
                chromInfo = chromInfo, gene.index = gene.index)

class(cnr)

head(cnr$X[, 1:5])

head(cnr$Y[, 1:5])

head(cnr$genes[, 1:5])

## Not run: 
 saveRDS(cnr, file = "cnr.rds")

## End(Not run)


SingerLab/gac documentation built on March 16, 2023, 2:52 p.m.