Skip to contents

[Stable]

Usage

read_qview_report(
  path,
  strip_prefix = FALSE,
  verbose = TRUE,
  call = rlang::caller_env()
)

Arguments

path

Character. Path to a Q-View report export (.csv or .xlsx).

strip_prefix

Logical. If TRUE, reverse Q-View's internal naming convention via strip_qview_prefix(). Default FALSE.

verbose

Logical. Print a short summary after parsing. Default TRUE.

call

The execution environment of the calling function. Used for error reporting; experts only.

Value

A list with class "qview", structured as the read_qview() return value. Container-only slots (manifest, segments) are empty; metadata$container_version is NA. Measurement tables add raw_value, flag, error_codes and statistic_label, preserving decoded cell text, censor/missing state and the original statistic label. Numeric censored values are bounds, not measured point estimates. Plain reduced estimates use statistic == "reduced". report_csv retains decoded CSV source lines in order; XLSX rows are serialized with valid CSV quoting.

Details

Parses one of the flat report files Q-View exports next to the native .Q-View container – the ..._auto_report or ..._auto_all-parameters_report export, as either .csv or .xlsx – and returns the same qview object read_qview() builds from the binary container. Use it when only the exports were kept and the original .Q-View project file is unavailable.

Binary and flat report readers use the same typed measurement parsing. Censored cells retain their bound with flag = "<" or ">"; Incalculable cells retain NA with flag = "incalculable". Blank cells and explicit NA / N/A retain NA with flag = "missing". Ordinary measurements have a missing flag. Malformed nonblank values, nonfinite numbers and nonzero values that underflow to zero are refused.

CSV input is decoded as UTF-8 when valid (including an optional BOM), otherwise as Latin-1. Encoding cannot be inferred perfectly; Windows-1252 and arbitrary encodings are not inferred. The selected interpretation is recorded in metadata$source_encoding. XLSX strings are already decoded by openxlsx2 and are not reinterpreted as Latin-1. Quoted commas, escaped quotes and quoted line breaks are preserved; malformed quoting is refused.

Only report wells A1 through H12 are supported. Conflicting records, duplicate analyte identities and conflicting well assignments are refused. A sample suffix is removed only when it is a recognized positive finite dilution of the form (1:n); other parentheses remain part of the ID.

Examples

path <- system.file("extdata", "example-report.csv",
                    package = "qviewparsR")
if (nzchar(path)) {
  qv <- read_qview_report(path)
  qv$concentrations
}
#> ✔ Parsed report export example-report.csv: 3 well groups x 3 analytes (8
#>   concentration rows).
#> ℹ Q-View Version: "3.13"
#> # A tibble: 8 × 13
#>   well_group sample_id well  replicate statistic analyte unit  concentration
#>   <chr>      <chr>     <chr>     <int> <chr>     <chr>   <chr>         <dbl>
#> 1 Cal 1      Cal 1     A1            1 replicate Ba      ng/mL         28.0 
#> 2 Cal 1      Cal 1     A1            1 replicate Bb      ug/mL          0.41
#> 3 Cal 1      Cal 1     A2            2 replicate Ba      ng/mL         NA   
#> 4 Cal 1      Cal 1     A2            2 replicate Bb      ug/mL          0.47
#> 5 N12345     N12345    A3           NA reduced   Ba      ng/mL          2.5 
#> 6 N12345     N12345    A3           NA reduced   Bb      ug/mL          0.05
#> 7 N23456     N23456    A4           NA reduced   Ba      ng/mL          0.31
#> 8 N23456     N23456    A4           NA reduced   Bb      ug/mL          0.42
#> # ℹ 5 more variables: dilution <dbl>, flag <chr>, raw_value <chr>,
#> #   error_codes <chr>, statistic_label <chr>