Skip to contents

Plot the overlapping traces of the batch control samples

Usage

plot_batch_correction_samples(fragments_list, selected_sample, xlim = NULL)

Arguments

fragments_list

A list of fragments_repeats objects containing fragment data. must have trace information.

selected_sample

A character vector of batch_sample_id for a subset of samples to plot. Or alternatively supply a number to select batch sample by position in alphabetical order.

xlim

the x limits of the plot. A numeric vector of length two.

Value

plot of batch corrected samples

Details

A plot of the raw signal by bp size or repeats for the batch correction samples.

When plotting the traces before repeat correction, we do not expect the samples to be closely overlapping due to run-to-run variation. After repeat correction, the traces should be basically overlapping.

These plots are made using base R plotting. Sometimes these fail to render in the viewing panes of IDEs (eg you get the error 'Error in plot.new(): figure margins too large)'. If this happens, try saving the plot as a pdf using traditional approaches (see grDevices::pdf).

See also

call_repeats() for more info on batch correction.

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 = "batch"
)
#> Correcting batch effects

# traces of bp size shows traces at different sizes
plot_batch_correction_samples(
  fragments_list,
  selected_sample = "S-21-212", xlim = c(100, 120)
)