The class is initialised with an identifier. Chemical information is retrieved from the internet. Additionally, it can be generated using RDKit if RDKit and its python bindings are installed.
Public fields
identifier
(
character(1)
)
The identifier that was used to initiate the object, with attribute 'source'inchikey
(
character(1)
)
InChI Key, with attribute 'source'smiles
(
character()
)
SMILES code(s), with attribute 'source'mw
(
numeric(1)
)
Molecular weight, with attribute 'source'pubchem
(
list()
)
List of information retrieved from PubChemrdkit
List of information obtained with RDKit
mol
<rdkit.Chem.rdchem.Mol> object
svg
SVG code
Picture
Graph as a
picture
object obtained using grImportPict_font_size
Font size as extracted from the intermediate PostScript file
pdf_height
Height of the MediaBox in the pdf after cropping
p0
Vapour pressure in Pa
cwsat
Water solubility in mg/L
PUF
Plant uptake factor
chyaml
List of information obtained from a YAML file
TPs
List of transformation products as chent objects Add a transformation product to the internal list
transformations
Data frame of observed transformations Add a line in the internal dataframe holding observed transformations
soil_degradation
Dataframe of modelling DT50 values Add a line in the internal dataframe holding modelling DT50 values
soil_ff
Dataframe of formation fractions
soil_sorption
Dataframe of soil sorption data Add soil sorption data
Methods
Method new()
Creates a new instance of this R6 class.
Arguments
identifier
Identifier to be stored in the object
smiles
Optional user provided SMILES code
inchikey
Optional user provided InChI Key
pubchem
Should an attempt be made to retrieve chemical information from PubChem via the webchem package?
pubchem_from
Possibility to select the argument that is used to query pubchem
rdkit
Should an attempt be made to retrieve chemical information from a local rdkit installation via python and the reticulate package?
template
An optional SMILES code to be used as template for RDKit
chyaml
Should we look for a identifier.yaml file in the working directory? Try to get chemical information from PubChem
Method add_PUF()
Method add_transformation()
Usage
chent$add_transformation(
study_type,
TP_identifier,
max_occurrence,
remark = "",
source = NA,
pages = NA
)
Arguments
study_type
A characterisation of the study type
TP_identifier
An identifier of one of the transformation products in
self$TPs
max_occurrence
The maximum observed occurrence of the transformation product, expressed as a fraction of the amount that would result from stochiometric transformation
remark
A remark
source
An acronym specifying the source of the information
pages
The page from which the information was taken
Method add_soil_degradation()
Usage
chent$add_soil_degradation(
soils,
DT50_mod,
DT50_mod_ref,
type = NA,
country = NA,
pH_orig = NA,
pH_medium = NA,
pH_H2O = NA,
perc_OC = NA,
temperature = NA,
moisture = NA,
category = "lab",
formulation = NA,
model = NA,
chi2 = NA,
remark = "",
source,
page = NA
)
Arguments
soils
Names of the soils
DT50_mod
The modelling DT50 in the sense of regulatory pesticide fate modelling
DT50_mod_ref
The normalised modelling DT50 in the sense of regulatory pesticide fate modelling
type
The soil type
country
The country (mainly for field studies)
pH_orig
The pH stated in the study
pH_medium
The medium in which this pH was measured
pH_H2O
The pH extrapolated to pure water
perc_OC
The percentage of organic carbon in the soil
temperature
The temperature during the study in degrees Celsius
moisture
The moisture during the study
category
Is it a laboratory ('lab') or field study ('field')
formulation
Name of the formulation applied, if it was not the technical active ingredient
model
The degradation model used for deriving
DT50_mod
chi2
The relative error as defined in FOCUS kinetics
remark
A remark
source
An acronym specifying the source of the information
page
The page from which the information was taken
Method add_soil_sorption()
Usage
chent$add_soil_sorption(
soils,
Kf,
Kfoc,
N,
type = NA,
pH_orig = NA,
pH_medium = NA,
pH_H2O = NA,
perc_OC = NA,
perc_clay = NA,
CEC = NA,
remark = "",
source,
page = NA
)
Arguments
Kf
The sorption constant in L/kg, either linear (then
N
is 1) or according to FreundlichKfoc
The constant from above, normalised to soil organic carbon
N
The Freundlich exponent
perc_clay
The percentage of clay in the soil
CEC
The cation exchange capacity Write a PDF image of the structure
Method pdf()
Usage
chent$pdf(
file = paste0(self$identifier, ".pdf"),
dir = "structures/pdf",
template = NULL
)
Method png()
Usage
chent$png(
file = paste0(self$identifier, ".png"),
dir = "structures/png",
antialias = "gray"
)
Method emf()
Usage
chent$emf(file = paste0(self$identifier, ".emf"), dir = "structures/emf")
Examples
oct <- chent$new("1-octanol", smiles = "CCCCCCCCO", pubchem = FALSE)
#> Trying to get chemical information from RDKit using user SMILES
#> CCCCCCCCO
#> Error in URLencode(self$identifier): could not find function "URLencode"
print(oct)
#> Error in eval(expr, envir, enclos): object 'oct' not found
if (!is.null(oct$Picture)) {
plot(oct)
}
#> Error in eval(expr, envir, enclos): object 'oct' not found
caffeine <- chent$new("caffeine")
#> PubChem:
#> Trying to get chemical information from RDKit using PubChem_Canonical SMILES
#> CN1C=NC2=C1C(=O)N(C(=O)N2C)C
#> Error in URLencode(self$identifier): could not find function "URLencode"
print(caffeine)
#> Error in eval(expr, envir, enclos): object 'caffeine' not found
if (!is.null(caffeine$Picture)) {
plot(caffeine)
}
#> Error in eval(expr, envir, enclos): object 'caffeine' not found