schrodinger.livedesign.bbchem_endpoints module

Collection of functions intended as bbchem web endpoints.

Copyright Schrodinger, LLC. All rights reserved.

schrodinger.livedesign.bbchem_endpoints.split_data_blocks(data: str, input_format: schrodinger.rdkit_extensions.Format, options: Optional[schrodinger.livedesign.registration.RegistrationOptions] = None)

Iterates across serialized formats, yielding a single data block at a time. Supports iterating across SD, Maestro, and FASTA files; other formats are returned as a single block. NOTE: if a FASTA mapping is set on the registration options, the FASTA is parsed as a single block.

Parameters
  • data – input text string

  • input_format – input format of the data

  • options – registration options

Returns

an iterator of data blocks

schrodinger.livedesign.bbchem_endpoints.to_registration_data(data: str, input_format: schrodinger.rdkit_extensions.Format, options: Optional[schrodinger.livedesign.registration.RegistrationOptions] = None) Iterator[Union[schrodinger.livedesign.registration.RegistrationData, Exception]]

Generalizes small molecule and biologics registration processes, returning all data LiveDesign stores in it’s internal databases. This includes returning rdmol binaries directly as for each entity. Output includes properties from the input mol, computed properties, and potentially any child data of derived virtuals.

schrodinger.livedesign.bbchem_endpoints.to_format(mol_input: str, input_format: schrodinger.rdkit_extensions.Format, output_format: schrodinger.rdkit_extensions.Format, additional_properties: Optional[Dict] = None) str

Main entrypoint for converting to a serialized text format.

Parameters
  • mol_input – serialized mol

  • input_format – input format of the mol string

  • output_format – desired format for output string

  • additional_properties – property data to include on serialization

Returns

converted text string

schrodinger.livedesign.bbchem_endpoints.to_image(mol_input: Optional[str], alignment_input: Optional[str] = None, substructure_options: Optional[schrodinger.rdkit.substructure.QueryOptions] = None, highlight_input: Optional[str] = None, render_options: Optional[schrodinger.livedesign.draw.ImageGenOptions] = None) bytes

Generates an image from a serialized input string; the request may include alignment, or substructure highlighting, or both.

Parameters
  • mol_input – serialized mol

  • alignment_input – molecule to align to prior to image generation

  • substructure_options – substructure matching options

  • highlight_input – core to highlight in generated image

  • render_options – image generation options

Returns

generated image SVG or PNG bytes

schrodinger.livedesign.bbchem_endpoints.to_fingerprint(mol_input: str, use: schrodinger.livedesign.search.FingerprintUse, substructure_options: Optional[schrodinger.rdkit.substructure.QueryOptions] = None) rdkit.DataStructs.cDataStructs.ExplicitBitVect

Generates a substructure or similarity fingerprint for a given mol.

Parameters
  • mol_input – serialized mol

  • use – type of fingerprint to generate

  • substructure_options – substructure matching options

schrodinger.livedesign.bbchem_endpoints.num_substructure_matches(*args, **kwargs) int
Returns

number of substructure/subsequence matches

schrodinger.livedesign.bbchem_endpoints.has_substructure_match(*args, **kwargs) bool
Returns

whether any substructure/subsequence match was found

schrodinger.livedesign.bbchem_endpoints.to_sequence_viewer_data(mol_binary_str: str, scheme: schrodinger.infra.util.AntibodyCDRScheme = AntibodyCDRScheme.Kabat) Dict[str, Dict]
Returns

biologics sequence viewer data for the given mol

schrodinger.livedesign.bbchem_endpoints.generate_image(mol: rdkit.Chem.rdchem.Mol, alignment_mol: Optional[rdkit.Chem.rdchem.Mol] = None, substructure_options: Optional[schrodinger.rdkit.substructure.QueryOptions] = None, highlight_mol: Optional[rdkit.Chem.rdchem.Mol] = None, draw_options: Optional[schrodinger.livedesign.draw.ImageGenOptions] = None) bytes

DEPRECATED: Remove once bbchem is updated

schrodinger.livedesign.bbchem_endpoints.generate_sar_analysis_image(match_mol: rdkit.Chem.rdchem.Mol, scaffold_mol: rdkit.Chem.rdchem.Mol, substructure_options: Optional[schrodinger.rdkit.substructure.QueryOptions] = None, draw_options: Optional[schrodinger.livedesign.draw.ImageGenOptions] = None) bytes

Generates an image used in LiveDesign that is specifically from SAR analysis output, highlighting the core and all r-groups from the decomposition.

Parameters
  • match_mol – source molecule for R-group decomposition to highlight and generate image of

  • scaffold_mol – scaffold molecule on which to find R-groups

  • substructure_options – substructure matching options

  • draw_options – image generation options

Returns

generated image as a string

schrodinger.livedesign.bbchem_endpoints.pop_properties(mol: rdkit.Chem.rdchem.Mol) dict
Parameters

mol – molecule to extract, then clear all properties from

Returns

map of all removed properties as strings

schrodinger.livedesign.bbchem_endpoints.set_properties(mol: rdkit.Chem.rdchem.Mol, new_props: dict)
Parameters
  • mol – molecule to clear, then set given properties on

  • new_props – map of properties to add onto the molecule

schrodinger.livedesign.bbchem_endpoints.split_fragments(mol: rdkit.Chem.rdchem.Mol)
Param

input molecule

Returns

iterable containing each fragment mol

schrodinger.livedesign.bbchem_endpoints.enumerate_stereoisomers(mol: rdkit.Chem.rdchem.Mol, max_stereoisomers: int = 512) Iterator[rdkit.Chem.rdchem.Mol]

Generates stereoisomers from a specified SDF structure string.

Parameters
  • structure – structure from which to generate stereoisomers

  • max_stereoisomers – maximum number of stereoisomers to generate

Returns

generated stereoisomers

schrodinger.livedesign.bbchem_endpoints.rgroup_decompose(scaffold_mol: rdkit.Chem.rdchem.Mol, match_mol: rdkit.Chem.rdchem.Mol, options: Optional[schrodinger.rdkit.substructure.QueryOptions] = None) Optional[List[dict]]

Decomposes a molecule into its core and R-groups given a scaffold

Parameters
  • scaffold_mol – scaffold molecule on which to find R-groups

  • match_mol – source molecule for R-group decomposition

  • stereospecific – whether to consider bond stereochemistry and atom chirality of scaffold

Returns

list of dicts of R-group matches

schrodinger.livedesign.bbchem_endpoints.get_rgroup_labels(scaffold_mol: rdkit.Chem.rdchem.Mol) List[str]
Parameters

scaffold_mol – scaffold molecule

Returns

R-group labels present on the scaffold

schrodinger.livedesign.bbchem_endpoints.check_reaction(rxn_input: str) schrodinger.livedesign.check_reaction.RxnCheckResult
schrodinger.livedesign.bbchem_endpoints.setup_reaction(rxn_input: str) str

Tidy up and convert user sketched reactions into a format that can be used for reaction enumeration.

Parameters

rxn_input – a RXNBlock or RXNSMARTS describing the user’s reaction.

Returns

a SMARTS string describing the cleaned up reaction

schrodinger.livedesign.bbchem_endpoints.run_reaction(rxn_input: str, reactant_lists: List[List[str]], reactant_id_lists: Optional[List[List[str]]] = None, max_products: Optional[int] = None, property_filters: Optional[Dict] = None) Iterator[Tuple[str, List[str]]]

Execute a reaction on one or more sets of reagents

Basically, each “reaction” can have one or more than reagents, and could be run on one or more sets of reagents.

Parameters
  • rxn_input – reaction definition in any supported format, such as RXN or reaction SMARTS.

  • reactant_lists – lists of reactants in any supported format, such as MOL or SMILES. Each list has to have the correct length, matching the number of reactant templates used by the reaction.

  • reactant_lists – lists of IDs of the reactants. Each list should have exactly the same size as the corresponding list in reactant_lists. For reactants with no ID, an empty string should be used.

  • max_products – yield at most this many unique products. If not provided, all products are returned without limit or deduplication. (The canonical SMILES is used as the key.)

  • property_filters – dictionary with JSON data describing the property filters, with the schema expected by schrodinger.ui.qt.filter_dialog_dir.filter_core.Filter.

Returns

generator of tuples products in SDF format and their IDs.

schrodinger.livedesign.bbchem_endpoints.get_json_formatted_structure_hierarchy(mol_input: str, input_format: schrodinger.rdkit_extensions.Format) str

Generates a JSON string representing the structure hierarchy of the molecule. This is used by LiveDesign to display the structure hierarchy viewer for the molecule and its components.

Note that this only process the first structure in the given string.

Parameters
  • mol_input – serialized mol

  • input_format – input format of the mol string

Returns

JSON string representing the structure hierarchy