This function executes the complete workflow for analyzing amplicon sequencing data. It identifies primer dimers, valid amplicons, and off-target products, then generates a statistical summary and visualizations.
analyze_amplicons(
fastq_file_r1,
fastq_file_r2,
forward_primer = "ACGTACGTACGT",
reverse_primer = "TGCATGCATGCA",
expected_length = 400,
length_tolerance = 50,
max_dimer_length = 100,
min_quality_score = 30,
output_dir = ".",
write_to_disk = TRUE,
separate_plots = FALSE
)Path to the R1 FASTQ file
Path to the R2 FASTQ file
Forward primer sequence
Reverse primer sequence
Expected amplicon length (default: 400)
Allowed deviation from expected length (default: 50)
Maximum length for primer dimer classification (default: 100)
Minimum quality score threshold (default: 30)
Directory for output files (default: current directory)
Store resulting plots and summary file to directory defined in output_dir (default: TRUE)
Logical indicating whether to create separate plots for each sample (default: FALSE)
A list containing:
Data frame with statistical summary
ggplot object showing read length distribution(s)