schrodinger.livedesign.rgfile_parse module

Prototype for a RGfile parser. This will be eventually implemented in RDKit.

The RG parser is more general than the SD one, and any .sdf file should parse ok with it.

  • Only V3000 format is supported.

  • We only support default RLOGIC settings. Allowing RLOGIC would require our MolAddRecursiveQueries() strategy to construct the queries, and require a complex query enumeration strategy.

schrodinger.livedesign.rgfile_parse.parse_rgmol(data_src: Union[Iterator[str], TextIO], sanitize: bool = True, removeHs: bool = True, strictParsing: bool = True)

Parse a V3000 RG mol from an iterable stream

Parameters
  • data_src – the iterator over the RG molblock being parsed

  • sanitize – whether to sanitize the different mol when parsing them

  • removeHs – whether to remove Hs from the parsed mols

  • strictParsing – whether to enable strict parsing for the mols

Returns

a mol with subqueries for each of the defined RGROUPS

class schrodinger.livedesign.rgfile_parse.ForwardRGMolSupplier(data_src: Optional[Union[TextIO, str]] = None, sanitize: bool = True, removeHs: bool = True, strictParsing: bool = True)

Bases: object

An iterator class for lazy parsing of RGfiles in imitation of RDKit’s ForwardSDMolSupplier.

Only V3000 files and default RLOGIC values are supported.

Allowed data sources are either file objects or strings.

__init__(data_src: Optional[Union[TextIO, str]] = None, sanitize: bool = True, removeHs: bool = True, strictParsing: bool = True)
setData(data_src: Optional[Union[TextIO, str]], sanitize: Optional[bool] = None, removeHs: Optional[bool] = None, strictParsing: Optional[bool] = None)

Update the data source for the iterator and/or the mol parsing options