Skip to contents

Extracts a table summarizing the model used to correct repeat length

Usage

extract_repeat_correction_summary(fragments_list)

Arguments

fragments_list

A list of fragments_repeats class objects obtained from the call_repeats() function when the correction = "repeat" parameter is used.

Value

A data.frame

Details

For each of the samples used for repeat correction, this table pulls out the modal repeat length called by the model (allele_repeat), how far that sample is on average from the linear model in repeat units by finding the average residuals (avg_residual), and the absolute value of the avg_residual (abs_avg_residual)

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

# finally extract repeat correction summary
extract_repeat_correction_summary(fragments_list)
#>                                   unique_id batch_run_id batch_sample_id
#> 20230413_H07.fsa           20230413_H07.fsa     20230414        S-21-211
#> 20230413_H08.fsa           20230413_H08.fsa     20230414        S-21-212
#> S-21-211_20220630.fsa S-21-211_20220630.fsa     20220630        S-21-211
#> S-21-212_20220630.fsa S-21-212_20220630.fsa     20220630        S-21-212
#>                       batch_sample_modal_repeat allele_repeat avg_residual
#> 20230413_H07.fsa                            120      119.9629   0.01585004
#> 20230413_H08.fsa                            122      122.0190  -0.01585004
#> S-21-211_20220630.fsa                       120      119.9798   0.01988041
#> S-21-212_20220630.fsa                       122      122.0081  -0.01704035
#>                       abs_avg_residual
#> 20230413_H07.fsa            0.01585004
#> 20230413_H08.fsa            0.01585004
#> S-21-211_20220630.fsa       0.01988041
#> S-21-212_20220630.fsa       0.01704035