JClavel / mvMORPH

mvMORPH: an R package for fitting multivariate evolutionary models to morphometric data
17 stars 5 forks source link

importing data for an ancestral state reconstruction #11

Closed charlllie closed 2 years ago

charlllie commented 2 years ago

When I've imported my data (in my case PC scores imported from excel) and set the species names from my phylogenetic trees as my rownames my data appears in order when I view it in r. However, when I do the ancestral state reconstruction I get this error message: Error in C1[rownames(data), rownames(data)] : subscript out of bounds. Does anyone know how to overcome this problem?

JClavel commented 2 years ago

Dear @charlllie , One possibility is that the size of the data and the tree doesn't match. But I need a reproducible example to track back any issues. You can send it by email and specify which version of the package that you're using. Regards,

Julien

charlllie commented 2 years ago

Hi Julien,  Thank you so much for the quick reply! I'm using mvMORPH_1.1.6. I did double check that the data and the tree match up.  The rownames are there in my data and match my tree so I don't understand where the problem lies. Let me know if you need me to send you anything else. Thanks again, Charlotte  Am Freitag, 12. August 2022, 19:24:42 MESZ hat JClavel @.***> Folgendes geschrieben:

Dear @charlllie , One possibility is that the size of the data and the tree doesn't match. But I need a reproducible example to track back any issues. You can send it by email and specify which version of the package that you're using. Regards,

Julien

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

JClavel commented 2 years ago

Hi Charlotte,

As mentioned in my earlier message, I need a worked example (either a contrived one, or a reproducible one with your specific dataset) to be able to track down the problem.

Regards,

Julien

*after checking, it's likely that something happen in the mvBM (rather than in ancestral estimation) function. The location of the error suggests a mismatch between names in your tree and your dataset. Try this first:

if(!any(tree$tip.label%in%rownames(data)!=TRUE) & nrow(data)==Ntip(tree)) cat("no mismatch") else cat("there's a problem")


De : charlllie @.> Envoyé : vendredi 12 août 2022 20:04 À : JClavel/mvMORPH @.> Cc : JClavel @.>; State change @.> Objet : Re: [JClavel/mvMORPH] importing data for an ancestral state reconstruction (Issue #11)

Hi Julien, Thank you so much for the quick reply! I'm using mvMORPH_1.1.6. I did double check that the data and the tree match up. The rownames are there in my data and match my tree so I don't understand where the problem lies. Let me know if you need me to send you anything else. Thanks again, Charlotte Am Freitag, 12. August 2022, 19:24:42 MESZ hat JClavel @.***> Folgendes geschrieben:

Dear @charlllie , One possibility is that the size of the data and the tree doesn't match. But I need a reproducible example to track back any issues. You can send it by email and specify which version of the package that you're using. Regards,

Julien

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

— Reply to this email directly, view it on GitHubhttps://github.com/JClavel/mvMORPH/issues/11#issuecomment-1213376378, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ACSCJSJWO7YRFAEM5RVELQLVY2GZPANCNFSM56MJOEVQ. You are receiving this because you modified the open/close state.Message ID: @.***>

charlllie commented 2 years ago

Hi Julien,  I've attached the r script I'm working with, as well as a sample of my dataset. The phylogenetic tree I am referencing sometimes splits into more than two groups at one node, but the code always splits these. It does it differently every time though, so my dataset has to be adjusted in sequence to match the tree the code produces. 

Am Samstag, 13. August 2022, 23:50:36 MESZ hat JClavel ***@***.***> Folgendes geschrieben:  

Hi Charlotte,

As mentioned in my earlier message, I need a worked example (either a contrived one, or a reproducible one with your specific dataset) to be able to track down the problem. Regards,

Julien


De : charlllie @.> Envoyé : vendredi 12 août 2022 20:04 À : JClavel/mvMORPH @.> Cc : JClavel @.>; State change @.> Objet : Re: [JClavel/mvMORPH] importing data for an ancestral state reconstruction (Issue #11)

Hi Julien, Thank you so much for the quick reply! I'm using mvMORPH_1.1.6. I did double check that the data and the tree match up. The rownames are there in my data and match my tree so I don't understand where the problem lies. Let me know if you need me to send you anything else. Thanks again, Charlotte Am Freitag, 12. August 2022, 19:24:42 MESZ hat JClavel @.***> Folgendes geschrieben:

Dear @charlllie , One possibility is that the size of the data and the tree doesn't match. But I need a reproducible example to track back any issues. You can send it by email and specify which version of the package that you're using. Regards,

Julien

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

— Reply to this email directly, view it on GitHubhttps://github.com/JClavel/mvMORPH/issues/11#issuecomment-1213376378, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ACSCJSJWO7YRFAEM5RVELQLVY2GZPANCNFSM56MJOEVQ. You are receiving this because you modified the open/close state.Message ID: @.***>

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

charlllie commented 2 years ago

Sorry, I accidentally sent that before attaching my data. I called my FADLAD data set occ in the code.  Thanks for looking at this! Best wishes, Charlotte Am Sonntag, 14. August 2022, 17:36:59 MESZ hat Charlotte König @.***> Folgendes geschrieben:

Hi Julien,  I've attached the r script I'm working with, as well as a sample of my dataset. The phylogenetic tree I am referencing sometimes splits into more than two groups at one node, but the code always splits these. It does it differently every time though, so my dataset has to be adjusted in sequence to match the tree the code produces. 

Am Samstag, 13. August 2022, 23:50:36 MESZ hat JClavel ***@***.***> Folgendes geschrieben:  

Hi Charlotte,

As mentioned in my earlier message, I need a worked example (either a contrived one, or a reproducible one with your specific dataset) to be able to track down the problem. Regards,

Julien


De : charlllie @.> Envoyé : vendredi 12 août 2022 20:04 À : JClavel/mvMORPH @.> Cc : JClavel @.>; State change @.> Objet : Re: [JClavel/mvMORPH] importing data for an ancestral state reconstruction (Issue #11)

Hi Julien, Thank you so much for the quick reply! I'm using mvMORPH_1.1.6. I did double check that the data and the tree match up. The rownames are there in my data and match my tree so I don't understand where the problem lies. Let me know if you need me to send you anything else. Thanks again, Charlotte Am Freitag, 12. August 2022, 19:24:42 MESZ hat JClavel @.***> Folgendes geschrieben:

Dear @charlllie , One possibility is that the size of the data and the tree doesn't match. But I need a reproducible example to track back any issues. You can send it by email and specify which version of the package that you're using. Regards,

Julien

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

— Reply to this email directly, view it on GitHubhttps://github.com/JClavel/mvMORPH/issues/11#issuecomment-1213376378, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ACSCJSJWO7YRFAEM5RVELQLVY2GZPANCNFSM56MJOEVQ. You are receiving this because you modified the open/close state.Message ID: @.***>

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

JClavel commented 2 years ago

Hi Charlotte,

I'm sorry I did not received any datasets. Try first this small piece of code (I suspect a formatting problem when using mvBM):

if(!any(tree$tip.label%in%rownames(data)!=TRUE) & nrow(data)==Ntip(tree)) cat("no mismatch") else cat("there's a problem")

and if this is not working, then send me the reproducible example directly by email (to the address written on the Package help pages).

Regards,

Julien


De : charlllie @.> Envoyé : dimanche 14 août 2022 17:40 À : JClavel/mvMORPH @.> Cc : JClavel @.>; State change @.> Objet : Re: [JClavel/mvMORPH] importing data for an ancestral state reconstruction (Issue #11)

Sorry, I accidentally sent that before attaching my data. I called my FADLAD data set occ in the code. Thanks for looking at this! Best wishes, Charlotte Am Sonntag, 14. August 2022, 17:36:59 MESZ hat Charlotte König @.***> Folgendes geschrieben:

Hi Julien, I've attached the r script I'm working with, as well as a sample of my dataset. The phylogenetic tree I am referencing sometimes splits into more than two groups at one node, but the code always splits these. It does it differently every time though, so my dataset has to be adjusted in sequence to match the tree the code produces.

Am Samstag, 13. August 2022, 23:50:36 MESZ hat JClavel @.***> Folgendes geschrieben:

Hi Charlotte,

As mentioned in my earlier message, I need a worked example (either a contrived one, or a reproducible one with your specific dataset) to be able to track down the problem. Regards,

Julien


De : charlllie @.> Envoyé : vendredi 12 août 2022 20:04 À : JClavel/mvMORPH @.> Cc : JClavel @.>; State change @.> Objet : Re: [JClavel/mvMORPH] importing data for an ancestral state reconstruction (Issue #11)

Hi Julien, Thank you so much for the quick reply! I'm using mvMORPH_1.1.6. I did double check that the data and the tree match up. The rownames are there in my data and match my tree so I don't understand where the problem lies. Let me know if you need me to send you anything else. Thanks again, Charlotte Am Freitag, 12. August 2022, 19:24:42 MESZ hat JClavel @.***> Folgendes geschrieben:

Dear @charlllie , One possibility is that the size of the data and the tree doesn't match. But I need a reproducible example to track back any issues. You can send it by email and specify which version of the package that you're using. Regards,

Julien

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

— Reply to this email directly, view it on GitHubhttps://github.com/JClavel/mvMORPH/issues/11#issuecomment-1213376378, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ACSCJSJWO7YRFAEM5RVELQLVY2GZPANCNFSM56MJOEVQ. You are receiving this because you modified the open/close state.Message ID: @.***>

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

— Reply to this email directly, view it on GitHubhttps://github.com/JClavel/mvMORPH/issues/11#issuecomment-1214402852, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ACSCJSKSM3U3SOW7ED3IB33VZEHOZANCNFSM56MJOEVQ. You are receiving this because you modified the open/close state.Message ID: @.***>