| Title: | Ecotoxicological Information from the Standartox Database |
|---|---|
| Description: | The Standartox database offers cleaned, harmonized and aggregated ecotoxicological test data, which can be used for assessing effects and risks of chemical concentrations found in the environment. |
| Authors: | Andreas Scharmüller [aut, cre] (ORCID: <https://orcid.org/0000-0002-9290-3965>), Hannes Reinwald [ctb] (ORCID: <https://orcid.org/0000-0003-3133-679X>) |
| Maintainer: | Andreas Scharmüller <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 1.0.0 |
| Built: | 2026-05-22 07:27:34 UTC |
| Source: | https://github.com/andschar/standartox |
Retrieves a catalog of all possible values for variables that can be used for filtering in stx_query(). This is useful for discovering valid inputs for parameters like endpoint_group, effect, or tax_group.
stx_catalog(silent = FALSE, stx_dir = file.path(tempdir(), "standartox"))stx_catalog(silent = FALSE, stx_dir = file.path(tempdir(), "standartox"))
silent |
logical; If |
stx_dir |
character; Directory where the catalog file is stored. If the file doesn't exist, it will be downloaded to this location. Defaults to a "standartox" subdirectory within the session's temporary directory ( |
Returns a list where each element is a character vector containing the unique values for a specific data field available for querying.
Andreas Scharmueller [email protected]
Hannes Reinwald
# This function might fail if there is no internet connection or Zenodo.org is not available # Basic function call to retrieve the catalog catalog_data <- stx_catalog() # View the names of available fields in the catalog names(catalog_data) # See all possible values for 'endpoint_group' print(catalog_data$endpoint_group) # Get verbose output from the function catalog_verbose <- stx_catalog(silent = FALSE) # Specify a permanent directory to download and cache the catalog file. # This speeds up future calls as the file won't need to be re-downloaded when starting a new session. my_dir <- file.path("~","my_stx_data") catalog_cached <- stx_catalog(stx_dir = my_dir, silent = FALSE)# This function might fail if there is no internet connection or Zenodo.org is not available # Basic function call to retrieve the catalog catalog_data <- stx_catalog() # View the names of available fields in the catalog names(catalog_data) # See all possible values for 'endpoint_group' print(catalog_data$endpoint_group) # Get verbose output from the function catalog_verbose <- stx_catalog(silent = FALSE) # Specify a permanent directory to download and cache the catalog file. # This speeds up future calls as the file won't need to be re-downloaded when starting a new session. my_dir <- file.path("~","my_stx_data") catalog_cached <- stx_catalog(stx_dir = my_dir, silent = FALSE)
Provides direct access to the 'phch' data table, which contains chemical identifiers and physicochemical properties for all compounds in the Standartox database.
stx_chem(silent = FALSE, stx_dir = file.path(tempdir(), "standartox"))stx_chem(silent = FALSE, stx_dir = file.path(tempdir(), "standartox"))
silent |
logical; If 'TRUE', suppresses progress messages during download. Defaults to 'FALSE'. |
stx_dir |
character; Directory where the chemical data file is stored or should be downloaded. Defaults to a "standartox" subdirectory within the session's temporary directory ( |
This function is a simple wrapper for stx_download(data_type = 'phch'). It is designed for users who want to explore the chemical inventory of the database, for instance, to find CAS numbers for use with stx_query.
Like other download functions in this package, it caches the data file locally to avoid re-downloading on subsequent calls.
A data.table containing chemical information, including columns such as CAS number, chemical name, and other identifiers.
Andreas Scharmueller [email protected]
Hannes Reinwald
# This function may fail if there is no internet connection or Zenodo.org is not available # Basic function call to retrieve the chemical data table chem_data <- stx_chem() # Inspect the first few rows and column names to see what's available head(chem_data) colnames(chem_data) # Example of using a permanent directory to cache the data file # The "Retrieving..." message will only appear on the first download. my_dir <- file.path("~", "my_stx_data") cached_chem_data <- stx_chem(stx_dir = my_dir, silent = FALSE)# This function may fail if there is no internet connection or Zenodo.org is not available # Basic function call to retrieve the chemical data table chem_data <- stx_chem() # Inspect the first few rows and column names to see what's available head(chem_data) colnames(chem_data) # Example of using a permanent directory to cache the data file # The "Retrieving..." message will only appear on the first download. my_dir <- file.path("~", "my_stx_data") cached_chem_data <- stx_chem(stx_dir = my_dir, silent = FALSE)
Provides direct access to the main 'test_fin' data table from the Standartox database, which contains the raw toxicity results.
stx_data(silent = FALSE, stx_dir = file.path(tempdir(), "standartox"))stx_data(silent = FALSE, stx_dir = file.path(tempdir(), "standartox"))
silent |
logical; If 'TRUE', suppresses progress messages during download. Defaults to 'FALSE'. |
stx_dir |
character; Directory where the data file is stored or should be downloaded. Defaults to a "standartox" subdirectory within the session's temporary directory ( |
This function is a simple wrapper for stx_download(data_type = 'test_fin'). It is designed for users who want the primary data table of toxicity test results without the additional chemical or detailed taxonomic information that stx_query automatically appends.
Like other download functions in this package, it caches the data file locally to avoid re-downloading on subsequent calls.
A data.table containing the core toxicity test results, with columns for endpoints, duration, concentration, effect, etc.
Andreas Scharmueller [email protected]
Hannes Reinwald
# This function may fail if there is no internet connection or Zenodo.org is not available # Basic function call to retrieve the main data table tox_data <- stx_data() # Inspect the first few rows and column names to understand the structure head(tox_data) colnames(tox_data) # Example of using a permanent directory to cache the data # The message "Retrieving Standartox data.." will only appear on the first download. my_dir <- file.path("~", "my_stx_data") cached_data <- stx_data(stx_dir = my_dir, silent = FALSE)# This function may fail if there is no internet connection or Zenodo.org is not available # Basic function call to retrieve the main data table tox_data <- stx_data() # Inspect the first few rows and column names to understand the structure head(tox_data) colnames(tox_data) # Example of using a permanent directory to cache the data # The message "Retrieving Standartox data.." will only appear on the first download. my_dir <- file.path("~", "my_stx_data") cached_data <- stx_data(stx_dir = my_dir, silent = FALSE)
Retrieve meta data
stx_meta(silent = FALSE, stx_dir = file.path(tempdir(), "standartox"))stx_meta(silent = FALSE, stx_dir = file.path(tempdir(), "standartox"))
silent |
logical; If TRUE, suppresses messages. Default is FALSE. |
stx_dir |
character; Directory to which the meta information should be downloaded. Default is a temporary directory.#' |
Returns a data.table containing meta informaiton on Standartox.
Andreas Scharmueller [email protected]
Hannes Reinwald
# might fail if there is no internet connection or Zenodo.org not not available # basic function call df = stx_meta() # to get verbose output from the function df = stx_meta(silent = FALSE) # to specify a directory to which the taxa information should be downloaded df = stx_meta(silent = FALSE, stx_dir = "~/tmp") # This will create a directory under ~/tmp and download the respective standartox file to that directory. # The files are then permanently stored in that directory and can be directly read when restarting your R session.# might fail if there is no internet connection or Zenodo.org not not available # basic function call df = stx_meta() # to get verbose output from the function df = stx_meta(silent = FALSE) # to specify a directory to which the taxa information should be downloaded df = stx_meta(silent = FALSE, stx_dir = "~/tmp") # This will create a directory under ~/tmp and download the respective standartox file to that directory. # The files are then permanently stored in that directory and can be directly read when restarting your R session.
Retrieves and filters toxicity data from the Standartox database (https://doi.org/10.5281/zenodo.3785030). This function acts as a powerful front-end for subsetting the database based on chemical, experimental, and taxonomic criteria.
stx_query( cas_number = NULL, endpoint_group = c("XX50", "NOEX", "LOEX"), endpoint_qualifier = "=", endpoint = NULL, exposure = NULL, effect = NULL, measurement = NULL, duration = c(0, Inf), duration_unit = "h", concentration_unit = NULL, concentration_type = NULL, organism_lifestage = NULL, tax_columns = c("tax_group", "tax_taxon", "tax_genus", "tax_family"), tax_genus = NULL, tax_family = NULL, tax_order = NULL, tax_class = NULL, tax_group = NULL, include_reference = FALSE, rm_NR = TRUE, verbose = FALSE, ... )stx_query( cas_number = NULL, endpoint_group = c("XX50", "NOEX", "LOEX"), endpoint_qualifier = "=", endpoint = NULL, exposure = NULL, effect = NULL, measurement = NULL, duration = c(0, Inf), duration_unit = "h", concentration_unit = NULL, concentration_type = NULL, organism_lifestage = NULL, tax_columns = c("tax_group", "tax_taxon", "tax_genus", "tax_family"), tax_genus = NULL, tax_family = NULL, tax_order = NULL, tax_class = NULL, tax_group = NULL, include_reference = FALSE, rm_NR = TRUE, verbose = FALSE, ... )
cas_number |
character; Optional vector of CAS numbers to filter by (e.g., |
endpoint_group |
character; Optional vector of endpoint groups to filter results. See |
endpoint_qualifier |
character; Optional vector of endpoint value qualifiers (e.g., |
endpoint |
character; Optional vector of specific endpoints to filter by (e.g., "LC50", "NOEC"). If 'NULL' (default), no endpoint filtering is applied. |
exposure |
character; Optional vector of exposure types. See |
effect |
character; Optional vector of observed effects. See |
measurement |
character; Optional vector of measurement types. See |
duration |
numeric; A numeric vector of length two specifying the duration range (in hours) to filter by, e.g., |
duration_unit |
character; Filter by the unit of duration. See |
concentration_unit |
character; Optional vector of concentration units. See |
concentration_type |
character; Optional vector of concentration types. See |
organism_lifestage |
character; Optional vector of organism lifestages. See |
tax_columns |
character; A vector of taxonomic column names to append to the results. See |
tax_genus |
character; Optional vector of genera to filter by. See |
tax_family |
character; Optional vector of families to filter by. See |
tax_order |
character; Optional vector of orders to filter by. See |
tax_class |
character; Optional vector of classes to filter by. See |
tax_group |
character; Optional vector of ecotoxicological groups to filter by. See |
include_reference |
logical; If 'TRUE', reference information (author, year, title) is appended to the results. Defaults to |
rm_NR |
logical; If 'TRUE' (default), rows with "NR" (not reported) values in the critical 'endpoint' and 'duration_unit' columns are removed early in the query process. Note that at the end of the query, all remaining "NR" values in any character column are converted to 'NA'. |
verbose |
logical; If 'TRUE', prints messages detailing the query progress. Defaults to |
... |
Additional arguments to be passed on to |
The function operates in a sequential process:
1. It first downloads the necessary data tables ('test_fin', 'phch', 'taxa', and optionally 'refs') using stx_download.
2. It performs initial, fast filtering based on 'endpoint_group', 'endpoint_qualifier', and 'duration_unit'.
3. It then appends chemical and taxonomic information, filtering by 'cas_number' and the 'tax_*' parameters.
4. Finally, it applies the remaining experimental filters ('effect', 'duration', 'concentration_unit', etc.).
By default, filters are combined with a logical "AND". For example, specifying a 'tax_genus' and an 'effect' will return only records that match both criteria.
‘stx_catalog()' is a helper function that provides a list of all valid filter values for many of this function’s parameters.
A data.table containing the filtered Standartox toxicity data. If the query results in zero matches, the function returns 'NULL' and issues a warning.
Hannes Reinwald
# This function may fail if there is no internet connection or Zenodo.org is not available # Basic query using default filters (XX50, NOEX, LOEX endpoints in hours) # Using verbose=TRUE to see the process results_default <- stx_query(verbose = TRUE) # To see available filter options, use the catalog function catalog <- stx_catalog() print(catalog$endpoint_group) # Query for a specific CAS number and multiple specific endpoints for key taxonomic groups q1 <- stx_query( cas_number = "1071-83-6", # Glyphosate endpoint = c("LC50", "EC50", "LOEC", "NOEC"), duration = c(0, 120), # Up to 120 hours tax_group = c("invertebrate", "fish", "algae") ) # Get all >LC50 values for Zebra fish (Danio rerio) embryos or larvae, # including reference information q2 <- stx_query( endpoint = "LC50", endpoint_qualifier = ">", duration = c(72, 120), tax_genus = "Danio", organism_lifestage = c("Embryo", "Larva"), include_reference = TRUE, verbose = TRUE ) # Get all XX50 acute toxicity values for the family Daphniidae related to mobility q3 <- stx_query( endpoint_group = "XX50", duration = c(24, 48), measurement = c("immobile", "mobility", "swimming"), tax_family = "Daphniidae", include_reference = TRUE )# This function may fail if there is no internet connection or Zenodo.org is not available # Basic query using default filters (XX50, NOEX, LOEX endpoints in hours) # Using verbose=TRUE to see the process results_default <- stx_query(verbose = TRUE) # To see available filter options, use the catalog function catalog <- stx_catalog() print(catalog$endpoint_group) # Query for a specific CAS number and multiple specific endpoints for key taxonomic groups q1 <- stx_query( cas_number = "1071-83-6", # Glyphosate endpoint = c("LC50", "EC50", "LOEC", "NOEC"), duration = c(0, 120), # Up to 120 hours tax_group = c("invertebrate", "fish", "algae") ) # Get all >LC50 values for Zebra fish (Danio rerio) embryos or larvae, # including reference information q2 <- stx_query( endpoint = "LC50", endpoint_qualifier = ">", duration = c(72, 120), tax_genus = "Danio", organism_lifestage = c("Embryo", "Larva"), include_reference = TRUE, verbose = TRUE ) # Get all XX50 acute toxicity values for the family Daphniidae related to mobility q3 <- stx_query( endpoint_group = "XX50", duration = c(24, 48), measurement = c("immobile", "mobility", "swimming"), tax_family = "Daphniidae", include_reference = TRUE )
Provides direct access to the 'taxa' data table, which contains the complete taxonomic classification for every species in the Standartox database.
stx_taxa(silent = FALSE, stx_dir = file.path(tempdir(), "standartox"))stx_taxa(silent = FALSE, stx_dir = file.path(tempdir(), "standartox"))
silent |
logical; If 'TRUE', suppresses progress messages during download. Defaults to 'FALSE'. |
stx_dir |
character; Directory where the taxonomy data file is stored or should be downloaded. Defaults to a "standartox" subdirectory within the session's temporary directory ( |
This function is a simple wrapper for stx_download(data_type = 'taxa'). It is designed for users who want to explore the full taxonomic scope of the database or find valid inputs for the 'tax_genus', 'tax_family', and 'tax_group' parameters in stx_query.
Like other download functions in this package, it caches the data file locally to avoid re-downloading on subsequent calls.
A data.table containing taxonomic classifications, with columns such as 'tax_genus', 'tax_family', 'tax_order', and 'tax_group'.
Andreas Scharmueller [email protected]
Hannes Reinwald
# This function may fail if there is no internet connection or Zenodo.org is not available # Basic function call to retrieve the taxonomy data table taxa_data <- stx_taxa() # Inspect the first few rows and see all available columns head(taxa_data) colnames(taxa_data) # Find all unique ecotoxicological groups in the database if (nrow(taxa_data) > 0) { print(unique(taxa_data$tax_group)) } # Example of using a permanent directory to cache the data file my_dir <- file.path("~", "my_stx_data") cached_taxa_data <- stx_taxa(stx_dir = my_dir, silent = FALSE)# This function may fail if there is no internet connection or Zenodo.org is not available # Basic function call to retrieve the taxonomy data table taxa_data <- stx_taxa() # Inspect the first few rows and see all available columns head(taxa_data) colnames(taxa_data) # Find all unique ecotoxicological groups in the database if (nrow(taxa_data) > 0) { print(unique(taxa_data$tax_group)) } # Example of using a permanent directory to cache the data file my_dir <- file.path("~", "my_stx_data") cached_taxa_data <- stx_taxa(stx_dir = my_dir, silent = FALSE)