eems icon indicating copy to clipboard operation
eems copied to clipboard

Error regarding dissimilarity calculation on rEEMSplots.R

Open SoniaAndrade opened this issue 7 years ago • 1 comments

Dear Dr Petkova

I am running runeems_snps using the following parameters: datapath = /home//sonia/Documents/pp mcmcpath = /home/sonia/Documents/pp/test nIndiv = 140 nSites = 1020 nDemes = 50 diploid = false numMCMCIter = 10000000 numBurnIter = 8000000 numThinIter = 100000

The run finishes without warnings, but when I use the R script I get the following msg:

Plotting average dissimilarities within and between demes /home/sonia/Documents/pp/ Error in if (ncol(x) != 2) { : argument is of length zero

When I look at my files rdist*, all of them seem incomplete (please see attached), and after doing some tests I could not figure out what might going on with my matrix. Could you please help me with that? Thanks

test.zip

SoniaAndrade avatar Oct 22 '17 17:10 SoniaAndrade

Hello Sonia,

The error message is not informative and in fact the issue is not with the plotting but with how the coordinates are specified in palma.outer (habitat coordinates.) and palma.coord (individual coordinates).

Here are the first few rows in palma.coord:

-34.2011990212 -71.156731993
-34.1990029626 -71.167156985
-34.1997989919 -71.1629139818
-34.1994079761 -71.1614110228
-34.2000159994 -71.1565459985

And here are the first few rows in palma.outer:

-71.235352 -31.849565
-71.004639 -32.026706
-70.905762 -32.138409
-70.839844 -32.203505
-70.773926 -32.259265

I am guessing from the numbers that in one file the coordinates are specified in the (longitude, latitude) order and in the other file -- in the (latitude, longitude) order. You can choose either but the specification has to be consistent. And obviously you have to rerun eems as well.

The plotting error then occurs because all samples are assigned to one deme only.

[Sorry it took me so long to look at this.]

dipetkov avatar Nov 06 '17 13:11 dipetkov