adjustRgroup: Add extra atoms and unsaturations before or after an R group

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 add additional atoms (as valid SMILES codes) and unsaturations before or after R groups prior to generation of systematic homologues with RtoSMILES. This facilitates 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. It is highly recommeded to view these structures to ensure the groups are added as intended.

Usage

1
adjustRgroup(genSmiles,R_format,ExtraAtoms=NULL,RDB=NULL,R_range=NULL,atStart=TRUE)

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].

ExtraAtoms

A valid SMILES code representing the single unit to add. Single-valent atoms should be included with their attached atom. Examples "C(=O)", "C(Br)", "C(O)", "O". 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.

RDB

A number (Ring and Double Bond count) indicating the degree of unsaturations to add. This number determines how many "C=C" units are added. Note that no double-bond stereoisomerism is added. If R_range is given, this will be adjusted according to the number of "C=C" groups added, unless a negative range would be generated, in this case the original range is returned.

R_range

The range for the R group (start-end). Will be corrected by 2*RDB if given.

atStart

Default TRUE adds extra atoms and unsaturated units before the R group, FALSE adds afterwards. Triply substituted Cs should only be added after terminal Rs, for instance.

Value

Returns a vector containing the resulting SMILES codes and, if range is given, the new min and max values for range.

Author(s)

Emma Schymanski <emma.schymanski@uni.lu>

See Also

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

Examples

1
2
3
4
5
6
7
8
test_genSmiles <- adjustRgroup("OC(=O)[R]","[R]",ExtraAtoms="C(=O)")
test_genSmiles <- adjustRgroup("OC(=O)[R]","[R]",ExtraAtoms="C(Br)")
test_genSmiles <- adjustRgroup("OC(=O)[R]","[R]",RDB=2,atStart=FALSE)
buildCDKdepictURL(test_genSmiles)
# if the range is returned, need to only depict first entry
test_genSmiles <- adjustRgroup("OC(=O)[R]","[R]",ExtraAtoms="C(=O)",RDB=2,atStart=TRUE, R_range = c(4,6))
test_genSmiles <- adjustRgroup("OC(=O)[R]","[R]",RDB=2,atStart=TRUE, R_range = c(2,20))
buildCDKdepictURL(test_genSmiles[1])

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