An R6 Class representing a fragments object.
unique_idunique id of the sample usually the file name
input_methodpathway used to import data (either 'fsa', 'size', or 'repeats')
metrics_group_idsample grouping for metrics calculations. Associated with add_metadata().
metrics_baseline_controllogical to indicate if sample is the baseline control. Associated with add_metadata().
batch_run_idfragment analysis run. Associated with add_metadata().
batch_sample_idAn id for the sample used as size standard for repeat calculation. Associated with add_metadata().
batch_sample_modal_repeatValidated repeat length for the modal repeat repeat in that sample. Associated with add_metadata().
fsaThe whole fsa file, output from seqinr::read.abif()
raw_ladderThe raw data from the ladder channel
raw_dataThe raw data from the sample channel
scanThe scan number
off_scale_scansvector indicating which scales were too big and off scale. Note can be in any channel
ladder_dfA dataframe of the identified ladder from find_ladders(). Scan is the scan number of peak and size is the associated bp size.
ladder_total_combinations_testedA numeric value indicating how many total combinations were tested during ladder fit
trace_bp_dfA dataframe of bp size for every scan from find_ladders().
peak_table_dfA dataframe containing the fragment peak level information.
repeat_table_dfA 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.
new()initialization function that is not used since the child classes are the main object of this package.
fragments$new(unique_id, input_method, object)unique_idunique_id
input_methodpathway used to import data (either 'fsa', 'size', or 'repeats')
objectobject to be inserted into either 'fsa', 'peak_table_df', or 'repeat_table_df'
plot_trace()plot the trace data
fragments$plot_trace(
show_peaks = TRUE,
x_axis = NULL,
ylim = NULL,
xlim = NULL,
signal_color_threshold = 0.05,
plot_title = NULL
)show_peaksA logical to say if the called peaks should be plotted on top of the trace. Only valid for fragments objects.
x_axisEither "size" or "repeats" to indicate what should be plotted on the x-axis.
ylimnumeric vector length two specifying the y axis limits
xlimnumeric vector length two specifying the x axis limits
signal_color_thresholdA threshold value to colour the peaks relative to the tallest peak.
plot_titleA character string for setting the plot title. Defaults to the unique id of the object
A base R plot
plot_ladder()plot the ladder data
fragments$plot_ladder(xlim = NULL, ylim = NULL, plot_title = NULL)xlimnumeric vector length two specifying the x axis limits
ylimnumeric vector length two specifying the y axis limits
plot_titleA character string for setting the plot title. Defaults to the unique id of the object
A base R plot
plot_data_channels()plot the raw data channels in the fsa file. It identifies every channel that has "DATA" in its name.
fragments$plot_data_channels()A base R plot
get_allele_peak()This returns a list with the allele information for this object.
fragments$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$set_allele_peak(allele, unit, value)alleleEither 1 or 2, indicating which allele information should be set. Allele 1 is the only one used for repeat instability metrics calculations.
unitEither "size" or "repeats" to indicate if the value you're providing is bp size or repeat length.
valueNumeric 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$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$set_index_peak(value)valueNumeric vector (length one) of the repeat length to set as index peak.
plot_fragments()This plots the peak/repeat table as a histogram
fragments$plot_fragments(ylim = NULL, xlim = NULL, plot_title = NULL)ylimnumeric vector length two specifying the y axis limits
xlimnumeric vector length two specifying the x axis limits
plot_titleA 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$clone(deep = FALSE)deepWhether to make a deep clone.
This is the parent class of both fragments and fragments object. The idea is that shared fields and methods are both inherited from this object, but it is not itself directly used.