views:

36

answers:

1

EDIT: I figured it out. Just did not understand notation.

Hello,

Hopefully someone out there is familiar with the clustergram in the bioinformatics toolbox. I am interested in the graphical aspects of the function (the dendrogram/heat map), but am currently handicapped as it requires me to use Matlab's cluster() function. I would prefer to use my personal algorithm to cluster, and then allow Matlab to visualize this for me.

I have searched the code, but am woefully ignorant about object oriented programming in general, and Matlab's version in particular. Thus all I know is the function calls the line 'obj = obj.getclusters', but have no idea how to edit it this such that I use my own clustering algorithm instead of Matlab's.

Any help is appreciated!

EDIT: I am specifically working on a new algorithm, hence why I have no need for pdist or linkage. The dendrograms are calculated outside the clustergram function. All I am using to create the dendrogram/heatmap is the clustergram function. My Bioinformatics toolbox is version 3.3

Really, all I am looking for here is what the hell does 'obj = obj.getclusters;' do? I am not a programmer and really am not familiar with OO. To me, that looks like we magically have clusters, as there is no function call. This is at line 304 of clustergram()

A: 

First I have later versions of Bioinformatics Toolbox (3.4 and later), and for those versions clustergram.m file does not have the line obj = obj.getclusters;

Remember CLUSTERGRAM in the class (not function as it was it older version). When you run clustergram(data,...) you actually run the constructor method of this class to create clustergram object. This object is obj variable. So when you run obj = obj.getclusters; you actually run getclusters method in clustergram class, which updates the object obj.

To get more details what getclusters method is doing look for a following line in methods block:

    function obj = getcluster(obj)

In the latest versions there is method computeClusters defined as

    function computeClusters(obj)

This method computes both dendrograms for rows and columns and updates the object. You can directly alter this function, of course, but I wouldn't recommend it. It's much better to develop separate functions for distance metric and linkage and use those functions to construct clustergram object.

If your algorithm does not use distance and linkage, please explain how it's suppose to build dendrograms. Does it create linkage matrix same as output of LINKAGE function? Without such matrix I don't think you can use clustergram even for visualization only. Do you have an example how your clustergram should look like? May be you can use Heatmap class of other simpler functions like IMAGE or IMAGESC.

yuk