Methods for IterableFragments objects
Usage
# S4 method for class 'IterableFragments'
show(object)
cellNames(x)
cellNames(x, ...) <- value
chrNames(x)
chrNames(x, ...) <- value
Value
cellNames()
Character vector of cell names, or NULL if none are known
chrNames()
: Character vector of chromosome names, or NULL if none are known
Details
cellNames<-
It is only possible to replace names, not add new names.
chrNames<-
It is only possible to replace names, not add new names.
Functions
show(IterableFragments)
: Print IterableFragmentscellNames()
: Get cell namescellNames(x, ...) <- value
: Set cell nameschrNames()
: Set chromosome nameschrNames(x, ...) <- value
: Set chromosome names
Examples
## Prep data
frags <- tibble::tibble(
chr = paste0("chr", c(rep(1,3), rep(2,3))),
start = seq(10, 260, 50),
end = start + 30,
cell_id = paste0("cell", c(rep(1, 2), rep(2,2), rep(3,2)))
)
frags
#> # A tibble: 6 × 4
#> chr start end cell_id
#> <chr> <dbl> <dbl> <chr>
#> 1 chr1 10 40 cell1
#> 2 chr1 60 90 cell1
#> 3 chr1 110 140 cell2
#> 4 chr2 160 190 cell2
#> 5 chr2 210 240 cell3
#> 6 chr2 260 290 cell3
frags <- frags %>% convert_to_fragments()
#######################################################################
## show(IterableFragments) example
#######################################################################
show(frags)
#> IterableFragments object of class "UnpackedMemFragments"
#>
#> Cells: 3 cells with names cell1, cell2, cell3
#> Chromosomes: 2 chromosomes with names chr1, chr2
#>
#> Queued Operations:
#> 1. Read uncompressed fragments from memory
#######################################################################
## cellNames(IterableFragments) example
#######################################################################
cellNames(frags)
#> [1] "cell1" "cell2" "cell3"
#######################################################################
## cellNames(IterableFragments)<- example
#######################################################################
cellNames(frags) <- paste0("cell", 5:7)
cellNames(frags)
#> [1] "cell5" "cell6" "cell7"
#######################################################################
## chrNames(IterableFragments) example
#######################################################################
chrNames(frags)
#> [1] "chr1" "chr2"
#######################################################################
## chrNames(IterableFragments)<- example
#######################################################################
chrNames(frags) <- paste0("chr", 5:6)
chrNames(frags)
#> [1] "chr5" "chr6"