The pure Perl version of this has now been implemented as http://p3rl.org/Algorithm::Cluster::Thresh for those who are interested.
Question: Clustering in Perl |
||
2
|
I'm currently using Algorithm::Cluster, which is based on the C Clustering Library, to cluster sequences and structures in Perl. Algorithm::Cluster provides many clustering facilities, including hierarchical clustering. Given the desired number of clusters, it builds the tree and cuts it. What I need, however, is a library that allows for a threshold. Something like: all of the members of one cluster are <= X distance apart, or: any two members of different clusters are >= X distance apart. Is this possible in Algorithm::Cluster? Or is there another (Perl) module that would, given a distance matrix and a threshold, determine the appropriate number of clusters and their members? |
|
|
| ||
4
|
I've submitted a patch against Algorithm::Cluster to allow:
The patch adds an XS interface (i.e. the code is in C). You can find it on this bug report: https://rt.cpan.org/Public/Bug/Display.html?id=68482 Those interested in a quick Pure Perl solution can use this example which uses some undocumented XS interfaces:
|
|
|
The pure Perl version of this has now been implemented as http://p3rl.org/Algorithm::Cluster::Thresh for those who are interested. | ||
1
|
Do you have to use Perl? I am a huge fan of Perl but for these sort of tasks I would use R. I have used this website to learn clustering in R. You can still use Perl to connect with R if you have to. I played with RSPerl for a while but in the end it was easier for me just to use R scripts. |
|
|
| ||