When you use the functions which need specific identification for Subject or QC samples in class of sample_info, if there is a error:

Error: error: No Subject samples in object, please check and see here:

You need to change the column class in sample_info.

Step 1: check the class in your sample_info

library(masscleaner)
library(tidyverse)
object@sample_info$class
#>   [1] "case"    "case"    "case"    "case"    "case"    "case"    "case"   
#>   [8] "case"    "case"    "case"    "case"    "case"    "case"    "case"   
#>  [15] "case"    "case"    "case"    "case"    "case"    "case"    "case"   
#>  [22] "case"    "case"    "case"    "case"    "case"    "case"    "case"   
#>  [29] "case"    "case"    "case"    "case"    "case"    "case"    "case"   
#>  [36] "case"    "case"    "case"    "case"    "case"    "case"    "case"   
#>  [43] "case"    "case"    "case"    "case"    "case"    "case"    "case"   
#>  [50] "case"    "case"    "case"    "case"    "case"    "case"    "case"   
#>  [57] "case"    "case"    "case"    "case"    "case"    "case"    "case"   
#>  [64] "case"    "case"    "case"    "case"    "case"    "case"    "case"   
#>  [71] "case"    "case"    "case"    "case"    "case"    "case"    "case"   
#>  [78] "case"    "case"    "case"    "case"    "case"    "case"    "case"   
#>  [85] "case"    "case"    "case"    "case"    "case"    "case"    "case"   
#>  [92] "case"    "case"    "case"    "case"    "case"    "case"    "case"   
#>  [99] "case"    "case"    "case"    "case"    "case"    "case"    "case"   
#> [106] "case"    "case"    "case"    "case"    "case"    "case"    "case"   
#> [113] "case"    "case"    "case"    "case"    "case"    "case"    "case"   
#> [120] "case"    "case"    "case"    "case"    "case"    "case"    "case"   
#> [127] "case"    "case"    "case"    "case"    "case"    "case"    "case"   
#> [134] "case"    "case"    "case"    "case"    "case"    "case"    "case"   
#> [141] "case"    "case"    "case"    "case"    "case"    "case"    "case"   
#> [148] "case"    "case"    "case"    "case"    "case"    "case"    "case"   
#> [155] "case"    "case"    "case"    "case"    "case"    "case"    "case"   
#> [162] "case"    "case"    "case"    "case"    "case"    "case"    "case"   
#> [169] "case"    "case"    "case"    "case"    "case"    "case"    "case"   
#> [176] "case"    "case"    "case"    "case"    "case"    "case"    "case"   
#> [183] "case"    "case"    "case"    "case"    "case"    "case"    "case"   
#> [190] "case"    "case"    "case"    "case"    "case"    "case"    "case"   
#> [197] "case"    "case"    "case"    "case"    "case"    "case"    "case"   
#> [204] "case"    "case"    "case"    "case"    "case"    "case"    "case"   
#> [211] "case"    "case"    "case"    "case"    "case"    "case"    "case"   
#> [218] "case"    "case"    "case"    "case"    "case"    "case"    "case"   
#> [225] "case"    "case"    "case"    "case"    "case"    "control" "control"
#> [232] "control" "control" "control" "control" "control" "control" "control"
#> [239] "control" "control" "control" "control" "control" "control" "control"
#> [246] "control" "control" "control" "control" "control" "control" "control"
#> [253] "control" "control" "control" "control" "control" "control" "control"
#> [260] "control" "control" "control" "control" "control" "control" "control"
#> [267] "control" "control" "control" "control" "control" "QC"      "QC"     
#> [274] "QC"      "QC"      "QC"      "QC"      "QC"      "QC"      "QC"     
#> [281] "QC"      "QC"      "QC"      "QC"      "QC"      "QC"      "QC"     
#> [288] "QC"      "QC"      "QC"      "QC"      "QC"      "QC"      "QC"     
#> [295] "QC"      "QC"      "QC"      "QC"      "QC"

We can see there are no “Subject” in the class, so we need to change the case and control to Subject.

Step 2: change class

object <- 
  object %>% 
  activate_mass_dataset(what = "sample_info") %>% 
  mutate(class = case_when(
    class == "QC" ~ "QC",
    TRUE ~ "Subject"
  ))
object@sample_info$class
#>   [1] "Subject" "Subject" "Subject" "Subject" "Subject" "Subject" "Subject"
#>   [8] "Subject" "Subject" "Subject" "Subject" "Subject" "Subject" "Subject"
#>  [15] "Subject" "Subject" "Subject" "Subject" "Subject" "Subject" "Subject"
#>  [22] "Subject" "Subject" "Subject" "Subject" "Subject" "Subject" "Subject"
#>  [29] "Subject" "Subject" "Subject" "Subject" "Subject" "Subject" "Subject"
#>  [36] "Subject" "Subject" "Subject" "Subject" "Subject" "Subject" "Subject"
#>  [43] "Subject" "Subject" "Subject" "Subject" "Subject" "Subject" "Subject"
#>  [50] "Subject" "Subject" "Subject" "Subject" "Subject" "Subject" "Subject"
#>  [57] "Subject" "Subject" "Subject" "Subject" "Subject" "Subject" "Subject"
#>  [64] "Subject" "Subject" "Subject" "Subject" "Subject" "Subject" "Subject"
#>  [71] "Subject" "Subject" "Subject" "Subject" "Subject" "Subject" "Subject"
#>  [78] "Subject" "Subject" "Subject" "Subject" "Subject" "Subject" "Subject"
#>  [85] "Subject" "Subject" "Subject" "Subject" "Subject" "Subject" "Subject"
#>  [92] "Subject" "Subject" "Subject" "Subject" "Subject" "Subject" "Subject"
#>  [99] "Subject" "Subject" "Subject" "Subject" "Subject" "Subject" "Subject"
#> [106] "Subject" "Subject" "Subject" "Subject" "Subject" "Subject" "Subject"
#> [113] "Subject" "Subject" "Subject" "Subject" "Subject" "Subject" "Subject"
#> [120] "Subject" "Subject" "Subject" "Subject" "Subject" "Subject" "Subject"
#> [127] "Subject" "Subject" "Subject" "Subject" "Subject" "Subject" "Subject"
#> [134] "Subject" "Subject" "Subject" "Subject" "Subject" "Subject" "Subject"
#> [141] "Subject" "Subject" "Subject" "Subject" "Subject" "Subject" "Subject"
#> [148] "Subject" "Subject" "Subject" "Subject" "Subject" "Subject" "Subject"
#> [155] "Subject" "Subject" "Subject" "Subject" "Subject" "Subject" "Subject"
#> [162] "Subject" "Subject" "Subject" "Subject" "Subject" "Subject" "Subject"
#> [169] "Subject" "Subject" "Subject" "Subject" "Subject" "Subject" "Subject"
#> [176] "Subject" "Subject" "Subject" "Subject" "Subject" "Subject" "Subject"
#> [183] "Subject" "Subject" "Subject" "Subject" "Subject" "Subject" "Subject"
#> [190] "Subject" "Subject" "Subject" "Subject" "Subject" "Subject" "Subject"
#> [197] "Subject" "Subject" "Subject" "Subject" "Subject" "Subject" "Subject"
#> [204] "Subject" "Subject" "Subject" "Subject" "Subject" "Subject" "Subject"
#> [211] "Subject" "Subject" "Subject" "Subject" "Subject" "Subject" "Subject"
#> [218] "Subject" "Subject" "Subject" "Subject" "Subject" "Subject" "Subject"
#> [225] "Subject" "Subject" "Subject" "Subject" "Subject" "Subject" "Subject"
#> [232] "Subject" "Subject" "Subject" "Subject" "Subject" "Subject" "Subject"
#> [239] "Subject" "Subject" "Subject" "Subject" "Subject" "Subject" "Subject"
#> [246] "Subject" "Subject" "Subject" "Subject" "Subject" "Subject" "Subject"
#> [253] "Subject" "Subject" "Subject" "Subject" "Subject" "Subject" "Subject"
#> [260] "Subject" "Subject" "Subject" "Subject" "Subject" "Subject" "Subject"
#> [267] "Subject" "Subject" "Subject" "Subject" "Subject" "QC"      "QC"     
#> [274] "QC"      "QC"      "QC"      "QC"      "QC"      "QC"      "QC"     
#> [281] "QC"      "QC"      "QC"      "QC"      "QC"      "QC"      "QC"     
#> [288] "QC"      "QC"      "QC"      "QC"      "QC"      "QC"      "QC"     
#> [295] "QC"      "QC"      "QC"      "QC"      "QC"

Session information

sessionInfo()
#> R version 4.1.2 (2021-11-01)
#> Platform: x86_64-apple-darwin17.0 (64-bit)
#> Running under: macOS Big Sur 10.16
#> 
#> Matrix products: default
#> BLAS:   /Library/Frameworks/R.framework/Versions/4.1/Resources/lib/libRblas.0.dylib
#> LAPACK: /Library/Frameworks/R.framework/Versions/4.1/Resources/lib/libRlapack.dylib
#> 
#> locale:
#> [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
#> 
#> attached base packages:
#> [1] stats     graphics  grDevices utils     datasets  methods   base     
#> 
#> other attached packages:
#>  [1] forcats_0.5.1      stringr_1.4.0      dplyr_1.0.8        purrr_0.3.4       
#>  [5] readr_2.1.2        tidyr_1.2.0        tibble_3.1.6       ggplot2_3.3.5     
#>  [9] tidyverse_1.3.1    magrittr_2.0.2     masstools_0.99.3   massdataset_0.99.9
#> [13] masscleaner_0.99.4
#> 
#> loaded via a namespace (and not attached):
#>   [1] readxl_1.3.1          snow_0.4-4            backports_1.4.1      
#>   [4] circlize_0.4.14       systemfonts_1.0.3     plyr_1.8.6           
#>   [7] lazyeval_0.2.2        BiocParallel_1.28.3   crosstalk_1.2.0      
#>  [10] leaflet_2.1.0         robust_0.7-0          digest_0.6.29        
#>  [13] foreach_1.5.2         yulab.utils_0.0.4     htmltools_0.5.2      
#>  [16] fansi_1.0.2           memoise_2.0.1         fit.models_0.64      
#>  [19] cluster_2.1.2         doParallel_1.0.17     tzdb_0.2.0           
#>  [22] openxlsx_4.2.5        limma_3.50.0          ComplexHeatmap_2.10.0
#>  [25] modelr_0.1.8          matrixStats_0.61.0    pkgdown_2.0.2        
#>  [28] colorspace_2.0-2      rvest_1.0.2           rrcov_1.6-2          
#>  [31] ggrepel_0.9.1         haven_2.4.3           textshaping_0.3.6    
#>  [34] xfun_0.29             crayon_1.5.0          jsonlite_1.7.3       
#>  [37] missForest_1.4        impute_1.68.0         iterators_1.0.14     
#>  [40] glue_1.6.1            gtable_0.3.0          zlibbioc_1.40.0      
#>  [43] GetoptLong_1.0.5      shape_1.4.6           BiocGenerics_0.40.0  
#>  [46] DEoptimR_1.0-10       scales_1.1.1          vsn_3.62.0           
#>  [49] mvtnorm_1.1-3         DBI_1.1.2             Rcpp_1.0.8           
#>  [52] mzR_2.28.0            viridisLite_0.4.0     clue_0.3-60          
#>  [55] gridGraphics_0.5-1    proxy_0.4-26          preprocessCore_1.56.0
#>  [58] clisymbols_1.2.0      stats4_4.1.2          MsCoreUtils_1.6.0    
#>  [61] htmlwidgets_1.5.4     httr_1.4.2            RColorBrewer_1.1-2   
#>  [64] ellipsis_0.3.2        pkgconfig_2.0.3       XML_3.99-0.8         
#>  [67] sass_0.4.0            dbplyr_2.1.1          utf8_1.2.2           
#>  [70] ggplotify_0.1.0       tidyselect_1.1.1      rlang_1.0.1          
#>  [73] munsell_0.5.0         cellranger_1.1.0      tools_4.1.2          
#>  [76] cachem_1.0.6          cli_3.2.0             generics_0.1.2       
#>  [79] broom_0.7.12          evaluate_0.15         fastmap_1.1.0        
#>  [82] mzID_1.32.0           yaml_2.3.4            ragg_1.2.1           
#>  [85] knitr_1.37            fs_1.5.2              zip_2.2.0            
#>  [88] robustbase_0.93-9     randomForest_4.7-1    ncdf4_1.19           
#>  [91] pbapply_1.5-0         xml2_1.3.3            compiler_4.1.2       
#>  [94] rstudioapi_0.13       plotly_4.10.0         png_0.1-7            
#>  [97] e1071_1.7-9           affyio_1.64.0         reprex_2.0.1         
#> [100] bslib_0.3.1           pcaPP_1.9-74          stringi_1.7.6        
#> [103] desc_1.4.0            MSnbase_2.20.4        lattice_0.20-45      
#> [106] ProtGenerics_1.26.0   ggsci_2.9             vctrs_0.3.8          
#> [109] pillar_1.7.0          lifecycle_1.0.1       BiocManager_1.30.16  
#> [112] jquerylib_0.1.4       MALDIquant_1.21       GlobalOptions_0.1.2  
#> [115] data.table_1.14.2     patchwork_1.1.1       R6_2.5.1             
#> [118] pcaMethods_1.86.0     affy_1.72.0           IRanges_2.28.0       
#> [121] codetools_0.2-18      MASS_7.3-55           assertthat_0.2.1     
#> [124] rprojroot_2.0.2       rjson_0.2.21          withr_2.4.3          
#> [127] S4Vectors_0.32.3      parallel_4.1.2        hms_1.1.1            
#> [130] grid_4.1.2            class_7.3-20          rmarkdown_2.11       
#> [133] itertools_0.1-3       lubridate_1.8.0       Biobase_2.54.0