Translate sample names to sample types
Source:R/classes-plate_builder.R
translate_sample_names_to_sample_types.Rd
Function translates sample names to sample types based on the sample name from Luminex file and the sample name from the layout file, which may not be provided. The function uses regular expressions to match the sample names to the sample types.
It parses the names as follows:
If sample_names
or sample_names_from_layout
equals to BLANK
, BACKGROUND
or B
,
then SampleType equals to BLANK
If sample_names
or sample_names_from_layout
equals to STANDARD CURVE
,
SC
, S
, contains substring 1/\d+
and has prefix
, S_
, S
,
S
or CP3
, then SampleType equals to STANDARD CURVE
If sample_names
or sample_names_from_layout
equals to NEGATIVE CONTROL
, N
,
or contains substring NEG
, then SampleType equals to NEGATIVE CONTROL
If sample_names
or sample_names_from_layout
starts with P
followed by
whitespace, POS
followed by whitespace, some sample name followed by
substring 1/\d+
SampleType equals to POSITIVE CONTROL
Otherwise, the returned SampleType is TEST
Arguments
- sample_names
(
character()
)
Vector of sample names from Luminex file- sample_names_from_layout
(
character()
)
Vector of sample names from Layout file values in this vector may be different thansample_names
and may contain additional information about the sample type like dilution. This vector when set has to have at least the length ofsample_names
.