splitRrange: Split a single R group range into n ranges

Description Usage Arguments Value Author(s) See Also Examples

View source: R/BuildStructandSeries.R

Description

This splits a range into n for the case where e.g. the total number of carbons is known but multiple Rs exist. This assumes symmetrical filling, with remainders added to the earlier groups. Used to feed into the buildSmiles function This function may perform strangely and needs testing.

Usage

1
splitRrange(genSmiles, nR1toN)

Arguments

genSmiles

A "Generic" SMILES code to expand, with R groups encoded in square brackets. The first group can be "[R]" or "[R1]", subsequent groups should be numbered systematically (e.g. "[R2]", "[R3]", ...). Examples "O=S(O)(=O)OCCO[R1]C[R2]", "CCO[R]CCO"

nR1toN

The range for each R group (start-end,start-end, ...,start-end) or a single range. If a single range is given for n R groups, this is split to form a range for each R group. Warnings are produced if mismatches occur, in which case the input is returned.

Value

Returns the split range or original input for use in buildSmiles

Author(s)

Emma Schymanski <emma.schymanski@uni.lu>

See Also

RtoSMILES, buildSmiles.

Examples

1
2
3
4
5
6
7
8
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]"
splitRrange(test_smiles,"(1-37)")
splitRrange(test_smiles,"(1-38)")
splitRrange(test_smiles,"(1-39)")
splitRrange(test_smiles,"(1-40)")
splitRrange(test_smiles,"(3-40)")
splitRrange(test_smiles,"(1-3)")
splitRrange(test_smiles,"(16-22)")

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