An R6 Class representing a fragments_repeats object.
trace::fragments
-> fragments_repeats
trace_bp_df
A dataframe of bp size for every scan from find_ladders()
.
peak_table_df
A dataframe containing the fragment peak level information.
repeat_table_df
A dataframe containing the fragment peak level information with the repeat size added. May or may not be the same as peak_table_df depending on what options are chosen in call_repeats
.
get_allele_peak()
This returns a list with the allele information for this object.
fragments_repeats$get_allele_peak()
set_allele_peak()
This sets a single allele size/repeat. It searches through the appropriate peak table and finds the closest peak to the value that's provided.
fragments_repeats$set_allele_peak(allele, unit, value)
allele
Either 1
or 2
, indicating which allele information should be set. Allele 1 is the only one used for repeat instability metrics calculations.
unit
Either "size" or "repeats" to indicate if the value you're providing is bp size or repeat length.
value
Numeric vector (length one) of the size/repeat length to set.
get_index_peak()
This returns a list with the index peak information for this object.
fragments_repeats$get_index_peak()
set_index_peak()
This sets the index repeat length. It searches through the repeat table and finds the closest peak to the value that's provided.
fragments_repeats$set_index_peak(value)
value
Numeric vector (length one) of the repeat length to set as index peak.
plot_fragments()
This plots the peak/repeat table as a histogram
fragments_repeats$plot_fragments(ylim = NULL, xlim = NULL, plot_title = NULL)
ylim
numeric vector length two specifying the y axis limits
xlim
numeric vector length two specifying the x axis limits
plot_title
A character string for setting the plot title. Defaults to the unique id of the object
clone()
The objects of this class are cloneable with this method.
fragments_repeats$clone(deep = FALSE)
deep
Whether to make a deep clone.
The idea behind this class is to store data for processing of the peak level data towards calculation of repeat instability metrics.
It contains important setters and getters for alleles and index peaks. It's very important that the exactly correct size and repeat value is set for the alleles and index peak. This is used for subsetting etc, so if it's not exactly correct many functions would break.
It also contains methods for plotting the ladder and traces (if available).