Get subgroup labels

# S4 method for DownSamplingConsensusPartition
get_classes(object, k = object@k, p_cutoff = 0.05, reduce = FALSE)

Arguments

object

A DownSamplingConsensusPartition-class object.

k

Number of subgroups.

p_cutoff

Cutoff of p-values of class label prediction. It is only used when k is a vector.

reduce

Used internally.

Value

If k is a scalar, it returns a data frame with two columns:

  • the class labels

  • the p-value for the prediction of class labels.

If k is a vector, it returns a data frame of class labels for each k. The class label with prediction p-value > p_cutoff is set to NA.

Examples

data(golub_cola_ds)
get_classes(golub_cola_ds, k = 3)
#>           class     p
#> sample_39     2 0.000
#> sample_40     3 0.000
#> sample_42     1 0.000
#> sample_47     1 0.000
#> sample_48     1 0.000
#> sample_49     3 0.000
#> sample_41     1 0.000
#> sample_43     1 0.000
#> sample_44     1 0.000
#> sample_45     1 0.000
#> sample_46     1 0.000
#> sample_70     1 1.000
#> sample_71     2 0.502
#> sample_72     1 0.000
#> sample_68     1 0.000
#> sample_69     1 0.000
#> sample_67     1 0.000
#> sample_55     3 0.000
#> sample_56     3 0.000
#> sample_59     1 0.000
#> sample_52     2 0.000
#> sample_53     2 0.000
#> sample_51     2 0.000
#> sample_50     2 0.000
#> sample_54     1 0.000
#> sample_57     2 0.000
#> sample_58     2 0.000
#> sample_60     1 0.000
#> sample_61     2 0.000
#> sample_65     2 0.000
#> sample_66     1 0.000
#> sample_63     2 0.000
#> sample_64     2 0.000
#> sample_62     2 0.000
#> sample_1      3 0.000
#> sample_2      1 0.000
#> sample_3      3 0.000
#> sample_4      3 0.000
#> sample_5      1 0.000
#> sample_6      3 0.000
#> sample_7      3 0.000
#> sample_8      3 0.000
#> sample_9      1 0.000
#> sample_10     3 0.000
#> sample_11     1 0.000
#> sample_12     2 0.000
#> sample_13     1 0.000
#> sample_14     1 0.000
#> sample_15     1 0.000
#> sample_16     1 0.000
#> sample_17     1 0.000
#> sample_18     3 0.000
#> sample_19     1 0.000
#> sample_20     1 0.000
#> sample_21     1 0.000
#> sample_22     2 0.000
#> sample_23     3 0.000
#> sample_24     1 0.000
#> sample_25     2 0.000
#> sample_26     1 0.000
#> sample_27     3 0.000
#> sample_34     2 0.000
#> sample_35     2 0.000
#> sample_36     2 0.000
#> sample_37     2 0.000
#> sample_38     2 0.000
#> sample_28     2 0.000
#> sample_29     1 0.000
#> sample_30     2 0.000
#> sample_31     2 0.000
#> sample_32     2 0.000
#> sample_33     2 0.000
get_classes(golub_cola_ds)
#>           k=2 k=3 k=4 k=5 k=6
#> sample_39   2   2   2   2  NA
#> sample_40   2   3   3   3  NA
#> sample_42   1   1   4   4   3
#> sample_47   1   1   1   1   1
#> sample_48   1   1   1   1   1
#> sample_49   2   3   3  NA   2
#> 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  NA  NA
#> sample_70   1  NA  NA  NA  NA
#> sample_71   1  NA   4   4   3
#> sample_72   1   1   4   4   3
#> sample_68   1   1   1   1   1
#> sample_69   1   1   1   1   1
#> sample_67   1   1   4   4   3
#> sample_55   2   3   3  NA  NA
#> sample_56   2   3   3  NA  NA
#> sample_59   1   1  NA  NA  NA
#> sample_52   2   2   2  NA  NA
#> sample_53   2   2   2  NA  NA
#> sample_51   2   2   2   2   2
#> sample_50   2   2   2   2   2
#> sample_54   1   1   1  NA  NA
#> sample_57   2   2   2   2   2
#> sample_58   2   2   2   2   2
#> sample_60  NA   1  NA  NA  NA
#> sample_61   2   2   2   2   2
#> 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   2
#> sample_62   2   2   2   2   2
#> sample_1    2   3   3   3  NA
#> sample_2    1   1   4   4   3
#> sample_3    2   3   3   3   3
#> sample_4    2   3   3   3  NA
#> sample_5    1   1   1   1   1
#> sample_6    2   3   3   3  NA
#> sample_7    2   3   3   3   2
#> sample_8    2   3   3  NA   2
#> sample_9    1   1   1  NA  NA
#> sample_10   2   3   3  NA   3
#> sample_11   1   1   4   4   3
#> sample_12   2   2   2   2   2
#> sample_13   1   1   1   1   1
#> sample_14   1   1   1   1  NA
#> sample_15   1   1   1   1   1
#> sample_16   1   1   1   1   1
#> sample_17   1   1   1   1  NA
#> sample_18   2   3   3  NA  NA
#> 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  NA  NA  NA
#> sample_23   2   3   3   3   3
#> sample_24   1   1   1   1   1
#> sample_25   2   2   2  NA  NA
#> sample_26   1   1  NA  NA  NA
#> sample_27   2   3   3   3   2
#> sample_34   2   2   2   2   2
#> sample_35   2   2   2   2   2
#> 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  NA
#> sample_29   1   1   4   4   3
#> sample_30   2   2   2  NA  NA
#> sample_31   2   2   2   2   2
#> sample_32   2   2   2   2   2
#> sample_33   2   2   2   2   2