fragments object
fragments.RdAn R6 Class representing a fragments object.
Details
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.
Public fields
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.
Methods
Method new()
initialization function that is not used since the child classes are the main object of this package.
Usage
fragments$new(unique_id, input_method, object)Method plot_trace()
plot the trace data
Usage
fragments$plot_trace(
show_peaks = TRUE,
x_axis = NULL,
ylim = NULL,
xlim = NULL,
signal_color_threshold = 0.05,
plot_title = NULL
)Arguments
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
Method plot_ladder()
plot the ladder data
Method plot_data_channels()
plot the raw data channels in the fsa file. It identifies every channel that has "DATA" in its name.
Method 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.
Arguments
alleleEither
1or2, 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.
Method 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.
Method plot_fragments()
This plots the peak/repeat table as a histogram