Loading, manipulating, and analyzing coordinate data.
Loading, manipulating, and analyzing coordinate data.
root_path
A path to a directory containing coordinate files.
single_len
Single case length e.g. damage length. Default is NULL.
is_strand_sensitive
Coordinate strand polarity. Default is TRUE.
merge_replicate
Merge coordinate from different replicates. Default is TRUE.
rm_dup
Remove duplicate entry in the coordinate table. Default is TRUE.
add_col_rep
If add_col_rep is TRUE, column replicate is added to the coordinate table. Default is TRUE.
paths
Individual coordinate files.
rep_names
Replicate names determined from coordinate subdirectory.
chr_names
Chromosome names determined from filenames.
coor
Chromosome-named list of coordinate data.table.
is_kmer
A data.table of is_kmer status. The first column is original is_kmer status.
k
K-mer size when is_kmer is TRUE. When is_kmer is FALSE, k is NA.
ori_first_index
Original chromosome-separated table first index is either starting from zero or one.
load_limit
Maximum coordinate table loaded.
new()
Create a new Coordinate class
Coordinate$new(
root.path,
single.len,
is.strand.sensitive,
merge.replicate,
rm.dup,
add.col.rep,
is.kmer,
k,
ori.first.index,
load.limit
)
root.path
A path to a directory containing either: (1) chromosome-separated coordinate files (assume replicates for subdirectories) OR (2) bedfile. (assume replicates for bedfiles)
single.len
Single case length e.g. damage length. Default is NULL
is.strand.sensitive
A boolean whether strand polarity matters. Default is TRUE.
merge.replicate
Merge coordinate from different replicates. Default is TRUE. If not merging, duplicates will give weight to the kmer counting. If add_col_rep, merged coordinate will contain column replicate e.g. "rep1&rep2".
rm.dup
Remove duplicates in each replicate. Default is FALSE Default is FALSE
add.col.rep
Add column replicate to coordinate table.
is.kmer
Is the coordinate refers to k-mer i.e. expanded case? Default is FALSE.
k
Length of k-mer if is_kmer is TRUE.
ori.first.index
Zero- or one-based index. Default is 1.
load.limit
Maximum coordinate data.table loaded. Default is 1.
A new Coordinate
object.
[()
Calling coordinate table by loading on demand. Maximum load is determine by load_limit field.
Coordinate$[(
chr.name,
state = "current",
k,
reload = FALSE,
rm.other.cols = TRUE
)
chr.name
Chromosome name. It can be a vector of chromosomes.
state
Coordinate state: "current", "case", "kmer". The coordinate state is changed automatically on demand. Default is "current".
k
K-mer size. If state is "kmer", k is needed to expand the coordinate.
reload
Reload the coordinate table from the root.path. Default is TRUE.
rm.other.cols
Remove unnecessary columns for kmeRtone operation.
A single or list of data.table coordinate of requested chromosome.
mark_overlap()
Mark overlapping regions in the coordinate table. A column name is_overlap is added.
Coordinate$mark_overlap()
chr.names
Chromosome names
New column is_overlap is added.
Message of Coordinate
object parameters.
map_sequence()
Get corresponding sequence from the loaded coordinate.
Coordinate$map_sequence(genome)
genome
Genome object or vector of named chromosome sequences.
New column seq.
clone()
The objects of this class are cloneable with this method.
Coordinate$clone(deep = FALSE)
deep
Whether to make a deep clone.