alexkychen / assignPOP

Population Assignment using Genetic, Non-genetic or Integrated Data in a Machine-learning Framework. Methods in Ecology and Evolution. 2018;9:439–446.
http://alexkychen.github.io/assignPOP/
GNU General Public License v3.0
17 stars 4 forks source link

Problem with read.Structure for fixed SNP loci #16

Open biodray opened 3 years ago

biodray commented 3 years ago

Hi,

I have noticed a problem with the function read.Structure, which doubled the number of row of the DataMatrix (YOUR_LIST_NAME$DataMatrix) compared to the number of individuals (as in YOUR_LIST_NAME$SampleID). I have encountered this problem with a dataset in which some loci were fixed.

This problem was caused by the structure_onehot internal function, which doesn't seem to manage fixed loci (keep only 1 colum for fixed loci and double the number rows).

Now that I have noticed it I had removed fixed loci, but maybe adding a warning, or modifying the way structure_onehot works migth prevent another person from problems with this package (which, by the way, I really like!).

alexkychen commented 3 years ago

Hi biodray. Sorry I missed your question. Do you still encounter the same problem?

mgdesaix commented 4 weeks ago

Just chiming in that this is still an issue as of assignPOP version 1.3.0. Fixed states mess up the input with read.Structure, such that the resulting genetic matrix has twice the number of individuals.