Plot Repeat Correction Model
plot_repeat_correction_model.Rd
Plots the results of the repeat correction model for a list of fragments.
Arguments
- fragments_list
A list of fragments_repeats class objects obtained from the
call_repeats()
function when thecorrection = "repeat"
parameter is used.- batch_run_id_subset
A character vector for a subset of batch_sample_id to plot. Or alternatively supply a number to select batch sample by position in alphabetical order.
- n_facet_col
A numeric value indicating the number of columns for faceting in the plot.
Details
This function makes plots for the model used to correct samples for each batch_run_id
. The repeat correction algorithm assigns the user supplied repeat length to the modal peak of the sample, then pulls out a set of robust neighboring peaks to help get enough data to build an accurate linear model for the relationship between base-pair size and repeat length. So on this plot, each dot is an individual peak, with the colour indicating each sample, with the y-axis is the repeat length called from the user-supplied value in the metadata and the value assigned to each peak, with the x-axis showing the corresponding base-pair size.
Examples
fsa_list <- lapply(cell_line_fsa_list[16:19], function(x) x$clone())
find_ladders(fsa_list, show_progress_bar = FALSE)
fragments_list <- find_fragments(fsa_list, min_bp_size = 300)
test_alleles <- find_alleles(
fragments_list
)
add_metadata(
fragments_list,
metadata
)
#> Warning: The following unique ids in the metadata file do not have a corresponding sample: 20230413_A07.fsa, 20230413_A08.fsa, 20230413_A09.fsa, 20230413_C01.fsa, 20230413_C02.fsa, 20230413_C03.fsa, 20230413_D07.fsa, 20230413_D08.fsa, 20230413_D09.fsa, 20230413_F01.fsa, 20230413_F02.fsa, 20230413_F03.fsa, 20230413_G07.fsa, 20230413_G08.fsa, 20230413_G09.fsa
call_repeats(
fragments_list = fragments_list,
correction = "repeat"
)
#> Repeat correction model: 4 samples used to build model
#> Repeat correction model: 2.88 bp increase per repeat
# traces of bp size shows traces at different sizes
plot_repeat_correction_model(
fragments_list,
batch_run_id_subset = "20230414"
)