Processing - Main Functions

Stand-alone:

calculate_gc_per_100ml()

Calculating Gene Copies per 100mL

This function takes in a dataframe of laboratory data, either merged or unmerged, as well as a dataframe of the weight/volume data taken in previous laboratory steps.

The dataframe of laboratory data is assumed to have columns of ‘Sample’, ‘Positives’, ‘CP_uL’

The dataframe of the weight/volume data is assumed to consist of three columns in the following order: “Sample”, “initial_volume_analyzed_mL”, “final_concentrate_volume_mL”

The dataframe of diliutions is assumed to consist of three columns in the following order: “Sample”, “Target”, “DilutionFactor”. Dilution factor should be what you want to MULTIPLY the value by to get the final measurement, so, for example, if you diluted the sample 1:100, you’d multiply the measurement by 100 to get the final corrected gene copies per 100mL value. This dataframe is not necessary to provide to the function. The system will assume no dilutions were done in this instance.

  • lab_df_in: Dataframe of laboratory data, must contain columns: ‘Sample’, ‘Positives’, ‘CP_uL’

  • all_weigh_info: Dataframe of weight/volumn data, must consist of “Sample”, “initial_volume_analyzed_mL”, “final_concentrate_volume_mL” columns

  • volume_used_for_extraction_mL: Numeric value of the volume used for extraction in mL

  • final_extraction_volume_uL: Numeric value of the final extraction volume in uL

  • positives_limit: Positives limit for when to apply the gene copies per 100mL value calculation to the sample. If the Positives value is less than this value, the final gene copies per 100mL column will be filled with the Detection limit value instead

  • adjust_frevu: Numeric adjustment factor (multiplier) for (final_extraction_volume_uL/div_frevu)

  • div_frevu: Numeric adjustment factor (divider) for final_extraction_volume_uL

  • further_adjust: Numeric adjustment factor (multiplier) for entire function

Default settings: volume_used_for_extraction_mL = 0.8, final_extraction_volume_uL = 50, positives_limit = 3, adjust_frevu = 0.6, div_frevu = 1, further_adjust = 1

Note: For SEWER program, the above defaults are for WEL RNA protocols

Note 2: For the SEWER program C. auris pilot project, the inputs should be:

  • volume_used_for_extraction_mL = 0.2

  • final_extraction_volume_uL = 80

  • adjust_frevu = 3

  • div_frevu = 5

  • further_adjust = 10.32

This function returns a dataframe with all the columns originally in the laboratory data frame (lab_df_in), plus additional columns: “initial_volume_analyzed_mL”, “final_concentrate_volume_mL”, “detection_limit_CP_100mL”, “CP_100_mL_of_sample”

This function first assigns the volume/weight dataframe columns 1, 2, and 3 the names of “Sample”, “initial_volume_analyzed_mL”, and “final_concentrate_volume_mL”, respectively. Then the laboratory data and the volume/weight dataframe are merged by Sample name.

The difference in sample names between the laboratory data and the post-merge data frame is reported on by the function. initial_volume_analyzed_mL and final_concentrate_volume_mL are forced to numeric values (please note, if there are un-convertable characters in these columns, they will change to NA).

detection_limit_CP_100mL is calculated as:

\[ {[a * (b/c) ] * d * (e/f) \over g} * 100 \]

where:

  • a = adjust_frevu

  • b = final_extraction_volume_uL

  • c = div_frevu

  • d = further_adjust

  • e = final_concentrate_volume_mL

  • f = volume_used_for_extraction_mL

  • g = initial_volume_analyzed_mL

CP_100_mL_of_sample is calculated as:

\[ {[a * (b/c) ] * d * (e/f) \over g} * 100 \]

where:

  • a = CP_uL

  • b = final_extraction_volume_uL

  • c = div_frevu

  • d = further_adjust

  • e = final_concentrate_volume_mL

  • f = volume_used_for_extraction_mL

  • g = initial_volume_analyzed_mL

The dilution factor multiplication is performed as the final calculation, and is applied to both CP_100_mL_of_sample and detection_limit_CP_100mL.

Function:

calculate_gc_per_100ml((lab_df_in, all_weigh_info,
                                   dilution_df = 1,
                                   volume_used_for_extraction_mL = 0.2,
                                   final_extraction_volume_uL = 80,
                                   positives_limit = 3,
                                   adjust_frevu = 0.6,
                                   div_frevu = 1,
                                   further_adjust = 1))

merging_methods()

Merging multiple rows (same sample/target combinations, as samples can be run in duplicate, triplicate, quadruplicate) into a single data point

This function is meant to be of use when samples or data is run in duplicate, triplicate, etc. and ideally after QAQC has been completed on the data.

This function takes as input:

  • A data frame, with at least columns of: Well, Sample, Target, Concentration, CopiesPer20uLWell, Positives, Negatives, and AcceptedDroplets

  • A character string indicating the method of well merging you’d like to complete, either “average” or “biorad_merge”

  • A numeric droplet adjustment factor, if you are using the “biorad_merge” method.

The default value set for this is 0.00085.

For both methods, the dataframe is grouped by Sample and Target, then the following are calculated:

Variable R Code Description
Well paste(Well) Concatenated list of the well labels included in the merge
count_wells length(Well) Count of wells included in the merged value
CopiesPer20uLWell_sum sum(CopiesPer20uLWell, na.rm = TRUE) Total number of copies per 20uL well across all multiples
CopiesPer20uLWell_avg mean(CopiesPer20uLWell, na.rm = TRUE) Average number of copies per 20uL well across all multiples
Positives_sum sum(Positives, na.rm = TRUE) Total number of positive droplets across all multiples
Positives_avg mean(Positives, na.rm = TRUE) Average number of positive droplets across all multiples
Negatives_sum sum(Negatives, na.rm = TRUE) Total number of negative droplets across all multiples
Negatives_avg mean(Negatives, na.rm = TRUE) Average number of negative droplets across all multiples
AcceptedDroplets_sum sum(AcceptedDroplets, na.rm = TRUE) Total number of accepted droplets across all multiples
AcceptedDroplets_avg mean(AcceptedDroplets, na.rm = TRUE) Average number of accepted droplets across all multiples

The biorad method of merging data is applied only to the Concentration value, and is calculated as:

concentration = (negative natural logarithm of (number of negative droplets / total number of droplets)) / (volume of droplet)

If you are using a Biorad machine, the droplet size is usually:

  • For QX200 = 0.00085

  • For QX600 = 0.000795

If you are using the “average” method, concentration is just calculated as the mean of the Concentration column.

Function:

merging_methods(data_frame_in, method = "average", droplet_adjust = 0.00085)

software_renaming()

Renaming & selecting columns based on initial processing software, for use in other wastewateR functions

This function takes in a dataframe and a character string as input. The dataframe should be a laboratory data file. The character string should indicate the software that was used to generate the laboratory data file.

Currently, the only style supported in this function is “qx_manager”, and that is the default setting. If style is set to “qx_manager”, the function will select 8 columns from the dataframe that was provided as input: Well, Sample.description.1, Target, Conc.copies.µL., Copies.20µLWell, Accepted.Droplets, Positives, and Negatives. It will then rename these to: “Well”, “Sample”, “Target”, “Concentration”, “CopiesPer20uLWell”, “AcceptedDroplets”, “Positives”, and “Negatives”, respectively. This smaller set is the return value dataframe of this function.

If the style is not a recognized option, the function will print “Indicated file style not recognized:” and the style that was input to the console. In this case, the original dataframe that was provided will be returned.

Function:

software_renaming(off_machine, style = "qx_manager")

Wrappers:

qaqc_processing_cauris()

Wrapper function set-up with some default measures for processing C. auris and C. jejuni data, per MDHHS SEWER program methods.

This function returns a list where the first element is the processed dataframe containing unmerged Sample-Target data points along with additional columns generated by the processing minor functions, and the second element is an error stop notification dataframe that is generated if hard stop notifications are not used.

Function:

qaqc_processing_cauris <- function(file_in,
                                   lab_site_ids,
                                   targets_to_keep = c("CAUR", "CJEJ"),
                                   control_strings = c("NEG", "AUR", "NTC", "EXT"),
                                   pos_rows = data.frame(Samples = c("AUR", "AUR"),
                                                         Targets = c("CAUR", "CJEJ")),
                                   con_rows = data.frame(Samples = c("AUR", "EXT", "NEG", "NTC", "AUR", "EXT", "NEG", "NTC"),
                                                         Targets = c("CAUR", "CAUR", "CAUR", "CAUR", "CJEJ", "CJEJ", "CJEJ", "CJEJ")),

                                   e_w_c = 3,
                                   recover_unit = "BCOV",
                                   control_opts_two = c("EXT", "NEG")){

    auris1 <- w0110_sample_name_edits(file_in)

    auris1 <- w0115_target_check(auris1, targets_to_keep)
    error_line <- c("w0115")
    error_val <- c(auris1[2][[1]])

    if (auris1[2][[1]] == 0){

        # e track
        auris1_c <- w0150_sample_naming_structure(auris1[1][[1]],
                                                  lab_site_ids,
                                                  control_strings)

        error_line <- c("w0150")
        error_val <- c(auris1_c[2][[1]])

        auris1_c <- w0200_accepted_droplet_count(auris1_c[1][[1]], 10000)

        # e track
        auris1_c <- w0300_ntc_control_check(auris1_c)

        error_line <- c(error_line, "w0300")
        error_val <- c(error_val, auris1_c[2][[1]])

        # e track
        error_line <- c(error_line, "w0400")
        error_val <- c(error_val, w0400_pos_control_hard_stop(auris1_c[1][[1]], pos_rows))

        auris1_d <- w0450_pos_control_breakdown_check(auris1_c[1][[1]], pos_rows)

        # e track
        auris1_e <- w0600_ext_neg_control_check(auris1_d, control_opts_two, recover_unit,
                                                positive_droplet = 3,
                                                wells_over = 1)
        error_line <- c(error_line, "w0600")
        error_val <- c(error_val, auris1_e[2][[1]])

        # e track
        error_line <- c(error_line, "w0650")
        error_val <- c(error_val, w0650_cumulative_count_check(auris1_e[1][[1]]))

        auris1_f <- w0700_pos_droplet_sum(auris1_e[1][[1]], 4, con_rows)

        auris1_g <- w1000_remove_rows_as_chosen(auris1_f, c(2, 3, 6))

        error_df <- data.frame(error_line, error_val)

        message("End wrapper for C. auris.")

        return(list(auris1_g, error_df))

    } else {

      error_df <- data.frame(error_line, error_val)

      message("C. auris - Error with Targets listed & encountered - Stop Error #1.15")

      return(list(auris1[1][[1]], error_df))

    }

}
                                   

qaqc_processing_fiveplex()

Wrapper function set-up with some default measures for processing fiveplex data (Influenza A, Influenza B, Influenza A H5, RSV, SARS-CoV-2 S Gene), per MDHHS SEWER program methods

This function returns a list where the first element is the processed dataframe containing unmerged Sample-Target data points along with additional columns generated by the processing minor functions, and the second element is an error stop notification dataframe that is generated if hard stop notifications are not used.

Function:


qaqc_processing_fiveplex <- function(file_in,
                                     lab_site_ids,
                                     targets_to_keep = c("FluA", "FluB", "RSV", "SC2", "H5"),
                                   control_strings = c("NEG", "POS", "NTC", "EXT"),
                                   pos_rows = data.frame(Samples = c("POS", "POS", "POS", "POS", "POS"),
                                                         Targets = c("FluA", "FluB", "RSV", "SC2", "H5")),
                                   con_rows = data.frame(Samples = c("NEG", "POS", "NTC", "NEG", "POS", "NTC", "NEG", "POS", "NTC", "NEG", "POS", "NTC", "NEG", "POS", "NTC"),
                                                         Targets = c("FluA", "FluA", "FluA","FluB", "FluB", "FluB","RSV","RSV","RSV", "SC2", "SC2","SC2","H5","H5","H5")),
                                   recover_unit = "BCOV",
                                   control_opts_two = c("EXT", "NEG")
                                   ){

  file_in <- w0110_sample_name_edits(file_in)


  file_in <- w0115_target_check(file_in, targets_to_keep)
  error_line <- c("w0115")
  error_val <- c(file_in[2][[1]])

  if (file_in[2][[1]] == 0){

      file_in <- w0125_expected_controls_present(file_in[1][[1]],
                                                 control_strings,
                                                 c(3, 3, 3, 0))

      error_line <- c("w0125")
      error_val <- c(file_in[2][[1]])

      file_in <- w0150_sample_naming_structure(file_in[1][[1]],
                                               lab_site_ids,
                                               control_strings)

      error_line <- c(error_line, "w0150")
      error_val <- c(error_val, file_in[2][[1]])

      file_in <- w0200_accepted_droplet_count(file_in[1][[1]])

      file_in <- w0300_ntc_control_check(file_in)

      error_line <- c(error_line, "w0300")
      error_val <- c(error_val, file_in[2][[1]])

      error_line <- c(error_line, "w0400")
      error_val <- c(error_val, w0400_pos_control_hard_stop(file_in[1][[1]], pos_rows))
      # just a check, no return value

      file_in <- w0450_pos_control_breakdown_check(file_in[1][[1]], pos_rows, 35)

      file_in <- w0500_control_soft_check(file_in, pos_rows)

      file_in <- w0600_ext_neg_control_check(file_in, control_opts_two, recover_unit,
                                             positive_droplet = 3,
                                             wells_over = 1)

      error_line <- c(error_line, "w0600")
      error_val <- c(error_val, file_in[2][[1]])

      error_line <- c(error_line, "w0650")
      error_val <- c(error_val, w0650_cumulative_count_check(file_in[1][[1]], 3, "no"))

      file_in <- w0700_pos_droplet_sum(file_in[1][[1]], controls_to_drop = con_rows)

      file_in <- w0750_neg_droplet_samples(file_in, controls_to_drop = con_rows)
      error_line <- c(error_line, "w0750")
      error_val <- c(error_val, file_in[2][[1]])

      file_in <- w0900_positives_comparison_rule(file_in[1][[1]], pos_rows[, 1], pos_rows[, 2], control_strings, 3)

      file_in <- w1000_remove_rows_as_chosen(file_in)

      error_df <- data.frame(error_line, error_val)

      message("End wrapper for FivePlex.")

  } else {

      error_df <- data.frame(error_line, error_val)

      message("FivePlex  - Error with Targets listed & encountered - Stop Error #1.15")

  }

  return(list(file_in, error_df))

}

qaqc_processing_norog1g2()

Wrapper function set-up with some default measures for processing Norovirus G1 and G2 data, per MDHHS SEWER program methods

This function returns a list where the first element is the processed dataframe containing unmerged Sample-Target data points along with additional columns generated by the processing minor functions, and the second element is an error stop notification dataframe that is generated if hard stop notifications are not used.

Function:


qaqc_processing_norog1g2 <- function(file_in,
                                     lab_site_ids,
                                     targets_to_keep = c("NVG1", "NVG2"),
                                     control_strings = c("NEG", "POS", "NTC", "EXT"),
                                     pos_rows = data.frame(Samples = c("POS", "POS"),
                                                           Targets = c("NVG1", "NVG2")),
                                     con_rows = data.frame(Samples = c("NEG", "POS", "NTC", "NEG", "POS", "NTC"),
                                                           Targets = c("NVG1", "NVG1", "NVG1","NVG2", "NVG2", "NVG2")),
                                     recover_unit = "BCOV",
                                     control_opts_two = c("EXT", "NEG"),
                                     rules = c(2, 3, 6)){

  file_in <- w0110_sample_name_edits(file_in)

  file_in <- w0115_target_check(file_in, targets_to_keep)
  error_line <- c("w0115")
  error_val <- c(file_in[2][[1]])

  if (file_in[2][[1]] == 0){

      file_in <- w0125_expected_controls_present(file_in[1][[1]],
                                                 control_strings,
                                                 c(3, 3, 3, 0))

      error_line <- c("w0125")
      error_val <- c(file_in[2][[1]])

      file_in <- w0150_sample_naming_structure(file_in[1][[1]],
                                               lab_site_ids,
                                               control_strings)

      error_line <- c(error_line, "w0150")
      error_val <- c(error_val, file_in[2][[1]])

      file_in <- w0200_accepted_droplet_count(file_in[1][[1]])

      file_in <- w0300_ntc_control_check(file_in)

      error_line <- c(error_line, "w0300")
      error_val <- c(error_val, file_in[2][[1]])

      error_line <- c(error_line, "w0400")
      error_val <- c(error_val, w0400_pos_control_hard_stop(file_in[1][[1]], pos_rows))
      # just a check, no return value

      file_in <- w0450_pos_control_breakdown_check(file_in[1][[1]], pos_rows, 35)

      file_in <- w0600_ext_neg_control_check(file_in, control_opts_two, recover_unit,
                                             positive_droplet = 3,
                                             wells_over = 1)

      error_line <- c(error_line, "w0600")
      error_val <- c(error_val, file_in[2][[1]])

      error_line <- c(error_line, "w0650")
      error_val <- c(error_val, w0650_cumulative_count_check(file_in[1][[1]], 3, "no"))

      file_in <- w0700_pos_droplet_sum(file_in[1][[1]], controls_to_drop = con_rows)

      file_in <- w0750_neg_droplet_samples(file_in, controls_to_drop = con_rows)
      error_line <- c(error_line, "w0750")
      error_val <- c(error_val, file_in[2][[1]])

      file_in <- w0900_positives_comparison_rule(file_in[1][[1]], pos_rows[, 1], pos_rows[, 2], control_strings, 3)

      file_in <- w1000_remove_rows_as_chosen(file_in, rules)

      error_df <- data.frame(error_line, error_val)

      message("End wrapper for Noro G1 & G2.")

      return(list(file_in, error_df))

  } else {

    error_df <- data.frame(error_line, error_val)

    message("Noro G1 & G2 - Error with Targets listed & encountered - Stop Error #1.15")

    return(list(file_in[1][[1]], error_df))

  }



}

qaqc_processing_sc2_n1()

Wrapper function set-up with some default measures for processing SARS-CoV-2 N1 data, per MDHHS SEWER program methods

The default settings of expected count are for the assumption of pmmov & bcov testing within the sars-cov-2 n1 testing (so, two plates) with expected controls of:

Sample Target Count Wells
BCOV PMMOV 3
BCOV BCOV 3
EXT PMMOV 3
EXT BCOV 3
NEG PMMOV 3
NEG BCOV 3
NTC BCOV 3
NTC BCOV 3
NEG N1 3
EXT N1 3
NTC N1 3
POS N1 3

This function returns a list where the first element is the processed dataframe containing unmerged Sample-Target data points along with additional columns generated by the processing minor functions, and the second element is an error stop notification dataframe that is generated if hard stop notifications are not used.

Function:


qaqc_processing_sc2_n1 <- function(file_in,
                                   lab_site_ids,
                                   targets_to_keep = c("N1", "BCOV"),
                control_strings = c("NEG", "POS", "NTC", "BCOV", "EXT"),
                expected_count = c(3, 3, 3, 3, 3),
                pos_rows = data.frame(Samples = c("POS", "BCOV"),
                                       Targets = c("N1", "BCOV")),
                con_rows = data.frame(Samples = c("BCOV", "BCOV", "POS", "EXT", "EXT","EXT","NEG","NEG","NEG", "NTC", "NTC", "NTC"),
                                       Targets = c("PMMOV", "BCOV",  "N1", "PMMOV", "N1", "BCOV", "PMMOV", "N1", "BCOV", "PMMOV", "N1", "BCOV")),
                recover_unit = "BCOV",
                control_opts_two = c("EXT", "NEG")
                ){

  file_in <- w0110_sample_name_edits(file_in)

  file_in <- w0115_target_check(file_in, targets_to_keep)
  error_line <- c("w0115")
  error_val <- c(file_in[2][[1]])

  if (file_in[2][[1]] == 0){

      file_in <- w0125_expected_controls_present(file_in[1][[1]],
                                                control_strings,
                                                expected_count)

      error_line <- c("w0125")
      error_val <- c(file_in[2][[1]])

      file_in <- w0150_sample_naming_structure(file_in[1][[1]],
                                             lab_site_ids,
                                             control_strings)

      error_line <- c(error_line, "w0150")
      error_val <- c(error_val, file_in[2][[1]])

      file_in <- w0200_accepted_droplet_count(file_in[1][[1]])

      file_in <- w0300_ntc_control_check(file_in)
      error_line <- c(error_line, "w0300")
      error_val <- c(error_val, file_in[2][[1]])

      error_line <- c(error_line, "w0400")
      error_val <- c(error_val, w0400_pos_control_hard_stop(file_in[1][[1]], pos_rows))


      file_in <- w0450_pos_control_breakdown_check(file_in[1][[1]], pos_rows, 35)

      file_in <- w0500_control_soft_check(file_in, con_rows)

      file_in <- w0600_ext_neg_control_check(file_in, control_opts_two, recover_unit,
                                             positive_droplet = 3,
                                             wells_over = 1)

      error_line <- c(error_line, "w0600")
      error_val <- c(error_val, file_in[2][[1]])

      error_line <- c(error_line, "w0650")
      error_val <- c(error_val, w0650_cumulative_count_check(file_in[1][[1]], 3, "no"))

      file_in <- w0700_pos_droplet_sum(file_in[1][[1]], controls_to_drop = con_rows)

      file_in <- w0750_neg_droplet_samples(file_in, controls_to_drop = con_rows)
      error_line <- c(error_line, "w0750")
      error_val <- c(error_val, file_in[2][[1]])

      file_in <- w0800_recover_control_check(file_in[1][[1]], recover_unit, control_strings, 0.3)

      file_in <- w0900_positives_comparison_rule(file_in, pos_rows[, 1], pos_rows[, 2], control_strings, 3)

      file_in <- w1000_remove_rows_as_chosen(file_in)

      error_df <- data.frame(error_line, error_val)

      message("End wrapper for SARS-CoV-2 N1")

  } else {

      error_df <- data.frame(error_line, error_val)

      message("SARS-CoV-2 N1  - Error with Targets listed & encountered - Stop Error #1.15")

  }

  return(list(file_in, error_df))

}

qaqc_processing_sc2_n1_slim()

Wrapper function set-up with some default measures for processing SARS-CoV-2 N1 data without additional PMMoV/BCoV data, per MDHHS SEWER program methods

The default settings of expected count are for the assumption of NO pmmov/bcov testing within the sars-cov-2 n1 testing (so, one plate) with expected controls of:

Sample Target Count Wells
NEG N1 3
EXT N1 3
NTC N1 3
POS N1 3

This function returns a list where the first element is the processed dataframe containing unmerged Sample-Target data points along with additional columns generated by the processing minor functions, and the second element is an error stop notification dataframe that is generated if hard stop notifications are not used.

Function:

qaqc_processing_sc2_n1_slim <- function(file_in,
                                        lab_site_ids,
                                        targets_to_keep = c("N1"),
                                        control_strings = c("NEG", "POS", "NTC", "EXT"),
                                        expected_count = c(3, 3, 3, 3),
                                        pos_rows = data.frame(Samples = c("POS"),
                                                              Targets = c("N1")),
                                        con_rows = data.frame(Samples = c("POS", "NEG", "NTC", "EXT"),
                                                              Targets = c("N1", "N1", "N1", "N1")),
                                        recover_unit = "BCOV",
                                        rules = c(2, 3, 6),
                                        control_opts_two = c("EXT", "NEG")
                                        ){

  file_in <- w0110_sample_name_edits(file_in)

  file_in <- w0115_target_check(file_in, targets_to_keep)
  error_line <- c("w0115")
  error_val <- c(file_in[2][[1]])

  if (file_in[2][[1]] == 0){

      file_in <- w0125_expected_controls_present(file_in[1][[1]],
                                                 control_strings,
                                                 expected_count)

      error_line <- c("w0125")
      error_val <- c(file_in[2][[1]])

      file_in <- w0150_sample_naming_structure(file_in[1][[1]],
                                               lab_site_ids,
                                               control_strings)

      error_line <- c(error_line, "w0150")
      error_val <- c(error_val, file_in[2][[1]])

      file_in <- w0200_accepted_droplet_count(file_in[1][[1]])

      file_in <- w0300_ntc_control_check(file_in)
      error_line <- c(error_line, "w0300")
      error_val <- c(error_val, file_in[2][[1]])

      error_line <- c(error_line, "w0400")
      error_val <- c(error_val, w0400_pos_control_hard_stop(file_in[1][[1]], pos_rows))


      file_in <- w0450_pos_control_breakdown_check(file_in[1][[1]], pos_rows, 35)


      file_in <- w0600_ext_neg_control_check(file_in, control_opts_two, recover_unit,
                                             positive_droplet = 3,
                                             wells_over = 1)

      error_line <- c(error_line, "w0600")
      error_val <- c(error_val, file_in[2][[1]])

      error_line <- c(error_line, "w0650")
      error_val <- c(error_val, w0650_cumulative_count_check(file_in[1][[1]], 3, "no"))

      file_in <- w0700_pos_droplet_sum(file_in[1][[1]], controls_to_drop = con_rows)

      file_in <- w0750_neg_droplet_samples(file_in, controls_to_drop = con_rows)
      error_line <- c(error_line, "w0750")
      error_val <- c(error_val, file_in[2][[1]])

      file_in <- w0800_recover_control_check(file_in[1][[1]], recover_unit, control_strings, 0.3)

      file_in <- w0900_positives_comparison_rule(file_in, pos_rows[, 1], pos_rows[, 2], control_strings, 3)

      file_in <- w1000_remove_rows_as_chosen(file_in, rules)

      error_df <- data.frame(error_line, error_val)

      message("End wrapper for SARS-CoV-2 N1 (slim).")

  } else {

    error_df <- data.frame(error_line, error_val)

    message("SARS-CoV-2 N1 (slim) - Error with Targets listed & encountered - Stop Error #1.15")

  }


  return(list(file_in[1][[1]], error_df))

}

Back to top