checkBatchConsistency {batchelor} | R Documentation |
Utilities to check inputs into batch correction functions.
checkBatchConsistency(batches, cells.in.columns = TRUE) checkSpikeConsistency(batches) checkIfSCE(batches) checkRestrictions(batches, restrictions, cells.in.columns = TRUE)
batches |
A list of batches, usually containing gene expression matrices or SingleCellExperiment objects. |
cells.in.columns |
A logical scalar specifying whether batches contain cells in the columns. |
restrictions |
A list of length equal to |
These functions are intended for internal use and other package developers.
checkBatchConsistency
will check whether the input batches
are consistent with respect to the size of the dimension containing features (i.e., not cells).
It will also verify that the dimension names are consistent, to avoid problems from variable ordering of rows/columns in the inputs.
checkSpikeConsistency
will check whether the spike-in information is consistent across all batches
.
This only works for SingleCellExperiment objects, so one should only run this function if checkIfSCE
returns TRUE
.
checkRestrictions
will check whether restrictions
are consistent with the supplied batches
,
in terms of the length and names of the two lists.
It will also check that each batch contains at least one usable cell after restriction.
checkBatchConsistency
and checkSpikeConsistency
will return an invisible NULL
if there are no errors.
checkIfSCE
will return a logical vector specifying whether each element of batches
is a SingleCellExperiment objects.
checkRestrictions
will return NULL
if restrictions=NULL
.
Otherwise, it will return a list by taking restrictions
and converting each non-NULL
element into an integer subsetting vector.
Aaron Lun
checkBatchConsistency(list(cbind(1:5), cbind(1:5, 2:6))) try( # fails checkBatchConsistency(list(cbind(1:5), cbind(1:4, 2:5))) )