Get subgroup labels

# S4 method for ConsensusPartition
get_classes(object, k = object@k)

Arguments

object

A ConsensusPartition-class object.

k

Number of subgroups.

Value

A data frame with subgroup labels and other columns which are entropy of the percent membership matrix and the silhouette scores which measure the stability of a sample to stay in its group.

If k is not specified, it returns a data frame with subgroup labels from all k.

Author

Zuguang Gu <z.gu@dkfz.de>

Examples

data(golub_cola)
obj = golub_cola["ATC", "skmeans"]
get_classes(obj, k = 2)
#>           class   entropy silhouette
#> sample_39     2 0.0000000  0.9983218
#> sample_40     2 0.0000000  0.9983218
#> sample_42     1 0.0000000  0.9970421
#> sample_47     1 0.0000000  0.9970421
#> sample_48     1 0.0000000  0.9970421
#> sample_49     2 0.0000000  0.9983218
#> sample_41     1 0.0000000  0.9970421
#> sample_43     1 0.0000000  0.9970421
#> sample_44     1 0.0000000  0.9970421
#> sample_45     1 0.0000000  0.9970421
#> sample_46     1 0.0000000  0.9970421
#> sample_70     1 0.0000000  0.9970421
#> sample_71     1 0.0000000  0.9970421
#> sample_72     1 0.0000000  0.9970421
#> sample_68     1 0.0000000  0.9970421
#> sample_69     1 0.0000000  0.9970421
#> sample_67     1 0.0000000  0.9970421
#> sample_55     2 0.0000000  0.9983218
#> sample_56     2 0.0000000  0.9983218
#> sample_59     1 0.0000000  0.9970421
#> sample_52     2 0.0000000  0.9983218
#> sample_53     2 0.0000000  0.9983218
#> sample_51     2 0.0000000  0.9983218
#> sample_50     2 0.0000000  0.9983218
#> sample_54     1 0.0000000  0.9970421
#> sample_57     2 0.0000000  0.9983218
#> sample_58     2 0.0000000  0.9983218
#> sample_60     1 0.0000000  0.9970421
#> sample_61     2 0.0000000  0.9983218
#> sample_65     2 0.0000000  0.9983218
#> sample_66     1 0.0000000  0.9970421
#> sample_63     2 0.0000000  0.9983218
#> sample_64     2 0.0000000  0.9983218
#> sample_62     2 0.0000000  0.9983218
#> sample_1      2 0.0000000  0.9983218
#> sample_2      1 0.0000000  0.9970421
#> sample_3      2 0.0000000  0.9983218
#> sample_4      2 0.3274449  0.9358102
#> sample_5      1 0.0000000  0.9970421
#> sample_6      2 0.0000000  0.9983218
#> sample_7      2 0.0000000  0.9983218
#> sample_8      2 0.0000000  0.9983218
#> sample_9      1 0.0000000  0.9970421
#> sample_10     1 0.0000000  0.9970421
#> sample_11     1 0.0000000  0.9970421
#> sample_12     2 0.0000000  0.9983218
#> sample_13     1 0.0000000  0.9970421
#> sample_14     1 0.0000000  0.9970421
#> sample_15     1 0.0000000  0.9970421
#> sample_16     1 0.0000000  0.9970421
#> sample_17     1 0.0000000  0.9970421
#> sample_18     1 0.4689956  0.8885003
#> sample_19     1 0.0000000  0.9970421
#> sample_20     1 0.0000000  0.9970421
#> sample_21     1 0.0000000  0.9970421
#> sample_22     2 0.0000000  0.9983218
#> sample_23     2 0.0000000  0.9983218
#> sample_24     1 0.0000000  0.9970421
#> sample_25     2 0.0000000  0.9983218
#> sample_26     1 0.0000000  0.9970421
#> sample_27     2 0.0000000  0.9983218
#> sample_34     2 0.0000000  0.9983218
#> sample_35     2 0.0000000  0.9983218
#> sample_36     2 0.0000000  0.9983218
#> sample_37     2 0.0000000  0.9983218
#> sample_38     2 0.0000000  0.9983218
#> sample_28     2 0.0000000  0.9983218
#> sample_29     1 0.0000000  0.9970421
#> sample_30     2 0.0000000  0.9983218
#> sample_31     2 0.0000000  0.9983218
#> sample_32     2 0.0000000  0.9983218
#> sample_33     2 0.0000000  0.9983218
get_classes(obj)
#>           k=2 k=3 k=4 k=5 k=6
#> sample_39   2   3   4   4   4
#> sample_40   2   3   4   4   4
#> sample_42   1   1   3   3   6
#> sample_47   1   1   1   1   1
#> sample_48   1   1   1   1   1
#> sample_49   2   3   4   4   4
#> sample_41   1   1   1   1   1
#> sample_43   1   1   1   1   1
#> sample_44   1   1   1   1   1
#> sample_45   1   1   1   1   1
#> sample_46   1   1   1   1   1
#> sample_70   1   1   1   1   1
#> sample_71   1   1   3   3   6
#> sample_72   1   1   3   3   6
#> sample_68   1   1   1   1   1
#> sample_69   1   1   1   1   1
#> sample_67   1   1   3   3   6
#> sample_55   2   3   4   4   4
#> sample_56   2   3   4   4   4
#> sample_59   1   1   1   1   5
#> sample_52   2   2   2   2   2
#> sample_53   2   2   2   2   2
#> sample_51   2   2   2   2   2
#> sample_50   2   2   2   2   2
#> sample_54   1   1   1   1   5
#> sample_57   2   2   2   2   2
#> sample_58   2   2   2   2   4
#> sample_60   1   1   1   5   5
#> sample_61   2   2   2   2   4
#> sample_65   2   2   2   2   2
#> sample_66   1   1   1   1   1
#> sample_63   2   2   2   2   2
#> sample_64   2   2   2   2   4
#> sample_62   2   2   2   2   2
#> sample_1    2   3   4   4   4
#> sample_2    1   1   3   3   6
#> sample_3    2   3   4   4   3
#> sample_4    2   3   4   4   4
#> sample_5    1   1   1   1   1
#> sample_6    2   3   4   4   3
#> sample_7    2   3   4   4   4
#> sample_8    2   3   4   4   4
#> sample_9    1   1   1   1   1
#> sample_10   1   1   3   3   3
#> sample_11   1   1   3   1   1
#> sample_12   2   2   2   2   2
#> sample_13   1   1   1   1   1
#> sample_14   1   1   1   1   1
#> sample_15   1   1   1   1   1
#> sample_16   1   1   1   1   1
#> sample_17   1   1   1   1   1
#> sample_18   1   3   3   5   5
#> sample_19   1   1   1   1   1
#> sample_20   1   1   1   1   1
#> sample_21   1   1   1   1   1
#> sample_22   2   2   2   2   2
#> sample_23   2   3   4   4   3
#> sample_24   1   1   1   1   1
#> sample_25   2   2   2   2   2
#> sample_26   1   1   1   3   5
#> sample_27   2   3   4   4   4
#> sample_34   2   2   2   2   2
#> sample_35   2   2   2   2   4
#> sample_36   2   2   2   2   2
#> sample_37   2   2   2   2   2
#> sample_38   2   2   2   2   2
#> sample_28   2   2   2   2   2
#> sample_29   1   1   3   3   6
#> sample_30   2   2   2   2   2
#> sample_31   2   2   2   2   2
#> sample_32   2   2   2   2   2
#> sample_33   2   2   2   2   2