You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am currently using the phangorn package to perform a parsimony analysis on a dataset of Clematis sequences. I have encountered an issue while attempting to apply character weights using the optim.parsimony function.
Here is the code snippet I used to set the weights:
The analysis runs without errors, but I noticed that the results do not differ from those obtained without applying the weights. This led me to wonder if I am correctly applying the character weights, or if there is an alternative approach I should consider.
Could you please confirm whether my current use of the weight parameter in optim.parsimony is correct? If not, I would greatly appreciate any guidance or alternative methods you might suggest for incorporating character weights in parsimony analysis using phangorn.
Thank you very much for your time and for developing such a valuable tool for the community.
Best regards,
Xinru
Huazhong Agriculture Uuiversity
The text was updated successfully, but these errors were encountered:
Dear @Xinru99,
the optim.parsimony and pratchet functions do not have an argument weight.
See e.g. the help file ?optim.parsimony.
Can you describe what these weight should achieve. Are these weights for each column in your alignment?
The phyDat object contains an argument weight, you might try attr(Clematis_seq, "weight"). In case of an DNA alignment the weight are the counts of how often each column in the alignment is seen.
Actually, I have a morphological matrix, and each column is a species trait with different importance in its evolution IMO, so I want to reflect the importance during the tree reconstruction. The example data is listed below:
Here is my matrix:
A 00011102100030001000100?200100010
B 0000?101100110001000100?001000111
C 00000101110111111000110?000210101
D 00000103110120001000010?201100211
E 0000?102000110001000??0?301210221
F 000001011101100010001000000110121
Here are the corresponding weights for the matrix of each column above: Cweight <- c(13.54, 1.81, 1.32, 4.30, 3.80, 1.07, 2.68, 1.16, 1.50, 2.64, 4.47, 1.96, 4.08, 9.12, 6.74, 1.31, 0.83, 1.75, 8.48, 2.36, 1.43, 1.73, 2.67, 1.13, 3.39, 1.09, 3.47, 0.81, 1.39, 2.65, 1.94, 1.09, 2.27)
I've checked the usage of phyDat, but failed to find the argument weight. Please help.
By the way, is it possible to add a constraint tree?
Dear Dr. Schliep,
I hope this message finds you well.
I am currently using the
phangorn
package to perform a parsimony analysis on a dataset of Clematis sequences. I have encountered an issue while attempting to apply character weights using theoptim.parsimony
function.Here is the code snippet I used to set the weights:
The analysis runs without errors, but I noticed that the results do not differ from those obtained without applying the weights. This led me to wonder if I am correctly applying the character weights, or if there is an alternative approach I should consider.
Could you please confirm whether my current use of the
weight
parameter inoptim.parsimony
is correct? If not, I would greatly appreciate any guidance or alternative methods you might suggest for incorporating character weights in parsimony analysis usingphangorn
.Thank you very much for your time and for developing such a valuable tool for the community.
Best regards,
Xinru
Huazhong Agriculture Uuiversity
The text was updated successfully, but these errors were encountered: