RtoSMILES: Build SMILES from single R groups

Description Usage Arguments Value Author(s) See Also Examples

View source: R/BuildStructandSeries.R

Description

This works behind the scenes of buildSmiles on individual R groups, but can be used independently. This performs basic string manipulation on SMILES codes to generate systematic homologues, facilitaing the generation of identifiers for structures that may not exist in databases for use in MS workflows. This requires a decent understanding of SMILES as the text manipulation can have unexpected consequences.

Usage

1
RtoSMILES(genSmiles, R_format, R_smiles, R_range)

Arguments

genSmiles

A "Generic" SMILES code to expand, with R groups encoded in square brackets. The R group to replace is defined in R_format.

R_format

The format of the R group to replace, including square brackets, e.g. [R], [R1], [R2].

R_smiles

The valid SMILES code representing the repeating unit. Examples "C", "CCO". Must be valid SMILES to generate valid structures. Use with caution - it is highly recommended to view the structures with renderSMILES.CDKdepict or renderSMILES.rcdk to detect unwanted behaviour.

R_range

The range for each R group (start-end).

Value

Returns a vector containing the resulting SMILES codes

Author(s)

Emma Schymanski <emma.schymanski@uni.lu>

See Also

buildSmiles, splitRrange, adjustRgroup, To view created SMILES: renderSMILES.CDKdepict, renderSMILES.rcdk.

Examples

1
2
3
RtoSMILES("OC(=O)[R]","[R]","C",c(1,5))
test_smiles <- "P(=O)(OC[C@H](COP(=O)(O)OC[C@H](OC(=O)[R2])COC(=O)[R1])O)(O)OC[C@H](OC(=O)[R4])COC(=O)[R3]"
RtoSMILES(test_smiles,"[R1]","C",c(1,5))

schymane/RChemMass documentation built on Jan. 25, 2021, 5:45 a.m.