Load and check a mixture file
checkMixtureFile.Rd
Given a mixture file name, returns the loaded data frame along with any detected errors or warnings.
Value
A list containing
df
The loaded data frame, NULL if errors are present.warning
A list of strings describing the errors that ocurred but could be fixed or that do not prevent the execution of the program.error
A list of strings describing the errors that occurred that made it impossible to return a valid data frame. If this list is not empty, then the data frame item will be null.
Details
If warnings are found, the function attempts to fix them and explains what it has done in the warning messages. If an error is found, checking stops and a NULL data frame is returned. The error is described in the error messages.
Examples
mixfile <- system.file("extdata","mixture.txt",package="relMix")
result <- checkMixtureFile(mixfile);
print(result$df);
#> SampleName Marker Allele1 Allele2 Allele3
#> 1 relMix1 CSF1PO 10 12.0 NA
#> 2 relMix1 D10S1248 14 16.0 NA
#> 3 relMix1 D13S317 8 12.0 13.0
#> 4 relMix1 D14S1434 10 13.0 NA
#> 5 relMix1 D16S539 10 11.0 13.0
#> 6 relMix1 D19S433 13 14.0 15.2
#> 7 relMix1 D1S1656 15 17.3 NA
#> 8 relMix1 D1S1677 13 14.0 15.0
#> 9 relMix1 D2S1338 17 19.0 20.0
#> 10 relMix1 D2S1776 11 12.0 NA
#> 11 relMix1 D2S441 10 11.0 14.0
#> 12 relMix1 D3S1358 15 16.0 NA
#> 13 relMix1 D4S2408 8 10.0 11.0
#> 14 relMix1 D5S2500 14 18.0 NA
#> 15 relMix1 D5S818 9 12.0 NA
#> 16 relMix1 D6S1043 11 18.0 NA
#> 17 relMix1 D6S474 14 NA NA
#> 18 relMix1 D7S820 10 11.0 NA
#> 19 relMix1 D8S1179 13 14.0 15.0
#> 20 relMix1 D9S2157 7 11.0 12.0
#> 21 relMix1 TH01 6 8.0 9.3
#> 22 relMix1 TPOX 8 10.0 11.0
print(result$warning);
#> NULL
print(result$error);
#> NULL