Introduction
Note: this vignette is pre-computed. See the session info for information on packages used and the date the vignette was rendered. The vignette requires a running Sirius instance. To reproduce this analysis, you will need Sirius 6.3 installed and running.
RuSirius provides an R interface to the Sirius mass spectrometry software for metabolite identification. This vignette covers the basics of connecting to Sirius and managing projects.
Prerequisites
Before using RuSirius, you need:
- Sirius 6.3 installed on your system. Download from the official releases page.
- A Sirius account (free registration at bright-giant.com)
Connecting to Sirius
The Sirius() function creates a connection to the Sirius
application. If Sirius is not running, it will attempt to start it
automatically. The port parameter allows to configure the
Sirius application to use a particular port; this is required when using
the Docker container (where Sirius is pre-started on port 9999), but
generally the function can be used without specifying a port.
# Basic connection - Sirius will start if not running
srs <- Sirius(port = 9999)
#> Error in `Sirius()`:
#> ! unused argument (port = 9999)
srs
#> Error:
#> ! object 'srs' not foundIf you have credentials, you can log in during connection:
srs <- Sirius(
username = "your_email@example.com",
password = "your_password",
port = 9999
)Checking Connection Status
You can verify your connection is valid with
checkConnection(srs):
# Check if connected
checkConnection(srs)
#> [1] FALSE
# View connection details
srs
#> Error:
#> ! object 'srs' not foundManaging Projects
Sirius organizes data and results into projects. You can create new
projects or open existing ones during connection, or later using the
openProject() function. Parameters projectId
and path allow to set the name (ID) of the project and the
path to the directory where the project file should be stored in.
Creating/Opening a Project
# Open a project on the existing connection
srs <- openProject(srs, projectId = "my_analysis", path = getwd())
#> Error in `openProject()`:
#> ! The connection to the Sirius instance is not valid.The project file will be saved as my_analysis.sirius in
the specified path.
Project Information
# Get project details
projectInfo(srs)
#> Error:
#> ! object 'srs' not found
# List all open projects
listOpenProjects(srs)
#> Warning in value[[3L]](cond): Could not retrieve open projects: object 'srs' not found
#> character(0)Working with Features
After importing data (see the “Importing Spectra” vignette), you can manage features:
# List feature IDs
featuresId(srs)
#> Error:
#> ! object 'srs' not found
# Get feature information
featuresInfo(srs)
#> Error:
#> ! object 'srs' not found
# Get the mapping between your IDs and Sirius IDs
srs@featureMap
#> Error:
#> ! object 'srs' not foundLogging In
If you didn’t provide credentials at connection time:
srs <- logIn(srs, username = "your_email@example.com",
password = "your_password")Shutting Down
Always properly close your connection when finished:
# Close project and shutdown
shutdown(srs, closeProject = TRUE)
#> Warning in value[[3L]](cond): Could not retrieve open projects: object 'srs' not found
#> Warning in doTryCatch(return(expr), name, parentenv, handler): restarting interrupted
#> promise evaluationUtility Functions
RuSirius provides several utility functions. See
?utils for the full list:
-
checkConnection()- Verify connection status -
logIn()- Log in to Sirius -
openProject()/listOpenProjects()- Project management -
projectInfo()- Get project details -
featuresId()/featuresInfo()- Feature management -
deleteFeatures()- Remove features -
mapFeatures()- Get ID mappings -
openGUI()/closeGUI()- GUI control -
shutdown()- Clean shutdown
Session Info
sessionInfo()
#> R version 4.5.2 (2025-10-31 ucrt)
#> Platform: x86_64-w64-mingw32/x64
#> Running under: Windows 11 x64 (build 26100)
#>
#> Matrix products: default
#> LAPACK version 3.12.1
#>
#> locale:
#> [1] LC_COLLATE=English_United States.utf8 LC_CTYPE=English_United States.utf8
#> [3] LC_MONETARY=English_United States.utf8 LC_NUMERIC=C
#> [5] LC_TIME=English_United States.utf8
#>
#> time zone: Europe/Rome
#> tzcode source: internal
#>
#> attached base packages:
#> [1] stats4 stats graphics grDevices utils datasets methods base
#>
#> other attached packages:
#> [1] MsDataHub_1.10.0 dplyr_1.2.0 RuSirius_0.2.0
#> [4] jsonlite_2.0.0 MetaboAnnotation_1.14.0 RSirius_6.3.3
#> [7] xcms_4.8.0 MsExperiment_1.12.0 ProtGenerics_1.42.0
#> [10] Spectra_1.20.1 BiocParallel_1.44.0 S4Vectors_0.48.0
#> [13] BiocGenerics_0.56.0 generics_0.1.4
#>
#> loaded via a namespace (and not attached):
#> [1] RColorBrewer_1.1-3 MultiAssayExperiment_1.36.1 magrittr_2.0.4
#> [4] farver_2.1.2 MALDIquant_1.22.3 fs_1.6.6
#> [7] vctrs_0.7.1 memoise_2.0.1 RCurl_1.98-1.17
#> [10] base64enc_0.1-6 htmltools_0.5.9 S4Arrays_1.10.1
#> [13] BiocBaseUtils_1.12.0 progress_1.2.3 curl_7.0.0
#> [16] AnnotationHub_4.0.0 SparseArray_1.10.8 mzID_1.48.0
#> [19] htmlwidgets_1.6.4 plyr_1.8.9 httr2_1.2.2
#> [22] impute_1.84.0 cachem_1.1.0 igraph_2.2.1
#> [25] lifecycle_1.0.5 iterators_1.0.14 pkgconfig_2.0.3
#> [28] Matrix_1.7-4 R6_2.6.1 fastmap_1.2.0
#> [31] MatrixGenerics_1.22.0 clue_0.3-66 digest_0.6.39
#> [34] pcaMethods_2.2.0 rsvg_2.7.0 AnnotationDbi_1.72.0
#> [37] ExperimentHub_3.0.0 GenomicRanges_1.62.1 RSQLite_2.4.5
#> [40] filelock_1.0.3 httr_1.4.7 abind_1.4-8
#> [43] compiler_4.5.2 withr_3.0.2 bit64_4.6.0-1
#> [46] doParallel_1.0.17 S7_0.2.1 DBI_1.2.3
#> [49] MASS_7.3-65 ChemmineR_3.62.0 rappdirs_0.3.4
#> [52] DelayedArray_0.36.0 rjson_0.2.23 mzR_2.44.0
#> [55] tools_4.5.2 PSMatch_1.14.0 otel_0.2.0
#> [58] CompoundDb_1.14.2 glue_1.8.0 QFeatures_1.20.0
#> [61] grid_4.5.2 cluster_2.1.8.1 reshape2_1.4.5
#> [64] snow_0.4-4 gtable_0.3.6 preprocessCore_1.72.0
#> [67] tidyr_1.3.2 data.table_1.18.2.1 hms_1.1.4
#> [70] MetaboCoreUtils_1.19.2 xml2_1.5.2 XVector_0.50.0
#> [73] BiocVersion_3.22.0 foreach_1.5.2 pillar_1.11.1
#> [76] stringr_1.6.0 limma_3.66.0 BiocFileCache_3.0.0
#> [79] lattice_0.22-7 bit_4.6.0 tidyselect_1.2.1
#> [82] Biostrings_2.78.0 knitr_1.51 gridExtra_2.3
#> [85] IRanges_2.44.0 Seqinfo_1.0.0 SummarizedExperiment_1.40.0
#> [88] xfun_0.56 Biobase_2.70.0 statmod_1.5.1
#> [91] MSnbase_2.36.0 matrixStats_1.5.0 DT_0.34.0
#> [94] stringi_1.8.7 yaml_2.3.12 lazyeval_0.2.2
#> [97] evaluate_1.0.5 codetools_0.2-20 MsCoreUtils_1.22.1
#> [100] tibble_3.3.1 BiocManager_1.30.27 cli_3.6.5
#> [103] affyio_1.80.0 Rcpp_1.1.1 MassSpecWavelet_1.76.0
#> [106] dbplyr_2.5.1 png_0.1-8 XML_3.99-0.20
#> [109] parallel_4.5.2 ggplot2_4.0.2 blob_1.3.0
#> [112] prettyunits_1.2.0 AnnotationFilter_1.34.0 bitops_1.0-9
#> [115] MsFeatures_1.18.0 scales_1.4.0 affy_1.88.0
#> [118] ncdf4_1.24 purrr_1.2.1 crayon_1.5.3
#> [121] rlang_1.1.7 KEGGREST_1.50.0 vsn_3.78.1