Hello everyone!
I have a distance matrix; https://ibb.co/h2vCbyt
And I want to perform UPGMA algorithm step by step. I know there's a function for that already but I want to learn better.
So the point is I want to find the coordinates of minimum value and calculate the average for each distances.
i.e.;
Minimum value in here is : A - B = 1. So I have to connect these two together to do end-joining. So the updated matrix will contain AB vs all. Like from AB to C is going to be (AB+C)/2 which is 12+13/2=12.5. Until there's only one node -> 0 is left. This will mean all the nodes are connected to each other.
In sum, the output will look like this: https://ibb.co/C9GnYs7
Then I'm going to plot a dendrogram which is a piece of cake...
When I try to merge AB, R doesn't calculate the average or vise versa. I don't know what to do and I want to understand the language of R. I do it in python or manually on paper -:)- but in R it's driving me crazy for like more than a week and I didn't know what to do except asking you.
Can you please help me? I'm new in R and I'm so curious about it as well and trying to learn it all by myself. It's an easy thing but I'm having a brain freeze.
0 answers
No answers yet.
Log in to answer this question.
This is not a bioinformatics question but a programming one. Try asking on StackOverflow. As a starting point, look at the source code of existing functions that do what you want and see if you understand what they do and how they do it.
Hello iremsnmn!
We believe that this post does not fit the main topic of this site.
This is not a bioinformatics question
For this reason we have closed your question. This allows us to keep the site focused on the topics that the community can help with.
If you disagree please tell us why in a reply below, we'll be happy to talk about it.
Cheers!