Nikos Sgourakis wrote:
Dear GROMACS users,

Here I have implemented the k-means clustering algorithm in the original GROMACS module, gmx_cluster.c (called by the wrapper g_cluster). k-means is a heuristic algorithm that finds the partition of n points (conformations) in k groups (clusters), such that the sum of the distances of each point from the centroid of its belonging cluster is minimized.
To compile, re-run make after replacing the original file: `make g_cluster`
Most of the in-line options of the original program work. However, there are no output structure files. Instead, `./g_cluster -method kmeans etc` will produce a file with the indeces of all conformations within each one of the k clusters (k-means.dat), and a list of all centroids (centroids.dat). The conformations can then be easily retrieved from the original trajectory file. Please, let me know of any difficulties in compiling/running kmeans for GROMACS.

Nikos



Nikos,

first, thanks for contributing to gromacs. I have some questions about your code though. Have you run this code at all, and if so on what platform and with which compiler? The code contains this:

void kmeans(int k)
{
  int distr[k];

etc.

which is not standard C as far as I know. You can replace this by:

  int *dist;
  snew(distr,k);
  ....

  sfree(distr);

where snew and sfree are gromacs macros for allocating an array with length k for arbitrary data types.

It would also be nice if you use a uniform indentation, preferable the emacs default.

Regards,
--
David.
________________________________________________________________________
David van der Spoel, PhD, Assoc. Prof., Molecular Biophysics group,
Dept. of Cell and Molecular Biology, Uppsala University.
Husargatan 3, Box 596,          75124 Uppsala, Sweden
phone:  46 18 471 4205          fax: 46 18 511 755
[EMAIL PROTECTED]       [EMAIL PROTECTED]   http://folding.bmc.uu.se
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
_______________________________________________
gmx-users mailing list    gmx-users@gromacs.org
http://www.gromacs.org/mailman/listinfo/gmx-users
Please don't post (un)subscribe requests to the list. Use the www interface or send it to [EMAIL PROTECTED]
Can't post? Read http://www.gromacs.org/mailing_lists/users.php

Reply via email to