library( GSNA )
# After gsnAssignSubnets() has been called, a list containing subnet
# assignments is stored in GSNData objects at
# object$distances[[distance]]$subnets
# It has this structure:
subnets <- list( `1` = c( "M30131", "M40742", "M29968", "M29984", "M29922",
"M30190", "M40775", "M30171", "M30154", "M30186" ),
`2` = c( "M40770" ),
`3` = c( "M30055", "M30117" ),
`4` = c( "M40804" ),
`5` = c( "M40776" ),
`6` = c( "M40846" ) )
# Based on this, singltons, subnets/clusters with single membership
# are assigned black, and subnets with multiple members are assigned
# colors using a color wheel:
colors_v <- gsnDendroSubnetColors( subnets )
# gsnDendroSubnetColors_dark does the same thing as
# gsnDendroSubnetColors, but picks darker colors.
dark_colors_v <- gsnDendroSubnetColors_dark( subnets )
Run the code above in your browser using DataLab