
Corrects the classification of reads contained in the class_data table.
Source:R/ninetails_data_postprocessing_functions.R
correct_class_data.RdIntroduces two additional columns (corr_class and
corr_comments) to the class_data table, reclassifying
reads based on the positional quality flags computed by
correct_residue_data. Reads whose all non-A
positions were flagged as ambiguous (qc_pos == "N") are
downgraded from "decorated" to "blank".
Arguments
- residue_data_edited
Data frame or tibble. Corrected non-A residue predictions produced by
correct_residue_data. Must contain columnsmode_pos,seg_err_quart, andqc_pos.- class_data
Data frame or tibble containing read_classes predictions from the ninetails pipeline.
Value
A tibble identical to class_data with two additional
columns:
- corr_class
Character. Corrected classification: original
classvalue, or"blank"for artefact-only reads.- corr_comments
Character. Corrected comment: original
commentsvalue, or"MPU"for reclassified reads.
Details
The reclassification logic: for each read, if every non-A residue
position has qc_pos == "N", the read is reclassified as
"blank" with comment "MPU" (to maintain compatibility
with the tag system used in plotting functions). Reads with at least
one qc_pos == "Y" position retain their original class and
comment.
Caution
It is recommended to use reclassify_ninetails_data
for downstream analyses, as it wraps this function together with
correct_residue_data and performs the necessary column
renaming. If using this function directly, rename corr_class
and corr_comments to class and comments before
plotting.
See also
correct_residue_data for the preceding step,
reclassify_ninetails_data for the high-level wrapper,
create_outputs for the pipeline that produces the
input data.