subprocess is the good module for running external programs from python (much better than the older os.system.
subprocess.check_call is a simple function for running an external program and checking that it worked.
from subprocess import check_call
Here's a unix-specific command to find where I installed cluster
!which cluster
Simply invoke the program with no arguments.
check_call(("/home/mvoorhie/bin/cluster"))
Cluster the example data, using pearson distances (-g 1) and maximum linkage clustering (-m m), generating output cdt and gtr files prefixed with "test"
check_call(("/home/mvoorhie/bin/cluster",
"-f","supp2data.cdt",
"-u","test",
"-m","m",
"-g","1"))
Here's where cluster3 is expected to live on OS X and Windows:
!ls -lrth | tail
At this point, I opened the output files in JavaTreeView by selecting test.cdt from File->Open