Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hi , How can i specify a cutoff for the algorithm , #21

Open
ghost opened this issue Sep 9, 2016 · 5 comments
Open

Hi , How can i specify a cutoff for the algorithm , #21

ghost opened this issue Sep 9, 2016 · 5 comments

Comments

@ghost
Copy link

ghost commented Sep 9, 2016

I have test the algorithm on my dataset , the distance height is between 0,1. for example it assign 0, 0, 0 , 0 then the rest are 1.

the distance is a matrix from euclidean distance method .

then if would like cut the tree when distances = 0.5 ?? how can i do that , distances is [][] symatrics matrix.

@lbehnke
Copy link
Owner

lbehnke commented Sep 12, 2016

Look into HierarchyBuilder.agglomerate(), line 92. When the linkage strategy instance returns the distance, you could hook-in a filter.

@ghost
Copy link
Author

ghost commented Sep 15, 2016

Dear Lars,

Thank you very much for your reply :

The code bellow is line 92 of HierarchyBuilder.agglomerate():

Distance newDistance = linkageStrategy.calculateDistance(distanceValues);

            newLinkage.setLinkageDistance(newDistance.getDistance());

            distances.add(newLinkage);

        }
        clusters.add(newCluster);

}

iam sorry iam confused , how can i specify the cutoff ,

the code above is : producing a linkage proximity matrix, i change the code
to :

Distance newDistance = linkageStrategy.calculateDistance(distanceValues);

newLinkage.setLinkageDistance(newDistance.setDistance(0.5));

it does not work , the error is :

Void not allowed

Please need your guidance.

Best

On Mon, Sep 12, 2016 at 10:58 AM, Lars Behnke [email protected]
wrote:

Look into HierarchyBuilder.agglomerate(), line 92. When the linkage
strategy instance returns the distance, you could hook-in a filter.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#21 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AM7ezULDSWxtAMV7v_yPkBZZUWSm0syJks5qpSJggaJpZM4J4_Cm
.

@varungadre09
Copy link

Pls give a reply Ibehnke

@emanlee
Copy link

emanlee commented Aug 2, 2020

Here is a figure on this home page: https://github.com/lbehnke/hierarchical-clustering-java. From this dendrogram, how can we get clusters or groups. For example, if we want get two clusters, it should be [o6] [o1 o2 o3 o4 o5]; If we want get three clusters, it should be [06] [03 05] [01 02 04 ]. How to use codes to get such clusters and output them to console or files? Thanks!

@emanlee
Copy link

emanlee commented Aug 2, 2020

In my case, I have more than 800 samples/genes. After clustering, the dendrogram is very big and complex, therfore, we need to divide/cut/sect the dendrogram into clusters and save them to files (each file contains the gene names and represents a cluster/group).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants