This function identifies off-target amplification products based on length criteria and quality thresholds. It categorizes sequences as either "too_short" or "too_long".

detect_offtargets(
  reads_df,
  expected_length = 400,
  length_tolerance = 50,
  max_dimer_length = 100
)

Arguments

reads_df

A data frame from parse_fastq_pairs containing read pairs

expected_length

Expected amplicon length (default: 400)

length_tolerance

Allowed deviation from expected length (default: 50)

max_dimer_length

Maximum length for primer dimer classification (default: 100)

Value

A list with two logical vectors: too_short and too_long, indicating which reads fall into each category. Sequences shorter than max_dimer_length are not included in too_short as they are considered primer dimers.