Reward users that use consistent names for files by parsing file names into
new variables and adding them to cyto_details
. Variable construction
may not be perfect if certain files are named differently, but it will give a
starting point for editing these values using cyto_details_edit
without having to manually enter a lot of these details.
cyto_names_parse(x, vars = NULL, split = "_", exclude = NULL, ...)
x | object of class flowSet or GatingSet. |
---|---|
vars | vector containing the names of the variables to be added to
|
split | delimiter to split the file name into fragments, set to "_" by default. |
exclude | vector of indices indicating which text fragments should not be included in the experiment details, set to NULL by default. |
... | additional arguments passed to
|
flowSet or GatingSet with cyto_details
updated with new
variables extracted from the file names.
Dillon Hammill, Dillon.Hammill@anu.edu.au
library(CytoExploreRData) # Parse file names to variables fs <- cyto_names_parse(Activation, vars = c("sample_type", "sample_id"), split = "_") # Updated experiment details cyto_details(fs)#> name OVAConc Treatment sample_type sample_id #> Activation_1.fcs Activation_1.fcs 0 Stim-A Activation 1 #> Activation_2.fcs Activation_2.fcs 0 Stim-A Activation 2 #> Activation_3.fcs Activation_3.fcs 5 Stim-A Activation 3 #> Activation_4.fcs Activation_4.fcs 5 Stim-A Activation 4 #> Activation_5.fcs Activation_5.fcs 50 Stim-A Activation 5 #> Activation_6.fcs Activation_6.fcs 50 Stim-A Activation 6 #> Activation_7.fcs Activation_7.fcs 500 Stim-A Activation 7 #> Activation_8.fcs Activation_8.fcs 500 Stim-A Activation 8 #> Activation_9.fcs Activation_9.fcs 0 Stim-B Activation 9 #> Activation_10.fcs Activation_10.fcs 0 Stim-B Activation 10 #> Activation_11.fcs Activation_11.fcs 5 Stim-B Activation 11 #> Activation_12.fcs Activation_12.fcs 5 Stim-B Activation 12 #> Activation_13.fcs Activation_13.fcs 50 Stim-B Activation 13 #> Activation_14.fcs Activation_14.fcs 50 Stim-B Activation 14 #> Activation_15.fcs Activation_15.fcs 500 Stim-B Activation 15 #> Activation_16.fcs Activation_16.fcs 500 Stim-B Activation 16 #> Activation_17.fcs Activation_17.fcs 0 Stim-C Activation 17 #> Activation_18.fcs Activation_18.fcs 0 Stim-C Activation 18 #> Activation_19.fcs Activation_19.fcs 5 Stim-C Activation 19 #> Activation_20.fcs Activation_20.fcs 5 Stim-C Activation 20 #> Activation_21.fcs Activation_21.fcs 50 Stim-C Activation 21 #> Activation_22.fcs Activation_22.fcs 50 Stim-C Activation 22 #> Activation_23.fcs Activation_23.fcs 500 Stim-C Activation 23 #> Activation_24.fcs Activation_24.fcs 500 Stim-C Activation 24 #> Activation_25.fcs Activation_25.fcs 0 Stim-D Activation 25 #> Activation_26.fcs Activation_26.fcs 0 Stim-D Activation 26 #> Activation_27.fcs Activation_27.fcs 5 Stim-D Activation 27 #> Activation_28.fcs Activation_28.fcs 5 Stim-D Activation 28 #> Activation_29.fcs Activation_29.fcs 50 Stim-D Activation 29 #> Activation_30.fcs Activation_30.fcs 50 Stim-D Activation 30 #> Activation_31.fcs Activation_31.fcs 500 Stim-D Activation 31 #> Activation_32.fcs Activation_32.fcs 500 Stim-D Activation 32 #> Activation_33.fcs Activation_33.fcs 0 NA Activation 33