Loading, manipulating, and analyzing coordinate data.
Loading, manipulating, and analyzing coordinate data.
root_pathA path to a directory containing coordinate files.
single_lenSingle case length e.g. damage length. Default is NULL.
is_strand_sensitiveCoordinate strand polarity. Default is TRUE.
merge_replicateMerge coordinate from different replicates. Default is TRUE.
rm_dupRemove duplicate entry in the coordinate table. Default is TRUE.
add_col_repIf add_col_rep is TRUE, column replicate is added to the coordinate table. Default is TRUE.
pathsIndividual coordinate files.
rep_namesReplicate names determined from coordinate subdirectory.
chr_namesChromosome names determined from filenames.
coorChromosome-named list of coordinate data.table.
is_kmerA data.table of is_kmer status. The first column is original is_kmer status.
kK-mer size when is_kmer is TRUE. When is_kmer is FALSE, k is NA.
ori_first_indexOriginal chromosome-separated table first index is either starting from zero or one.
load_limitMaximum 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.pathA path to a directory containing either: (1) chromosome-separated coordinate files (assume replicates for subdirectories) OR (2) bedfile. (assume replicates for bedfiles)
single.lenSingle case length e.g. damage length. Default is NULL
is.strand.sensitiveA boolean whether strand polarity matters. Default is TRUE.
merge.replicateMerge 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.dupRemove duplicates in each replicate. Default is FALSE Default is FALSE
add.col.repAdd column replicate to coordinate table.
is.kmerIs the coordinate refers to k-mer i.e. expanded case? Default is FALSE.
kLength of k-mer if is_kmer is TRUE.
ori.first.indexZero- or one-based index. Default is 1.
load.limitMaximum 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.nameChromosome name. It can be a vector of chromosomes.
stateCoordinate state: "current", "case", "kmer". The coordinate state is changed automatically on demand. Default is "current".
kK-mer size. If state is "kmer", k is needed to expand the coordinate.
reloadReload the coordinate table from the root.path. Default is TRUE.
rm.other.colsRemove 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.namesChromosome 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)genomeGenome 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)deepWhether to make a deep clone.