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

Description Usage Arguments Value Examples

View source: R/buildCNR.R

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

1
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

...

other parameters

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
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 July 22, 2021, 3:27 a.m.