flat.to.long() - Potential issues that generate errors
Error Produced: Error in if(alleles[i, "Allele.1"]==0 {: missing value where TRUE/FALSE needed
When users provide genetic data as input into the flat.to.long(), the 'Sample.ID' column must be a factor. With the example data files provided with ConGenR (e.g., ConGenR_example_data_flat_replicates.txt), users will either have to (1) designate the 'Sample.ID' data as a factor when importing the data, or (2) change the 'Sample.ID' column from character to factor format after importing the data.
When users provide genetic data as input into the flat.to.long(), the 'Sample.ID' column must be a factor. With the example data files provided with ConGenR (e.g., ConGenR_example_data_flat_replicates.txt), users will either have to (1) designate the 'Sample.ID' data as a factor when importing the data, or (2) change the 'Sample.ID' column from character to factor format after importing the data.
Error Produced: Error in if(alleles[i, "Allele.1"]==0 {: argument is of length zero
It is critical that the format of the vector of loci names provided to the flat.to.long() function be identical to the format of the column names within the flat-formatted genetic data provided to the function. As an example, the sex identification markers used in the long-formatted example data provided for ConGenR (i.e., ConGenR_example_data_long.txt) are 'SexIDPrimer-Y' and 'SexIDPrimer-X'. These same names are used as column headers in the flat-formatted example file (i.e., ConGenR_example_data_flat_replicates.txt), but have '.1' through '.4' appended to them to generate columns for each potential allele. Importantly, R does not allow for '-' within column headers. Consequently, when the flat-formatted data is imported into R, the 'SexIDPrimer-Y' and 'SexIDPrimer-X' column headers are changed to 'SexIDPrimer.Y' and 'SexIDPrimer.X', respectively. Consequently, it is important that the vector of loci names provided to the 'loci.vector' argument within the flat.to.long() function align with the column names of the genetic data being provided to the 'gen.data.flat' argument.
It is critical that the format of the vector of loci names provided to the flat.to.long() function be identical to the format of the column names within the flat-formatted genetic data provided to the function. As an example, the sex identification markers used in the long-formatted example data provided for ConGenR (i.e., ConGenR_example_data_long.txt) are 'SexIDPrimer-Y' and 'SexIDPrimer-X'. These same names are used as column headers in the flat-formatted example file (i.e., ConGenR_example_data_flat_replicates.txt), but have '.1' through '.4' appended to them to generate columns for each potential allele. Importantly, R does not allow for '-' within column headers. Consequently, when the flat-formatted data is imported into R, the 'SexIDPrimer-Y' and 'SexIDPrimer-X' column headers are changed to 'SexIDPrimer.Y' and 'SexIDPrimer.X', respectively. Consequently, it is important that the vector of loci names provided to the 'loci.vector' argument within the flat.to.long() function align with the column names of the genetic data being provided to the 'gen.data.flat' argument.
Error Produced: Error in data.frame(...,check.names = FALSE) : arguments imply differing number of rows
When users provide their own genetic data to the flat.to.long function(), it is critical that the 'Class' column be included and that the class(es) be numeric value(s). If the user does not have class designations for samples, a generic class can be used for all samples (e.g., 999).
When users provide their own genetic data to the flat.to.long function(), it is critical that the 'Class' column be included and that the class(es) be numeric value(s). If the user does not have class designations for samples, a generic class can be used for all samples (e.g., 999).