Helper for writing clustering methods that operate on a full
similarity matrix rather than a graph (affinity propagation, binary cut,
k-means on similarity profiles). The SNN graph is already a similarity
matrix with values in [0, 1]; this simply densifies it and keeps the gene
set names as dimnames.
Examples
simMat <- snnToMatrix(exampleGsList@cluster@graphs$GSEA_snn)
simMat[1:3, 1:3]
#> GRADE_COLON_AND_RECTAL_CANCER_UP
#> GRADE_COLON_AND_RECTAL_CANCER_UP 1
#> BENPORATH_NANOG_TARGETS 0
#> GOBERT_OLIGODENDROCYTE_DIFFERENTIATION_UP 0
#> BENPORATH_NANOG_TARGETS
#> GRADE_COLON_AND_RECTAL_CANCER_UP 0
#> BENPORATH_NANOG_TARGETS 1
#> GOBERT_OLIGODENDROCYTE_DIFFERENTIATION_UP 0
#> GOBERT_OLIGODENDROCYTE_DIFFERENTIATION_UP
#> GRADE_COLON_AND_RECTAL_CANCER_UP 0
#> BENPORATH_NANOG_TARGETS 0
#> GOBERT_OLIGODENDROCYTE_DIFFERENTIATION_UP 1