dipetkov / eems

Estimating Effective Migration Surfaces
GNU General Public License v2.0
102 stars 28 forks source link

diffs not a full-rank matrix #19

Closed mcrossley3 closed 6 years ago

mcrossley3 commented 6 years ago

Dr. Petkova, I am trying to run eems_snps and encountered an error:

[Diffs::initialize] Error: The dissimilarity matrix is not a full-rank distance matrix

I am wondering if you could help me resolve the issue?

I created the.diffs file using bed2diffs, and see that the file looks good (nrows = ncols, diagonals = 0). I estimated the rank using rankMatrix from the 'Matrix' R package, and found it is indeed different (slightly) from 0 (rank = 2.065015e-14). I checked the rank of a matrix I had successfully used in the past, but it was also different from 0 (rank = 4.174439e-14). The only difference between the matrices is that the matrix that worked was computed with ~4x more SNPs. Is there a simple way to modify the matrix so that eems_snps will accept it, without modifying eems results?

mcrossley3 commented 6 years ago

I'm sorry - I just noticed an earlier post where you answered basically the same question. I'll look into the missing genotype issue and post again if that resolves the issue.

mcrossley3 commented 6 years ago

Indeed, I made a mistake in formatting my .ped file, having many genotypes erroneously coded as missing, which trickled down into the .diffs file. After correctly coding genotypes and generating the .diffs file again, runeems_snps is running smoothly.

JimStarrett commented 2 years ago

I know it has been a long time, but do you recall how your genotypes were erroneously coded as missing? I am able to run a diff matrix but get the same 'not full-rank' error when I run runeems_snps.

thank you