bc_subset | R Documentation |
A set of functions and operators for subsetting or joining of
BarcodeObj object(s).
The bc_subset
, *
and -
are used to select barcodes or
samples in a BarcodeObj
object.
Two BarcodeObj objects can be joined by +
.
bc_subset(
barcodeObj,
sample = NULL,
barcode = NULL,
black_list = NULL,
is_sample_quoted_exp = FALSE
)
bc_merge(barcodeObj_x, barcodeObj_y)
## S4 method for signature 'BarcodeObj'
bc_subset(
barcodeObj,
sample = NULL,
barcode = NULL,
black_list = NULL,
is_sample_quoted_exp = FALSE
)
## S4 method for signature 'BarcodeObj,BarcodeObj'
bc_merge(barcodeObj_x, barcodeObj_y)
## S3 method for class 'BarcodeObj'
barcodeObj_x + barcodeObj_y
## S3 method for class 'BarcodeObj'
barcodeObj - black_list
## S3 method for class 'BarcodeObj'
barcodeObj * white_list
barcodeObj |
A BarcodeObj object. |
sample |
A character vector or integer vector or an expression
(expressio not applicable for |
barcode |
A vector of integer or string, indicating the selected barcode. |
black_list |
A character vector, specifying the black list with excluded barcodes. |
is_sample_quoted_exp |
A logical value. If TRUE, the expression in
|
barcodeObj_x |
A BarcodeObj object. |
barcodeObj_y |
A BarcodeObj object. |
white_list |
A character vector, giving the barcode white list. |
bc_subset
and []
: Gets samples and barcodes subset from a
BarcodeObj
object.
+
: Combines two BarcodeObj
objects. The metadata
,
cleanBc
and
messyBc
slot in the BarcodeObj objects will be joined.
For the metadata
slot, the sample_name
column, and the
Full outer join (the record in either BarcodeObj object) will be
performed with row names as the key.
The messyBc
and cleanBc
from two objects are combined by rows
for the same sample from two BarcodeObj
objects.
-
: removes barcodes in the black_list.
*
: selects barcodes in the white_list.
A BarcodeObj object.
data(bc_obj)
bc_obj
# Select barcodes
bc_subset(bc_obj, barcode = c("AACCTT", "AACCTT"))
bc_obj[c("AGAG", "AAAG"), ]
# Select samples by metadata
bc_meta(bc_obj)$phenotype <- c("l", "b")
bc_meta(bc_obj)
bc_subset(bc_obj, phenotype == "l")
# Select samples by sample name
bc_obj[, "test1"]
bc_obj[, c("test1", "test2")]
bc_subset(bc_obj, sample = "test1", barcode = c("AACCTT", "AACCTT"))
# Apply barcode blacklist
bc_subset(
bc_obj,
sample = c("test1", "test2"),
barcode = c("AACCTT"))
# Join two samples with different barcode sets
bc_obj["AGAG", "test1"] + bc_obj["AAAG", "test2"]
# Join two samples with overlap barcodes
bc_obj_join <- bc_obj["AGAG", "test1"] + bc_obj["AGAG", "test2"]
bc_obj_join
# The same barcode will be removed after applying bc_cure_depth()
bc_cure_depth(bc_obj_join)
# Remove barcodes
bc_obj
bc_obj - "AAAG"
# Select barcodes in a whitelist
bc_obj
bc_obj * "AAAG"
###
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.