buildCNR | R Documentation |
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.
buildCNR(
X,
Y,
qc,
chromInfo,
exprs = NULL,
gene.index,
bulk = FALSE,
full.sync = TRUE,
chromosome.order = c(1:22, "X", "Y", "MT"),
...
)
X |
bin or common segment copy number data. Can be in 'numeric'
or integer form. By default it will be rounded by |
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 |
full.sync |
sync cnr tables to preseve cell order, and sort chromInfo and gene.index based on chromsome and start position |
chromosome.order |
chromosome order. Default is a human genome primary assembly: 1:22, X, Y, and MT. |
... |
parameters passed to roundCNR |
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.
## Example Data
## Copy Number Matrix
data(copynumbers)
## phenotype data
data(pheno)
## Chromosome Information available in Baslan et al. 2012
data(chromInfo)
## gene index see getting started vignette
data(grch37.genes.5k)
cnr <- buildCNR(X = copynumbers, Y = pheno, qc = qc, exprs = NULL,
chromInfo = chromInfo, gene.index = grch37.genes.5k)
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.