write_thresholds: Write and read quality-control thresholds

View source: R/thresholds.R

write_thresholdsR Documentation

Write and read quality-control thresholds

Description

write_thresholds() saves thresholds to a YAML file, and read_thresholds() reads them back. Use the file to apply the same quality-control policy to each study, or to load thresholds that you tuned in nacho_app(). The Export page of the app writes the same file.

Usage

write_thresholds(thresholds, file)

read_thresholds(file)

Arguments

thresholds

A list of thresholds, as returned by nacho_thresholds() or found in the ⁠@thresholds⁠ property of a nacho object.

file

The path of the YAML file.

Details

In the file, .inf and -.inf are open bounds, and .na.character is an unknown instrument. You can edit the file by hand. read_thresholds() reads whole numbers such as 80 as numbers, and checks the thresholds as normalise() does. If the file does not give a miRNA threshold (Ligation_order, Ligation_R2, Ligation_NEG or Haemolysis), read_thresholds() uses the value of the preset in the file.

Value

write_thresholds() returns file, invisibly. read_thresholds() returns the list of thresholds.

Examples

file <- tempfile(fileext = ".yml")
thresholds <- nacho_thresholds("sprint")
thresholds$FoV <- 80
write_thresholds(thresholds, file)
read_thresholds(file)
unlink(file)

NACHO documentation built on Nov. 2, 2026, 5:09 p.m.