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.
An R6Class
generator object
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 PubChem
rdkit
List of information obtained with RDKit
mol
<rdkit.Chem.rdchem.Mol> object
svg
SVG code
Picture
Graph as a picture
object obtained using grImport
Pict_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
transformations
Data frame of observed transformations
soil_degradation
Dataframe of modelling DT50 values
soil_ff
Dataframe of formation fractions
soil_sorption
Dataframe of soil sorption data
new()
Creates a new instance of this R6 class.
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
pdf()
chent$pdf(
file = paste0(self$identifier, ".pdf"),
dir = "structures/pdf",
template = NULL
)
png()
chent$png(
file = paste0(self$identifier, ".png"),
dir = "structures/png",
antialias = "gray"
)
emf()
chent$emf(file = paste0(self$identifier, ".emf"), dir = "structures/emf")
oct <- chent$new("1-octanol", smiles = "CCCCCCCCO", pubchem = FALSE)
#> Trying to get chemical information from RDKit using user SMILES
#> CCCCCCCCO
#> Did not find chyaml file ./1-octanol.yaml
print(oct)
#> <chent>
#> Identifier $identifier 1-octanol
#> InChI Key $inchikey
#> SMILES string $smiles:
#> user
#> "CCCCCCCCO"
#> Molecular weight $mw: 130.2
if (!is.null(oct$Picture)) {
plot(oct)
}
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
#> Did not find chyaml file ./caffeine.yaml
print(caffeine)
#> <chent>
#> Identifier $identifier caffeine
#> InChI Key $inchikey RYYVLZVUVIJVGH-UHFFFAOYSA-N
#> SMILES string $smiles:
#> PubChem_Canonical
#> "CN1C=NC2=C1C(=O)N(C(=O)N2C)C"
#> Molecular weight $mw: 194.2
#> PubChem synonyms (up to 10):
#> [1] "caffeine" "58-08-2"
#> [3] "Guaranine" "1,3,7-Trimethylxanthine"
#> [5] "Methyltheobromine" "Theine"
#> [7] "Thein" "Cafeina"
#> [9] "Koffein" "Mateina"
if (!is.null(caffeine$Picture)) {
plot(caffeine)
}