Skip to contents

Order_cols can re-set the order of a SummarizedExperiment object according colData()

Usage

Order_cols(object, order, order_column = "condition")

Arguments

object

a SummarizedExperiment object

order

Character vector, the order to set.

order_column

Set order on which column of experiment design, e.g. "condition", "label"

Value

A object sorted by giving order

Examples

# Load example
data(Silicosis_pg)
data <- Silicosis_pg
data_unique <- make_unique(data, "Gene.names", "Protein.IDs", delim = ";")
# Make SummarizedExperiment
ecols <- grep("LFQ.", colnames(data_unique))
se <- make_se_parse(data_unique, ecols, mode = "delim", sep = "_")
colnames(se)
#>  [1] "PBS_1" "PBS_2" "PBS_3" "PBS_4" "W10_2" "W10_4" "W2_1"  "W2_3"  "W2_4" 
#> [10] "W2_5"  "W4_2"  "W4_3"  "W4_4"  "W4_5"  "W6_2"  "W6_3"  "W6_4"  "W6_6" 
#> [19] "W9_2"  "W9_4" 
se <- Order_cols(se,c("PBS","W2","W4","W6","W9","W10"))
colnames(se)
#>  [1] "PBS_1" "PBS_2" "PBS_3" "PBS_4" "W2_1"  "W2_3"  "W2_4"  "W2_5"  "W4_2" 
#> [10] "W4_3"  "W4_4"  "W4_5"  "W6_2"  "W6_3"  "W6_4"  "W6_6"  "W9_2"  "W9_4" 
#> [19] "W10_2" "W10_4"