Skip to content

R implementation of louvain clustering  #6

@Yaseswini

Description

@Yaseswini

Hi,

Thanks for the great work! I am trying to reproduce the Louvain clustering algorithm results using R. I am following the methods section of your paper and also the python code . But I think I am missing a step or two in working towards achieving the same cluster annotations as in your paper . I am wondering if any of you could help!

  1. Downloaded the pan-cancer signatures file from https://science.bostongene.com/tumor-portrait/downloads ( downloads -> TCGA -> signatures.csv ).

  2. Filtered the normalized ssgsea scores for pancreatic adenocarcinoma(PAAD) samples ( n = 146 ) . Resultant matrix ( M ) is 29 * 146

  3. Performed patient wise correlation on the matrix M using pearson -> Resultant is a 146 * 146 matrix of correlations between the patients. Code is below . Bagaev_TCGA_signatures is a 29 * 146 matrix containing the ssgsea scores

    correlation_matrix = cor( bagaev_TCGA_signatures , method = "pearson" )

  4. Filtered out correlations less than 0.45

    cor_to_dist = cor2dist( correlation_matrix )
    cor_to_dist[ which( abs( correlation_matrix ) < 0.45 ) ] = 0
    diag(cor_to_dist) = 0

  5. Converted this data frame to weighted graph using the igraph package

correlationGraph = graph.adjacency( cor_to_dist , method = "undirected" , weighted = "TRUE" , diag = TRUE )

  1. Clustering the graph using louvain clustering ( package : igraph )

clusterlouvain = cluster_louvain(correlationGraph)

The issue is that the above the louvain clustering gives me 6 clusters instead of 4. Is there any parameter or anything trivial i am missing in implementing your workflow?

Any help would be appreciated !
Thanks
Yaseswini

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions