Skip to contents

Converts the errorLst object returned by qcStudbook (when reportErrors=TRUE) into a format suitable for display in the Shiny UI.

Usage

processQcStudbookResult(errorLst)

Arguments

errorLst

list object returned by qcStudbook with reportErrors = TRUE. A NULL is treated as a failed check (hasErrors is TRUE with the error "No result returned from quality control check"), yet qcStudbook returns NULL when it finds no errors and no column changes. Use runQcStudbook, which handles that case, or pass getEmptyErrorLst() instead of NULL. Expected to be of class nprcgenekeeprErr containing error fields such as femaleSires, maleDams, sireAndDam, duplicateIds, invalidIdChars, invalidPlaceholderRows, missingColumns, invalidDateRows, suspiciousParents, failedDatabaseConnection, and changedCols.

Value

A list with the following components:

  • errors - data.frame with columns Row, Error, Details

  • warnings - data.frame with columns Row, Warning, Details

  • changedCols - list of changed column information

  • hasErrors - logical indicating if any errors were found

  • hasChangedCols - logical indicating if columns were renamed

See also

qcStudbook for generating the errorLst input

runQcStudbook for a wrapper that uses this function

checkErrorLst for checking if errorLst has errors

checkChangedColsLst for checking column changes

Examples

library(nprcgenekeepr)
## Turn a qcStudbook error list into UI-friendly data frames.
errorLst <- qcStudbook(nprcgenekeepr::pedFemaleSireMaleDam,
  reportErrors = TRUE
)
result <- processQcStudbookResult(errorLst)
result$hasErrors
#> [1] TRUE
result$errors
#>   Row                 Error                                  Details
#> 1  NA Female listed as sire Animal s1 is female but listed as a sire
#> 2  NA    Male listed as dam    Animal d1 is male but listed as a dam