Transforms BarcodeObj object into data.frame, data.table or matrix.

bc_2df(barcodeObj)

bc_2dt(barcodeObj)

bc_2matrix(barcodeObj)

# S4 method for BarcodeObj
bc_2df(barcodeObj)

# S4 method for BarcodeObj
bc_2dt(barcodeObj)

# S4 method for BarcodeObj
bc_2matrix(barcodeObj)

Arguments

barcodeObj

A BarcodeObj object.

Value

A data.frame, with two columns: barcode_seq and count.

Examples

data(bc_obj)

bc_obj <- bc_cure_depth(bc_obj)
#> ------------
#> bc_cure_depth: isUpdate is TRUE, update the cleanBc.
#> ------------

# BarcodeObj to data.frame
bc_2df(bc_obj)
#>   sample_name barcode_seq count
#> 1       test1        AGAG   104
#> 2       test1        AAAG    50
#> 3       test1       AGAAG    14
#> 4       test1       ACAAG     6
#> 5       test2        AACG    30
#> 6       test2        AGAG    53
#> 7       test2        AAAG    20
#> 8       test2       ACAAG     6
#> 9       test2       AGAAG     5

# BarcodeObj to data.table
bc_2dt(bc_obj)
#>    sample_name barcode_seq count
#> 1:       test1        AGAG   104
#> 2:       test1        AAAG    50
#> 3:       test1       AGAAG    14
#> 4:       test1       ACAAG     6
#> 5:       test2        AACG    30
#> 6:       test2        AGAG    53
#> 7:       test2        AAAG    20
#> 8:       test2       ACAAG     6
#> 9:       test2       AGAAG     5

# BarcodeObj to matrix
bc_2matrix(bc_obj)
#>       test1 test2
#> AAAG     50    20
#> AACG      0    30
#> ACAAG     6     6
#> AGAAG    14     5
#> AGAG    104    53

###