I am trying to perform an admixture analysis with the package LEA
and I am trying to convert a structure file into a geno file using the `struct2geno function.
My database consist in 512 samples/individuals and 82 SNPs marker (diploid). The function is as follows:
struct2geno("mydata.txt", ploidy=2, FORMAT=1, extra.row=1, extra.column=2)
My structure dataset contains the first row in which I have sample ID, population ID and markers ID. The format is type 1, therefore markers are encoded using one row of data for each individual.
When I run the function I have the following error:
Error in scan(file = file, what = what, sep = sep, quote = quote, dec = dec, : line 1 did not have 167 elements
Since my first row is headers of input file I am expecting that it recognizes the sample ID, population ID and the markers ID. However, it seems it gives an error.
I tried to change the extra.row
and extra.column
to see if perhaps the layout imported was having some formatting problems, but it didn't work.