Dear Carolina.

I don't know how rayDISC works (but the authors of corHMM are on this list, so they will probably respond); however, for phytools::make.simmap & phytools::rerootingMethod, which can also handle missing data, missingness is coded by supplying the input data in the form of an N x k matrix for N species & k character states. In this case, we would put 0s and 1s in any row in which the character state was known; and a series of values of 1/k for any completely unknown state.

For instance:
        0       1       2
sp A    0       0       1
sp B    1       0       0
sp C    1/3     1/3     1/3
sp D    0       1/2     1/2

corresponds to species A in state '2', species B in state '0', and species C unknown or missing. Species D is in either state '1' or '2', but not in state '0'. (Instead of 1/k you can also set them all to be 1. The likelihood changes, but ancestral states are the same.)

I hope this is helpful. All the best, Liam

Liam J. Revell
Associate Professor, University of Massachusetts Boston
Profesor Asistente, Universidad Católica de la Ssma Concepción
web: http://faculty.umb.edu/liam.revell/, http://www.phytools.org

Academic Director UMass Boston Chile Abroad:
https://www.umb.edu/academics/caps/international/biology_chile

On 2/21/2020 8:22 PM, Carolina Santos Vieira wrote:
[EXTERNAL SENDER]

Dear all,

I am working with a morphological matrix which contains multistate
characters (including polymorphism) and some missing data entries (coded as
NA in data file for input). There are no unvariable characters in coding.
For the reconstruction of ancestral characters, I came across with rayDISC
function from corHMM package (since fitDiscrete doesn't seem to account for
it).

However, when running the script two kinds of errors are displayed:

- Calling the full data file with the rayDISC function, no matter which
character is selected for the analysis, it returns with this error:

rayDISC(phy,data, ntraits=1, charnum=1, rate.mat=NULL, model=c("ER"),
node.states=c("marginal"), state.recon=c("subsequently"),
lewis.asc.bias=FALSE, p=NULL, root.p=NULL, ip=NULL, lb=0, ub=100, verbose=TRUE,
diagn=FALSE)

$diagnostic
[1] "Character 1 is invariant. Analysis stopped."


- I have tried clipping the data creating a new object with just one
of the characters, but a new error appears:

Error in data[, 1] : incorrect number of dimensions

I also looked into running make.simmap in parallel
(https://nam01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fblog.phytools.org%2F2017%2F11%2Frunning-makesimmap-in-parallel.html&data=02%7C01%7Cliam.revell%40umb.edu%7Ce210401fdd8c483d2bde08d7b735d3f4%7Cb97188711ee94425953c1ace1373eb38%7C0%7C1%7C637179314141242835&sdata=%2FHwtbpjRxREIS7T2PPIQZ%2B5iyRpVbGaHMKWX6e8%2Fb5U%3D&reserved=0),
and this happens: " Error in if (any(x < 0)) x <- x - min(x) :
missing Value when TRUE/FALSE needed ". Trying to replace NA as
'unknown' to be considered in the analysis by changing its "status" to
FALSE, it returns in the matrix coded as "0", which is not properly
valid since this implies coding it as a known state (and not missing
data, as it truly is).


I appreciate if anyone could shine a light on this matter.
With regards,
Carolina Vieira
Bióloga - Mestre em Ecologia e Conservação
Doutoranda em Biologia Animal (PPGBAN - UFRGS)

         [[alternative HTML version deleted]]

_______________________________________________
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://nam01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fstat.ethz.ch%2Fmailman%2Flistinfo%2Fr-sig-phylo&amp;data=02%7C01%7Cliam.revell%40umb.edu%7Ce210401fdd8c483d2bde08d7b735d3f4%7Cb97188711ee94425953c1ace1373eb38%7C0%7C1%7C637179314141252833&amp;sdata=feVEKUpekTBV5FVzfZDdDU7sJGi6x%2FGtumn3TpmhRuk%3D&amp;reserved=0
Searchable archive at 
https://nam01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.mail-archive.com%2Fr-sig-phylo%40r-project.org%2F&amp;data=02%7C01%7Cliam.revell%40umb.edu%7Ce210401fdd8c483d2bde08d7b735d3f4%7Cb97188711ee94425953c1ace1373eb38%7C0%7C1%7C637179314141252833&amp;sdata=8otz0Vyk02Uo2uGw4fWbOqfuA4EKp8GQ71cZufu3XFg%3D&amp;reserved=0


_______________________________________________
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/

Reply via email to