chemfp.openeye_toolkit module¶
The chemfp toolkit API wrapper for OpenEye’s OEChem toolkit.
This module is also available as chemfp.openeye
.
-
chemfp.openeye_toolkit.
is_licensed
()¶ Return True if the OEChem toolkit license is valid, otherwise False.
This does not check if the OEGraphSim license is valid. I haven’t yet figured out how I want to handle that distinction. In the meanwhile you’ll need to use the OEChem API yourself.
Returns: True or False
-
chemfp.openeye_toolkit.
get_formats
(include_unavailable=False)¶ Get the list of structure formats that OEChem supports
If include_unavailable is True then also include OEChem formats which aren’t available to this specific version of OEChem.
Parameters: include_unavailable (True or False) – include unavailable formats? Returns: a list of chemfp.base_toolkit.Format
objects
-
chemfp.openeye_toolkit.
get_input_formats
()¶ Get the list of supported OEChem input formats
Returns: a list of chemfp.base_toolkit.Format
objects
-
chemfp.openeye_toolkit.
get_output_formats
()¶ Get the list of supported OEChem output formats
Returns: a list of chemfp.base_toolkit.Format
objects
-
chemfp.openeye_toolkit.
get_format
(format)¶ Get the named format, or raise a ValueError
This will raise a ValueError if OEChem does not implement the format format_name or that format is not available.
Parameters: format_name (a string) – the format name Returns: a chemfp.base_toolkit.Format
object
-
chemfp.openeye_toolkit.
get_input_format
(format)¶ Get the named input format, or raise a ValueError
This will raise a ValueError if OEChem does not implement the format format_name or that format is not an input format.
Parameters: format_name (a string) – the format name Returns: a chemfp.base_toolkit.Format
object
-
chemfp.openeye_toolkit.
get_output_format
(format)¶ Get the named format, or raise a ValueError
This will raise a ValueError if OEChem does not implement the format format_name or that format is not an output format.
Parameters: format_name (a string) – the format name Returns: a chemfp.base_toolkit.Format
object
-
chemfp.openeye_toolkit.
get_input_format_from_source
(source=None, format=None)¶ Get the most appropriate format given the available source and format information
If format is a
chemfp.base_toolkit.Format
then return it. If it’s a Format-like object with “name” and “compression” attributes use it to make a real Format object with the same attributes. If it’s a string then use it to create a Format object.If format is None, use the source to auto-detect the format. If auto-detection is not possible, assume it’s an uncompressed SMILES file.
Parameters: - source (a filename (as a string), a file object, or None to read from stdin) – the structure data source.
- format (a Format(-like) object, string, or None) – format information, if known.
Returns: a
chemfp.base_toolkit.Format
object
-
chemfp.openeye_toolkit.
get_output_format_from_destination
(destination=None, format=None)¶ Get the most appropriate format given the available destination and format information
If format is a
chemfp.base_toolkit.Format
then return it. If it’s a Format-like object with “name” and “compression” attributes use it to make a real Format object with the same attributes. If it’s a string then use it to create a Format object.If format is None, use the destination to auto-detect the format. If auto-detection is not possible, assume it’s an uncompressed SMILES file.
Parameters: - destination (a filename (as a string), a file object, or None to read from stdin) – the structure data source.
- format (a Format(-like) object, string, or None) – format information, if known.
Returns: a
chemfp.base_toolkit.Format
object
-
chemfp.openeye_toolkit.
read_molecules
(source=None, format=None, id_tag=None, reader_args=None, errors='strict', location=None, encoding='utf8', encoding_errors='strict')¶ Return an iterator that reads OEGraphMol molecules from a structure file
Iterate through the format structure records in source. If format is None then auto-detect the format based on the source. For SD files, use id_tag to get the record id from the given SD tag instead of the title line. (read_molecules() will ignore the id_tag. It exists to make it easier to switch between reader functions.)
Note: the reader will clear and reuse the OEGraphMol instance. Make a copy if you want to keep the molecule around.
The reader_args dictionary parameters depend on the format. Every OEChem format supports:
- aromaticity - one of “default”, “openeye”, “daylight”, “tripos”, “mdl”, “mmff”, or None
- flavor - a number, string-encoded number, or flavor string
A “flavor string” is a “|” or “,” separated list of format-specific flavor terms. It can be a simple as “Default”, or a more complex string like “Default|-ENDM|DELPHI” which for the PDB reader starts with the default settings, removes the ENDM flavor, and adds the CHARGE and RADIUS flavors.
The supported input flavor terms for each format are:
- SMILES - Canon, Strict, Default
- sdf - Default
- skc - Default
- mol2, mol2h - M2H, Default
- mmod - FormalCrg, Default
- pdb - ALL, ALTLOC, BondOrder, CHARGE, Connect, DATA, DELPHI, END, ENDM, FORMALCHARGE, FormalCrg, ImplicitH, RADIUS, Rings, SecStruct, TER, TerMask, Default
- xyz - BondOrder, Connect, FormalCrg, ImplicitH, Rings, Default
- cdx - SuperAtoms, Default
- oeb - Default
You can also pass in a numeric value like 123 or a numeric string like “0”.
In addition, the SMILES record readers have limited support for the “delimiter” reader_arg:
- delimiter - one of “tab”, “space”, “to-eol”, the space or tab characters, or None
Note: the first whitespace after the SMILES string will always be treated as a delimiter.
The errors parameter specifies how to handle errors. “strict” raises an exception, “report” sends a message to stderr and goes to the next record, and “ignore” goes to the next record.
The location parameter takes a
chemfp.io.Location
instance. If None then a default Location will be created.See
chemfp.openeye_toolkit.read_ids_and_molecules()
if you want (id, OEGraphMol) pairs instead of just the molecules.Parameters: - source (a filename, file object, or None to read from stdin) – the structure source
- format (a format name string, or Format object, or None to auto-detect) – the input structure format
- id_tag (string, or None to use the record title) – SD tag containing the record id
- reader_args (a dictionary) – reader parameters passed to the underlying toolkit
- errors (one of "strict", "report", or "ignore") – specify how to handle errors
- location (a
chemfp.io.Location
object, or None) – object used to track parser state information
Returns: a
chemfp.base_toolkit.MoleculeReader
iterating OEGraphMol molecules
-
chemfp.openeye_toolkit.
read_molecules_from_string
(content, format, id_tag=None, reader_args=None, errors='strict', location=None)¶ Return an iterator that reads molecules from a string containing structure records
content is a string containing 0 or more records in the format format. See
chemfp.openeye_toolkit.read_molecules()
for details about the other parameters. Seechemfp.openeye_toolkit.read_ids_and_molecules_from_string()
if you want to read (id, OEGraphMol) pairs instead of just molecules.Note: the reader will clear and reuse the OEGraphMol instance. Make a copy if you want to keep the molecule around.
Parameters: - content (a string) – the string containing structure records
- format (a format name string, or Format object) – the input structure format
- id_tag (string, or None to use the record title) – SD tag containing the record id
- reader_args (a dictionary) – reader arguments passed to the underlying toolkit
- errors (one of "strict", "report", or "ignore") – specify how to handle errors
- location (a
chemfp.io.Location
object, or None) – object used to track parser state information
Returns: a
chemfp.base_toolkit.MoleculeReader
iterating OEGraphMol molecules
-
chemfp.openeye_toolkit.
read_ids_and_molecules
(source=None, format=None, id_tag=None, reader_args=None, errors='strict', location=None, encoding='utf8', encoding_errors='strict')¶ Return an iterator that reads (id, OEGraphMol molecule) pairs from a structure file
See
chemfp.openeye_toolkit.read_molecules()
for full parameter details. The major difference is that this returns an iterator of (id, OEGraphMol) pairs instead of just the molecules.Note: the reader will clear and reuse the OEGraphMol instance. Make a copy if you want to keep the molecule around.
Parameters: - source (a filename, file object, or None to read from stdin) – the structure source
- format (a format name string, or Format object, or None to auto-detect) – the input structure format
- id_tag (string, or None to use the record title) – SD tag containing the record id
- reader_args (a dictionary) – reader arguments passed to the underlying toolkit
- errors (one of "strict", "report", or "ignore") – specify how to handle errors
- location (a
chemfp.io.Location
object, or None) – object used to track parser state information
Returns: a
chemfp.base_toolkit.IdAndMoleculeReader
iterating (id, OEGraphMol) pairs
-
chemfp.openeye_toolkit.
read_ids_and_molecules_from_string
(content, format, id_tag=None, reader_args=None, errors='strict', location=None)¶ Return an iterator that reads (id, OEGraphMol) pairs from a string containing structure records
content is a string containing 0 or more records in the format format. See
chemfp.openeye_toolkit.read_molecules()
for details about the other parameters. Seechemfp.openeye_toolkit.read_molecules_from_string()
if you just want to read the OEGraphMol molecules instead of (id, OEGraphMol) pairs.Note: the reader will clear and reuse the OEGraphMol instance. Make a copy if you want to keep the molecule around.
Parameters: - content (a string) – the string containing structure records
- format (a format name string, or Format object) – the input structure format
- id_tag (string, or None to use the record title) – SD tag containing the record id
- reader_args (a dictionary) – reader arguments passed to the underlying toolkit
- errors (one of "strict", "report", or "ignore") – specify how to handle errors
- location (a
chemfp.io.Location
object, or None) – object used to track parser state information
Returns: a
chemfp.base_toolkit.IdAndMoleculeReader
iterating (id, OEGraphMol) pairs
-
chemfp.openeye_toolkit.
make_id_and_molecule_parser
(format, id_tag=None, reader_args=None, errors='strict')¶ Create a specialized function which takes a record and returns an (id, OEGraphMol) pair
The returned function is optimized for reading many records from individual strings because it only does parameter validation once. The function will reuse the OEGraphMol for successive calls, so make a copy if you want to keep it around. However, I haven’t really noticed much of a performance difference between this and
chemfp.openeye_toolkit.parse_id_and_molecule()
so I suggest you use that function directly instead of making a specialized function. (Let me know if making a specialized function is useful.)See
chemfp.openeye_toolkit.read_molecules()
for details about the other parameters.Parameters: - format (a format name string, or Format object) – the input structure format
- id_tag (string, or None to use the record title) – SD tag containing the record id
- reader_args (a dictionary) – reader arguments passed to the underlying toolkit
- errors (one of "strict", "report", or "ignore") – specify how to handle errors
Returns: a function of the form
parser(record string) -> (id, OEGraphMol)
-
chemfp.openeye_toolkit.
parse_molecule
(content, format, id_tag=None, reader_args=None, errors='strict')¶ Parse the first structure record from the content string and return an OEGraphMol molecule.
content is a string containing a single structure record in format format. (Additional records are ignored). See
chemfp.openeye_toolkit.read_molecules()
for details about the other parameters. Seechemfp.openeye_toolkit.parse_id_and_molecule()
if you want the (id, OEGraphMol) pair instead of just the molecule.Parameters: - content (a string) – the string containing a structure record
- format (a format name string, or Format object) – the input structure format
- id_tag (string, or None to use the record title) – SD tag containing the record id
- reader_args (a dictionary) – reader arguments passed to the underlying toolkit
- errors (one of "strict", "report", or "ignore") – specify how to handle errors
Returns: an OEGraphMol molecule
-
chemfp.openeye_toolkit.
parse_id_and_molecule
(content, format, id_tag=None, reader_args=None, errors='strict')¶ Parse the first structure record from content and return the (id, OEGraphMol) pair.
content is a string containing a single structure record in format format. (Additional records are ignored). See
chemfp.openeye_toolkit.read_molecules()
for details about the other parameters.See
chemfp.openeye_toolkit.read_molecules()
for details about the other parameters. Seechemfp.openeye_toolkit.parse_molecule()
if just want the OEGraphMol molecule and not the the (id, OEGraphMol) pair.Parameters: - content (a string) – the string containing a structure record
- format (a format name string, or Format object) – the input structure format
- id_tag (string, or None to use the record title) – SD tag containing the record id
- reader_args (a dictionary) – reader arguments passed to the underlying toolkit
- errors (one of "strict", "report", or "ignore") – specify how to handle errors
Returns: an (id, OEGraphMol molecule) pair
-
chemfp.openeye_toolkit.
create_string
(mol, format, id=None, writer_args=None, errors='strict')¶ Convert an OEChem molecule into a structure record in the given format as a Unicode string
If id is not None then use it instead of the molecule’s own title. Warning: this may briefly modify the molecule, so may not be thread-safe.
Parameters: - mol (an OEChem molecule) – the molecule to use for the output
- format (a format name string, or Format object) – the output structure format
- id (a string, or None to use the molecule's own id) – an alternate record id
- writer_args (a dictionary) – writer arguments passed to the underlying toolkit
- errors (one of "strict", "report", or "ignore") – specify how to handle errors
Returns: a string
-
chemfp.openeye_toolkit.
create_bytes
(mol, format, id=None, writer_args=None, errors='strict', level=None)¶ Convert an OEChem molecule into a structure record in the given format as a byte string
If id is not None then use it instead of the molecule’s own title. Warning: this may briefly modify the molecule, so may not be thread-safe.
Parameters: - mol (an OEChem molecule) – the molecule to use for the output
- format (a format name string, or Format object) – the output structure format
- id (a string, or None to use the molecule's own id) – an alternate record id
- writer_args (a dictionary) – writer arguments passed to the underlying toolkit
- errors (one of "strict", "report", or "ignore") – specify how to handle errors
- level (None, a positive integer, or one of the strings 'min', 'default', or 'max') – compression level to use for compressed formats
Returns: a string
-
chemfp.openeye_toolkit.
open_molecule_writer
(destination=None, format=None, writer_args=None, errors='strict', location=None, encoding='utf8', encoding_errors='strict', level=None)¶ Return a MoleculeWriter which can write OEChem molecules to a destination.
A
chemfp.base_toolkit.MoleculeWriter
has the methodswrite_molecule
,write_molecules
, andwrite_ids_and_molecules
, which are ways to write an OEChem molecule, an OEChem molecule iterator, or an (id, OEChem molecule) pair iterator to a file.Molecules are written to destination. The output format can be a string like “sdf.gz” or “smi”, a
chemfp.base_toolkit.Format
, or Format-like object with “name” and “compression” attributes, or None to auto-detect based on the destination. If auto-detection is not possible, the output will be written as uncompressed SMILES.The writer_args dictionary parameters depend on the format. Every OEChem format supports:
- aromaticity - one of “default”, “openeye”, “daylight”, “tripos”, “mdl”, “mmff”, or None
- flavor - a number, string-encoded number, or flavor string
A “flavor string” is a “|” or “,” separated list of format-specific flavor terms. It can be as simple as “Default”, or a more complex string like DEFAULT|-AtomStereo|-BondStero|Canonical to generate a canonical SMILES string without stereo information.
The supported output flavor terms for each format are:
- SMILES - AtomMaps, AtomStereo, BondStereo, Canonical, ExtBonds, Hydrogens, ImpHCount, Isotopes, Kekule, RGroups, SuperAtoms
- sdf - CurrentParity, MCHG, MDLParity, MISO, MRGP, MV30, NoParity, Default
- mol2, mol2h - AtomNames, AtomTypeNames, BondTypeNames, Hydrogens, OrderAtoms, Substructure, Default
- sln - Default
- pdb - BONDS, BOTH, CHARGE, CurrentResidues, DELPHI, ELEMENT, FORMALCHARGE, FormalCrg, HETBONDS, NoResidues, OEResidues, ORDERS, OrderAtoms, RADIUS, TER, Default
- xyz - Charges, Symbols, Default
- cdx - Default
- mopac - CHARGES, XYZ, Default
- mf - Title, Default
- oeb - Default
- inchi, inchikey - Chiral, FixedHLayer, Hydrogens, ReconnectedMetals, Stereo, RelativeStereo, RacemicStereo, Default
You can also pass in a numeric value like 123 or a numeric string like “0”.
The errors parameter specifies how to handle errors. “strict” raises an exception, “report” sends a message to stderr and goes to the next record, and “ignore” goes to the next record.
The location parameter takes a
chemfp.io.Location
instance. If None then a default Location will be created.Parameters: - destination (a filename, file object, or None to write to stdout) – the structure destination
- format (a format name string, or Format(-like) object, or None to auto-detect) – the output structure format
- writer_args (a dictionary) – writer parameters passed to the underlying toolkit
- errors (one of "strict", "report", or "ignore") – specify how to handle errors
- location (a
chemfp.io.Location
object, or None) – object used to track writer state information - level (None, a positive integer, or one of the strings 'min', 'default', or 'max') – compression level to use for compressed formats (does not affect OEChem)
Returns: a
chemfp.base_toolkit.MoleculeWriter
expecting OEChem molecules
-
chemfp.openeye_toolkit.
open_molecule_writer_to_string
(format, writer_args=None, errors='strict', location=None)¶ Return a MoleculeStringWriter which can write OEChem molecule records to a Unicode string.
See
chemfp.openeye_toolkit.open_molecule_writer()
for full parameter details.Use the writer’s
chemfp.base_toolkit.MoleculeStringWriter.getvalue()
to get the output string as a Unicode string.Parameters: - format (a format name string, or Format(-like) object, or None to auto-detect) – the output structure format
- writer_args (a dictionary) – writer arguments passed to the underlying toolkit
- errors (one of "strict", "report", or "ignore") – specify how to handle errors
- location (a
chemfp.io.Location
object, or None) – object used to track writer state information
Returns: a
chemfp.base_toolkit.MoleculeStringWriter
expecting OEChem molecules
-
chemfp.openeye_toolkit.
open_molecule_writer_to_bytes
(format, writer_args=None, errors='strict', location=None, level=None)¶ Return a MoleculeStringWriter which can write OEChem molecule records to a byte string.
See
chemfp.openeye_toolkit.open_molecule_writer()
for full parameter details.Use the writer’s
chemfp.base_toolkit.MoleculeStringWriter.getvalue()
to get the output string as a byte string.Parameters: - format (a format name string, or Format(-like) object, or None to auto-detect) – the output structure format
- writer_args (a dictionary) – writer arguments passed to the underlying toolkit
- errors (one of "strict", "report", or "ignore") – specify how to handle errors
- location (a
chemfp.io.Location
object, or None) – object used to track writer state information - level (None, a positive integer, or one of the strings 'min', 'default', or 'max') – compression level to use for compressed formats (does not affect OEChem)
Returns: a
chemfp.base_toolkit.MoleculeStringWriter
expecting OEChem molecules
-
chemfp.openeye_toolkit.
copy_molecule
(mol)¶ Return a new OEGraphMol which is a copy of the given OEChem molecule
Parameters: mol (an Open Babel molecule) – the molecule to copy Returns: a new OBMol instance
-
chemfp.openeye_toolkit.
add_tag
(mol, tag, value)¶ Add an SD tag value to the OEChem molecule
Parameters: - mol (an OEChem molecule) – the molecule
- tag (string) – the SD tag name
- value (string) – the text for the tag
Returns: None
-
chemfp.openeye_toolkit.
get_tag
(mol, tag)¶ Get the named SD tag value, or None if it doesn’t exist
Parameters: - mol (an OEChem molecule) – the molecule
- tag (string) – the SD tag name
Returns: a string, or None
-
chemfp.openeye_toolkit.
get_tag_pairs
(mol)¶ Get a list of all SD tag (name, value) pairs for the molecule
Parameters: mol (an OEChem molecule) – the molecule Returns: a list of (string name, string value) pairs
-
chemfp.openeye_toolkit.
get_id
(mol)¶ Get the molecule’s id using OEChem’s GetTitle()
Parameters: mol (an OEChem molecule) – the molecule Returns: a string
-
chemfp.openeye_toolkit.
set_id
(mol, id)¶ Set the molecule’s id using OEChem’s SetTitle()
Parameters: - mol (an OEChem molecule) – the molecule
- id (string) – the new id
Returns: None
-
chemfp.openeye_toolkit.
is_valid_aromaticity
(aromaticity_name)¶ Return True for known aromaticity names, otherwise False
-
chemfp.openeye_toolkit.
from_smistring
(content: str, *, aromaticity: Optional[Literal[none, openeye, daylight, tripos, mdl, mmff], None] = None, flavor: Union[int, str, None] = 'Default', delimiter: Optional[Literal[to_eol, space, tab, comma, whitespace, native, , ], None] = None, errors: str = 'strict')¶ Parse a SMILES string using the OEChem toolkit
- This is equivalent to calling:
- parse_molecule(content, “smistring”, reader_args={…}, errors=errors)
- Available bit flag flavors are:
- ‘Canon’ = 2 ‘Strict’ = 1 ‘Default’ = 0
Parameters: - aromaticity (None, or one of 'none', 'openeye', 'daylight', 'tripos', 'mdl', or 'mmff') – The OEChem aromaticity model
- flavor (None, integer or string with "|"- or ","-separated terms (default: "Default")) – Input flavor bit flags
- delimiter (One of None, 'to_eol', 'space', 'tab', 'comma', 'whitespace', 'native', or the space or tab characters (default: None)) – The separator between the SMILES and the id
- errors (one of "strict", "ignore", or "log") – specify how to handle errors
Returns: an OEChem molecule object
-
chemfp.openeye_toolkit.
to_smistring
(mol: Any, *, id: Optional[str, None] = None, aromaticity: Optional[Literal[none, openeye, daylight, tripos, mdl, mmff], None] = None, flavor: Union[int, str, None] = 'Default', errors: str = 'strict')¶ Generate a SMILES string from an OEChem molecule
- This is equivalent to calling:
- create_string(mol, “smistring”, id=id, writer_args={…}, errors=errors)
- Available bit flag flavors are:
- ‘AllBonds’ = 2048 ‘AtomMaps’ = 32 (in default bit flags) ‘AtomStereo’ = 8 (in default bit flags) ‘BondStereo’ = 16 (in default bit flags) ‘Canonical’ = 64 (in default bit flags) ‘ExtBonds’ = 512 ‘Hydrogens’ = 2 ‘ImpHCount’ = 1024 ‘Isotopes’ = 1 (in default bit flags) ‘Kekule’ = 128 ‘RGroups’ = 4 (in default bit flags) ‘SuperAtoms’ = 256 ‘Default’ = 125 (in default bit flags)
Parameters: - mol (an OEChem molecule) – a molecule object
- id (None or a string (default: None)) – an alternate identifier for the output record, if relevant
- aromaticity (None, or one of 'none', 'openeye', 'daylight', 'tripos', 'mdl', or 'mmff') – The OEChem aromaticity model
- flavor (None, integer or string with "|"- or ","-separated terms (default: "Default")) – Output flavor bit flags
- errors (one of "strict", "ignore", or "log") – specify how to handle errors
Returns: an OEChem molecule object
-
chemfp.openeye_toolkit.
from_smi
(content: str, *, aromaticity: Optional[Literal[none, openeye, daylight, tripos, mdl, mmff], None] = None, flavor: Union[int, str, None] = 'Default', has_header: bool = False, delimiter: Optional[Literal[to_eol, space, tab, comma, whitespace, native, , ], None] = None, errors: str = 'strict')¶ Parse a SMILES string and id using the OEChem toolkit
- This is equivalent to calling:
- parse_molecule(content, “smi”, reader_args={…}, errors=errors)
- Available bit flag flavors are:
- ‘Canon’ = 2 ‘Strict’ = 1 ‘Default’ = 0
Parameters: - aromaticity (None, or one of 'none', 'openeye', 'daylight', 'tripos', 'mdl', or 'mmff') – The OEChem aromaticity model
- flavor (None, integer or string with "|"- or ","-separated terms (default: "Default")) – Input flavor bit flags
- has_header (Boolean (default: False)) – If true, treat the first line of the SMILES file as a header
- delimiter (One of None, 'to_eol', 'space', 'tab', 'comma', 'whitespace', 'native', or the space or tab characters (default: None)) – The separator between the SMILES and the id
- errors (one of "strict", "ignore", or "log") – specify how to handle errors
Returns: an OEChem molecule object
-
chemfp.openeye_toolkit.
to_smi
(mol: Any, *, id: Optional[str, None] = None, aromaticity: Optional[Literal[none, openeye, daylight, tripos, mdl, mmff], None] = None, flavor: Union[int, str, None] = 'Default', errors: str = 'strict')¶ Generate a SMILES string and id from an OEChem molecule
- This is equivalent to calling:
- create_string(mol, “smi”, id=id, writer_args={…}, errors=errors)
- Available bit flag flavors are:
- ‘AllBonds’ = 2048 ‘AtomMaps’ = 32 (in default bit flags) ‘AtomStereo’ = 8 (in default bit flags) ‘BondStereo’ = 16 (in default bit flags) ‘Canonical’ = 64 (in default bit flags) ‘ExtBonds’ = 512 ‘Hydrogens’ = 2 ‘ImpHCount’ = 1024 ‘Isotopes’ = 1 (in default bit flags) ‘Kekule’ = 128 ‘RGroups’ = 4 (in default bit flags) ‘SuperAtoms’ = 256 ‘Default’ = 125 (in default bit flags)
Parameters: - mol (an OEChem molecule) – a molecule object
- id (None or a string (default: None)) – an alternate identifier for the output record, if relevant
- aromaticity (None, or one of 'none', 'openeye', 'daylight', 'tripos', 'mdl', or 'mmff') – The OEChem aromaticity model
- flavor (None, integer or string with "|"- or ","-separated terms (default: "Default")) – Output flavor bit flags
- errors (one of "strict", "ignore", or "log") – specify how to handle errors
Returns: an OEChem molecule object
-
chemfp.openeye_toolkit.
from_smi_file
(source: Union[None, str, BinaryIO], *, aromaticity: Optional[Literal[none, openeye, daylight, tripos, mdl, mmff], None] = None, flavor: Union[int, str, None] = 'Default', has_header: bool = False, delimiter: Optional[Literal[to_eol, space, tab, comma, whitespace, native, , ], None] = None, errors: str = 'strict')¶ Parse a SMILES string and id file using the OEChem toolkit
- This is mostly equivalent to calling:
- read_molecules(source, “smi”, reader_args={…}, errors=errors)
- Available bit flag flavors are:
- ‘Canon’ = 2 ‘Strict’ = 1 ‘Default’ = 0
Parameters: - aromaticity (None, or one of 'none', 'openeye', 'daylight', 'tripos', 'mdl', or 'mmff') – The OEChem aromaticity model
- flavor (None, integer or string with "|"- or ","-separated terms (default: "Default")) – Input flavor bit flags
- has_header (Boolean (default: False)) – If true, treat the first line of the SMILES file as a header
- delimiter (One of None, 'to_eol', 'space', 'tab', 'comma', 'whitespace', 'native', or the space or tab characters (default: None)) – The separator between the SMILES and the id
- errors (one of "strict", "ignore", or "log") – specify how to handle errors
Returns: a
chemfp.base_toolkit.MoleculeReader
iterating OEChem molecules
-
chemfp.openeye_toolkit.
to_smi_file
(destination: Union[None, str, BinaryIO], *, aromaticity: Optional[Literal[none, openeye, daylight, tripos, mdl, mmff], None] = None, flavor: Union[int, str, None] = 'Default', errors: str = 'strict')¶ Generate a SMILES string and id from an OEChem molecule
- This is mostly equivalent to calling:
- open_molecule_writer(destination, “smi”, writer_args={…}, errors=errors)
- Available bit flag flavors are:
- ‘AllBonds’ = 2048 ‘AtomMaps’ = 32 (in default bit flags) ‘AtomStereo’ = 8 (in default bit flags) ‘BondStereo’ = 16 (in default bit flags) ‘Canonical’ = 64 (in default bit flags) ‘ExtBonds’ = 512 ‘Hydrogens’ = 2 ‘ImpHCount’ = 1024 ‘Isotopes’ = 1 (in default bit flags) ‘Kekule’ = 128 ‘RGroups’ = 4 (in default bit flags) ‘SuperAtoms’ = 256 ‘Default’ = 125 (in default bit flags)
Parameters: - destination (None, a filename string, or a file-like object) – where to write the molecules
- aromaticity (None, or one of 'none', 'openeye', 'daylight', 'tripos', 'mdl', or 'mmff') – The OEChem aromaticity model
- flavor (None, integer or string with "|"- or ","-separated terms (default: "Default")) – Output flavor bit flags
- errors (one of "strict", "ignore", or "log") – specify how to handle errors
Returns: a
chemfp.base_toolkit.MoleculeWriter
expecting OEChem molecules
-
chemfp.openeye_toolkit.
from_sdf
(content: str, *, aromaticity: Optional[Literal[none, openeye, daylight, tripos, mdl, mmff], None] = None, flavor: Union[int, str, None] = 'Default', errors: str = 'strict')¶ Parse an SDF record using the OEChem toolkit
- This is equivalent to calling:
- parse_molecule(content, “sdf”, reader_args={…}, errors=errors)
- Available bit flag flavors are:
- ‘FixBondMarks’ = 1 ‘SuppressEmptyMolSkip’ = 4 ‘SuppressImp2ExpENHSTE’ = 2 ‘Default’ = 0
Parameters: - aromaticity (None, or one of 'none', 'openeye', 'daylight', 'tripos', 'mdl', or 'mmff') – The OEChem aromaticity model
- flavor (None, integer or string with "|"- or ","-separated terms (default: "Default")) – Input flavor bit flags
- errors (one of "strict", "ignore", or "log") – specify how to handle errors
Returns: an OEChem molecule object
-
chemfp.openeye_toolkit.
to_sdf
(mol: Any, *, id: Optional[str, None] = None, aromaticity: Optional[Literal[none, openeye, daylight, tripos, mdl, mmff], None] = None, flavor: Union[int, str, None] = 'Default', errors: str = 'strict')¶ Generate an SDF record from an OEChem molecule
- This is equivalent to calling:
- create_string(mol, “sdf”, id=id, writer_args={…}, errors=errors)
- Available bit flag flavors are:
- ‘Add2D’ = 256 (in default bit flags) ‘CurrentParity’ = 64 ‘MCHG’ = 1 (in default bit flags) ‘MDLParity’ = 16 (in default bit flags) ‘MISO’ = 2 (in default bit flags) ‘MRGP’ = 4 (in default bit flags) ‘MV30’ = 8 (in default bit flags) ‘NoParity’ = 32 ‘SuppressImp2ExpENHSTE’ = 1024 ‘SuppressTimestamps’ = 2048 ‘UnsetBad2DStereo’ = 512 ‘Default’ = 287 (in default bit flags)
Parameters: - mol (an OEChem molecule) – a molecule object
- id (None or a string (default: None)) – an alternate identifier for the output record, if relevant
- aromaticity (None, or one of 'none', 'openeye', 'daylight', 'tripos', 'mdl', or 'mmff') – The OEChem aromaticity model
- flavor (None, integer or string with "|"- or ","-separated terms (default: "Default")) – Output flavor bit flags
- errors (one of "strict", "ignore", or "log") – specify how to handle errors
Returns: an OEChem molecule object
-
chemfp.openeye_toolkit.
from_sdf_file
(source: Union[None, str, BinaryIO], *, aromaticity: Optional[Literal[none, openeye, daylight, tripos, mdl, mmff], None] = None, flavor: Union[int, str, None] = 'Default', errors: str = 'strict')¶ Parse an SDF record file using the OEChem toolkit
- This is mostly equivalent to calling:
- read_molecules(source, “sdf”, reader_args={…}, errors=errors)
- Available bit flag flavors are:
- ‘FixBondMarks’ = 1 ‘SuppressEmptyMolSkip’ = 4 ‘SuppressImp2ExpENHSTE’ = 2 ‘Default’ = 0
Parameters: - aromaticity (None, or one of 'none', 'openeye', 'daylight', 'tripos', 'mdl', or 'mmff') – The OEChem aromaticity model
- flavor (None, integer or string with "|"- or ","-separated terms (default: "Default")) – Input flavor bit flags
- errors (one of "strict", "ignore", or "log") – specify how to handle errors
Returns: a
chemfp.base_toolkit.MoleculeReader
iterating OEChem molecules
-
chemfp.openeye_toolkit.
to_sdf_file
(destination: Union[None, str, BinaryIO], *, aromaticity: Optional[Literal[none, openeye, daylight, tripos, mdl, mmff], None] = None, flavor: Union[int, str, None] = 'Default', errors: str = 'strict')¶ Generate an SDF record from an OEChem molecule
- This is mostly equivalent to calling:
- open_molecule_writer(destination, “sdf”, writer_args={…}, errors=errors)
- Available bit flag flavors are:
- ‘Add2D’ = 256 (in default bit flags) ‘CurrentParity’ = 64 ‘MCHG’ = 1 (in default bit flags) ‘MDLParity’ = 16 (in default bit flags) ‘MISO’ = 2 (in default bit flags) ‘MRGP’ = 4 (in default bit flags) ‘MV30’ = 8 (in default bit flags) ‘NoParity’ = 32 ‘SuppressImp2ExpENHSTE’ = 1024 ‘SuppressTimestamps’ = 2048 ‘UnsetBad2DStereo’ = 512 ‘Default’ = 287 (in default bit flags)
Parameters: - destination (None, a filename string, or a file-like object) – where to write the molecules
- aromaticity (None, or one of 'none', 'openeye', 'daylight', 'tripos', 'mdl', or 'mmff') – The OEChem aromaticity model
- flavor (None, integer or string with "|"- or ","-separated terms (default: "Default")) – Output flavor bit flags
- errors (one of "strict", "ignore", or "log") – specify how to handle errors
Returns: a
chemfp.base_toolkit.MoleculeWriter
expecting OEChem molecules
-
chemfp.openeye_toolkit.
to_sdf3k
(mol: Any, *, id: Optional[str, None] = None, aromaticity: Optional[Literal[none, openeye, daylight, tripos, mdl, mmff], None] = None, flavor: Union[int, str, None] = 'Default', errors: str = 'strict')¶ Generate an SDF record in V3000 format from an OEChem molecule
- This is equivalent to calling:
- create_string(mol, “sdf3k”, id=id, writer_args={…}, errors=errors)
- Available bit flag flavors are:
- ‘Add2D’ = 256 (in default bit flags) ‘CurrentParity’ = 64 ‘MCHG’ = 1 (in default bit flags) ‘MDLParity’ = 16 (in default bit flags) ‘MISO’ = 2 (in default bit flags) ‘MRGP’ = 4 (in default bit flags) ‘MV30’ = 8 (in default bit flags) ‘NoParity’ = 32 ‘SuppressImp2ExpENHSTE’ = 1024 ‘SuppressTimestamps’ = 2048 ‘UnsetBad2DStereo’ = 512 ‘Default’ = 287 (in default bit flags)
Parameters: - mol (an OEChem molecule) – a molecule object
- id (None or a string (default: None)) – an alternate identifier for the output record, if relevant
- aromaticity (None, or one of 'none', 'openeye', 'daylight', 'tripos', 'mdl', or 'mmff') – The OEChem aromaticity model
- flavor (None, integer or string with "|"- or ","-separated terms (default: "Default")) – Output flavor bit flags
- errors (one of "strict", "ignore", or "log") – specify how to handle errors
Returns: an OEChem molecule object
-
chemfp.openeye_toolkit.
to_sdf3k_file
(destination: Union[None, str, BinaryIO], *, aromaticity: Optional[Literal[none, openeye, daylight, tripos, mdl, mmff], None] = None, flavor: Union[int, str, None] = 'Default', errors: str = 'strict')¶ Generate an SDF record in V3000 format from an OEChem molecule
- This is mostly equivalent to calling:
- open_molecule_writer(destination, “sdf3k”, writer_args={…}, errors=errors)
- Available bit flag flavors are:
- ‘Add2D’ = 256 (in default bit flags) ‘CurrentParity’ = 64 ‘MCHG’ = 1 (in default bit flags) ‘MDLParity’ = 16 (in default bit flags) ‘MISO’ = 2 (in default bit flags) ‘MRGP’ = 4 (in default bit flags) ‘MV30’ = 8 (in default bit flags) ‘NoParity’ = 32 ‘SuppressImp2ExpENHSTE’ = 1024 ‘SuppressTimestamps’ = 2048 ‘UnsetBad2DStereo’ = 512 ‘Default’ = 287 (in default bit flags)
Parameters: - destination (None, a filename string, or a file-like object) – where to write the molecules
- aromaticity (None, or one of 'none', 'openeye', 'daylight', 'tripos', 'mdl', or 'mmff') – The OEChem aromaticity model
- flavor (None, integer or string with "|"- or ","-separated terms (default: "Default")) – Output flavor bit flags
- errors (one of "strict", "ignore", or "log") – specify how to handle errors
Returns: a
chemfp.base_toolkit.MoleculeWriter
expecting OEChem molecules
-
chemfp.openeye_toolkit.
from_molfile
(content: str, *, aromaticity: Optional[Literal[none, openeye, daylight, tripos, mdl, mmff], None] = None, flavor: Union[int, str, None] = 'Default', errors: str = 'strict')¶ Parse a molfile using the OEChem toolkit
- This is equivalent to calling:
- parse_molecule(content, “molfile”, reader_args={…}, errors=errors)
- Available bit flag flavors are:
- ‘FixBondMarks’ = 1 ‘SuppressEmptyMolSkip’ = 4 ‘SuppressImp2ExpENHSTE’ = 2 ‘Default’ = 0
Parameters: - aromaticity (None, or one of 'none', 'openeye', 'daylight', 'tripos', 'mdl', or 'mmff') – The OEChem aromaticity model
- flavor (None, integer or string with "|"- or ","-separated terms (default: "Default")) – Input flavor bit flags
- errors (one of "strict", "ignore", or "log") – specify how to handle errors
Returns: an OEChem molecule object
-
chemfp.openeye_toolkit.
to_molfile
(mol: Any, *, id: Optional[str, None] = None, aromaticity: Optional[Literal[none, openeye, daylight, tripos, mdl, mmff], None] = None, flavor: Union[int, str, None] = 'Default', errors: str = 'strict')¶ Generate a molfile from an OEChem molecule
- This is equivalent to calling:
- create_string(mol, “molfile”, id=id, writer_args={…}, errors=errors)
- Available bit flag flavors are:
- ‘Add2D’ = 256 (in default bit flags) ‘CurrentParity’ = 64 ‘MCHG’ = 1 (in default bit flags) ‘MDLParity’ = 16 (in default bit flags) ‘MISO’ = 2 (in default bit flags) ‘MRGP’ = 4 (in default bit flags) ‘MV30’ = 8 ‘NoParity’ = 32 ‘SuppressImp2ExpENHSTE’ = 1024 ‘SuppressTimestamps’ = 2048 ‘UnsetBad2DStereo’ = 512 ‘Default’ = 279 (in default bit flags)
Parameters: - mol (an OEChem molecule) – a molecule object
- id (None or a string (default: None)) – an alternate identifier for the output record, if relevant
- aromaticity (None, or one of 'none', 'openeye', 'daylight', 'tripos', 'mdl', or 'mmff') – The OEChem aromaticity model
- flavor (None, integer or string with "|"- or ","-separated terms (default: "Default")) – Output flavor bit flags
- errors (one of "strict", "ignore", or "log") – specify how to handle errors
Returns: an OEChem molecule object
-
chemfp.openeye_toolkit.
from_oez
(content: str, *, flavor: Union[int, str, None] = 'Default', errors: str = 'strict')¶ Parse an OEZ using the OEChem toolkit
- This is equivalent to calling:
- parse_molecule(content, “oez”, reader_args={…}, errors=errors)
- Available bit flag flavors are:
- ‘Default’ = 0
Parameters: - flavor (None, integer or string with "|"- or ","-separated terms (default: "Default")) – Input flavor bit flags
- errors (one of "strict", "ignore", or "log") – specify how to handle errors
Returns: an OEChem molecule object
-
chemfp.openeye_toolkit.
to_oez
(mol: Any, *, id: Optional[str, None] = None, flavor: Union[int, str, None] = 'Default', errors: str = 'strict')¶ Generate an OEZ from an OEChem molecule
- This is equivalent to calling:
- create_string(mol, “oez”, id=id, writer_args={…}, errors=errors)
- Available bit flag flavors are:
- ‘Default’ = 0
Parameters: - mol (an OEChem molecule) – a molecule object
- id (None or a string (default: None)) – an alternate identifier for the output record, if relevant
- flavor (None, integer or string with "|"- or ","-separated terms (default: "Default")) – Output flavor bit flags
- errors (one of "strict", "ignore", or "log") – specify how to handle errors
Returns: an OEChem molecule object
-
chemfp.openeye_toolkit.
from_oez_file
(source: Union[None, str, BinaryIO], *, flavor: Union[int, str, None] = 'Default', errors: str = 'strict')¶ Parse an OEZ file using the OEChem toolkit
- This is mostly equivalent to calling:
- read_molecules(source, “oez”, reader_args={…}, errors=errors)
- Available bit flag flavors are:
- ‘Default’ = 0
Parameters: - flavor (None, integer or string with "|"- or ","-separated terms (default: "Default")) – Input flavor bit flags
- errors (one of "strict", "ignore", or "log") – specify how to handle errors
Returns: a
chemfp.base_toolkit.MoleculeReader
iterating OEChem molecules
-
chemfp.openeye_toolkit.
to_oez_file
(destination: Union[None, str, BinaryIO], *, flavor: Union[int, str, None] = 'Default', errors: str = 'strict')¶ Generate an OEZ from an OEChem molecule
- This is mostly equivalent to calling:
- open_molecule_writer(destination, “oez”, writer_args={…}, errors=errors)
- Available bit flag flavors are:
- ‘Default’ = 0
Parameters: - destination (None, a filename string, or a file-like object) – where to write the molecules
- flavor (None, integer or string with "|"- or ","-separated terms (default: "Default")) – Output flavor bit flags
- errors (one of "strict", "ignore", or "log") – specify how to handle errors
Returns: a
chemfp.base_toolkit.MoleculeWriter
expecting OEChem molecules
-
chemfp.openeye_toolkit.
from_fasta
(content: str, *, flavor: Union[int, str, None] = 'Default', errors: str = 'strict')¶ Parse a FASTA record using the OEChem toolkit
- This is equivalent to calling:
- parse_molecule(content, “fasta”, reader_args={…}, errors=errors)
- Available bit flag flavors are:
- ‘CustomResidues’ = 1 ‘EmbeddedSMILES’ = 2 ‘Default’ = 0
Parameters: - flavor (None, integer or string with "|"- or ","-separated terms (default: "Default")) – Input flavor bit flags
- errors (one of "strict", "ignore", or "log") – specify how to handle errors
Returns: an OEChem molecule object
-
chemfp.openeye_toolkit.
to_fasta
(mol: Any, *, id: Optional[str, None] = None, flavor: Union[int, str, None] = 'Default', errors: str = 'strict')¶ Generate a FASTA record from an OEChem molecule
- This is equivalent to calling:
- create_string(mol, “fasta”, id=id, writer_args={…}, errors=errors)
- Available bit flag flavors are:
- ‘Default’ = 0
Parameters: - mol (an OEChem molecule) – a molecule object
- id (None or a string (default: None)) – an alternate identifier for the output record, if relevant
- flavor (None, integer or string with "|"- or ","-separated terms (default: "Default")) – Output flavor bit flags
- errors (one of "strict", "ignore", or "log") – specify how to handle errors
Returns: an OEChem molecule object
-
chemfp.openeye_toolkit.
from_fasta_file
(source: Union[None, str, BinaryIO], *, flavor: Union[int, str, None] = 'Default', errors: str = 'strict')¶ Parse a FASTA record file using the OEChem toolkit
- This is mostly equivalent to calling:
- read_molecules(source, “fasta”, reader_args={…}, errors=errors)
- Available bit flag flavors are:
- ‘CustomResidues’ = 1 ‘EmbeddedSMILES’ = 2 ‘Default’ = 0
Parameters: - flavor (None, integer or string with "|"- or ","-separated terms (default: "Default")) – Input flavor bit flags
- errors (one of "strict", "ignore", or "log") – specify how to handle errors
Returns: a
chemfp.base_toolkit.MoleculeReader
iterating OEChem molecules
-
chemfp.openeye_toolkit.
to_fasta_file
(destination: Union[None, str, BinaryIO], *, flavor: Union[int, str, None] = 'Default', errors: str = 'strict')¶ Generate a FASTA record from an OEChem molecule
- This is mostly equivalent to calling:
- open_molecule_writer(destination, “fasta”, writer_args={…}, errors=errors)
- Available bit flag flavors are:
- ‘Default’ = 0
Parameters: - destination (None, a filename string, or a file-like object) – where to write the molecules
- flavor (None, integer or string with "|"- or ","-separated terms (default: "Default")) – Output flavor bit flags
- errors (one of "strict", "ignore", or "log") – specify how to handle errors
Returns: a
chemfp.base_toolkit.MoleculeWriter
expecting OEChem molecules
-
chemfp.openeye_toolkit.
from_sequence
(content: str, *, flavor: Union[int, str, None] = 'Default', errors: str = 'strict')¶ Parse an IUPAC sequence using the OEChem toolkit
- This is equivalent to calling:
- parse_molecule(content, “sequence”, reader_args={…}, errors=errors)
- Available bit flag flavors are:
- ‘CustomResidues’ = 1 ‘EmbeddedSMILES’ = 2 ‘Default’ = 0
Parameters: - flavor (None, integer or string with "|"- or ","-separated terms (default: "Default")) – Input flavor bit flags
- errors (one of "strict", "ignore", or "log") – specify how to handle errors
Returns: an OEChem molecule object
-
chemfp.openeye_toolkit.
to_sequence
(mol: Any, *, id: Optional[str, None] = None, flavor: Union[int, str, None] = 'Default', errors: str = 'strict')¶ Generate an IUPAC sequence from an OEChem molecule
- This is equivalent to calling:
- create_string(mol, “sequence”, id=id, writer_args={…}, errors=errors)
- Available bit flag flavors are:
- ‘Default’ = 0
Parameters: - mol (an OEChem molecule) – a molecule object
- id (None or a string (default: None)) – an alternate identifier for the output record, if relevant
- flavor (None, integer or string with "|"- or ","-separated terms (default: "Default")) – Output flavor bit flags
- errors (one of "strict", "ignore", or "log") – specify how to handle errors
Returns: an OEChem molecule object
-
chemfp.openeye_toolkit.
from_pdb
(content: str, *, aromaticity: Optional[Literal[none, openeye, daylight, tripos, mdl, mmff], None] = None, flavor: Union[int, str, None] = 'Default', errors: str = 'strict')¶ Parse a PDB record using the OEChem toolkit
- This is equivalent to calling:
- parse_molecule(content, “pdb”, reader_args={…}, errors=errors)
- Available bit flag flavors are:
- ‘ALL’ = 8 ‘ALTLOC’ = 32526 ‘BondOrder’ = 1024 (in default bit flags) ‘CHARGE’ = 32 ‘Connect’ = 4096 (in default bit flags) ‘DATA’ = 16 ‘DELPHI’ = 96 ‘END’ = 2 (in default bit flags) ‘ENDM’ = 4 (in default bit flags) ‘FORMALCHARGE’ = 128 ‘FormalCrg’ = 256 (in default bit flags) ‘ImplicitH’ = 512 (in default bit flags) ‘RADIUS’ = 64 ‘Rings’ = 2048 (in default bit flags) ‘SecStruct’ = 8192 (in default bit flags) ‘TER’ = 1 ‘Default’ = 16134 (in default bit flags)
Parameters: - aromaticity (None, or one of 'none', 'openeye', 'daylight', 'tripos', 'mdl', or 'mmff') – The OEChem aromaticity model
- flavor (None, integer or string with "|"- or ","-separated terms (default: "Default")) – Input flavor bit flags
- errors (one of "strict", "ignore", or "log") – specify how to handle errors
Returns: an OEChem molecule object
-
chemfp.openeye_toolkit.
to_pdb
(mol: Any, *, id: Optional[str, None] = None, flavor: Union[int, str, None] = 'Default', errors: str = 'strict')¶ Generate a PDB record from an OEChem molecule
- This is equivalent to calling:
- create_string(mol, “pdb”, id=id, writer_args={…}, errors=errors)
- Available bit flag flavors are:
- ‘BONDS’ = 1 ‘BOTH’ = 4 (in default bit flags) ‘CHARGE’ = 8 ‘CurrentResidues’ = 2048 ‘DELPHI’ = 24 ‘ELEMENT’ = 64 (in default bit flags) ‘FORMALCHARGE’ = 128 ‘FormalCrg’ = 128 ‘HETBONDS’ = 256 (in default bit flags) ‘NoResidues’ = 1024 ‘OEResidues’ = 512 (in default bit flags) ‘ORDERS’ = 2 ‘OrderAtoms’ = 4096 (in default bit flags) ‘RADIUS’ = 16 ‘TER’ = 32 ‘Default’ = 4932 (in default bit flags)
Parameters: - mol (an OEChem molecule) – a molecule object
- id (None or a string (default: None)) – an alternate identifier for the output record, if relevant
- flavor (None, integer or string with "|"- or ","-separated terms (default: "Default")) – Output flavor bit flags
- errors (one of "strict", "ignore", or "log") – specify how to handle errors
Returns: an OEChem molecule object
-
chemfp.openeye_toolkit.
from_pdb_file
(source: Union[None, str, BinaryIO], *, aromaticity: Optional[Literal[none, openeye, daylight, tripos, mdl, mmff], None] = None, flavor: Union[int, str, None] = 'Default', errors: str = 'strict')¶ Parse a PDB record file using the OEChem toolkit
- This is mostly equivalent to calling:
- read_molecules(source, “pdb”, reader_args={…}, errors=errors)
- Available bit flag flavors are:
- ‘ALL’ = 8 ‘ALTLOC’ = 32526 ‘BondOrder’ = 1024 (in default bit flags) ‘CHARGE’ = 32 ‘Connect’ = 4096 (in default bit flags) ‘DATA’ = 16 ‘DELPHI’ = 96 ‘END’ = 2 (in default bit flags) ‘ENDM’ = 4 (in default bit flags) ‘FORMALCHARGE’ = 128 ‘FormalCrg’ = 256 (in default bit flags) ‘ImplicitH’ = 512 (in default bit flags) ‘RADIUS’ = 64 ‘Rings’ = 2048 (in default bit flags) ‘SecStruct’ = 8192 (in default bit flags) ‘TER’ = 1 ‘Default’ = 16134 (in default bit flags)
Parameters: - aromaticity (None, or one of 'none', 'openeye', 'daylight', 'tripos', 'mdl', or 'mmff') – The OEChem aromaticity model
- flavor (None, integer or string with "|"- or ","-separated terms (default: "Default")) – Input flavor bit flags
- errors (one of "strict", "ignore", or "log") – specify how to handle errors
Returns: a
chemfp.base_toolkit.MoleculeReader
iterating OEChem molecules
-
chemfp.openeye_toolkit.
to_pdb_file
(destination: Union[None, str, BinaryIO], *, flavor: Union[int, str, None] = 'Default', errors: str = 'strict')¶ Generate a PDB record from an OEChem molecule
- This is mostly equivalent to calling:
- open_molecule_writer(destination, “pdb”, writer_args={…}, errors=errors)
- Available bit flag flavors are:
- ‘BONDS’ = 1 ‘BOTH’ = 4 (in default bit flags) ‘CHARGE’ = 8 ‘CurrentResidues’ = 2048 ‘DELPHI’ = 24 ‘ELEMENT’ = 64 (in default bit flags) ‘FORMALCHARGE’ = 128 ‘FormalCrg’ = 128 ‘HETBONDS’ = 256 (in default bit flags) ‘NoResidues’ = 1024 ‘OEResidues’ = 512 (in default bit flags) ‘ORDERS’ = 2 ‘OrderAtoms’ = 4096 (in default bit flags) ‘RADIUS’ = 16 ‘TER’ = 32 ‘Default’ = 4932 (in default bit flags)
Parameters: - destination (None, a filename string, or a file-like object) – where to write the molecules
- flavor (None, integer or string with "|"- or ","-separated terms (default: "Default")) – Output flavor bit flags
- errors (one of "strict", "ignore", or "log") – specify how to handle errors
Returns: a
chemfp.base_toolkit.MoleculeWriter
expecting OEChem molecules
-
chemfp.openeye_toolkit.
from_inchi
(content: str, *, aromaticity: Optional[Literal[none, openeye, daylight, tripos, mdl, mmff], None] = None, flavor: Union[int, str, None] = 'Default', has_header: bool = False, delimiter: Optional[Literal[to_eol, space, tab, comma, whitespace, native, , ], None] = None, errors: str = 'strict')¶ Parse an InChI string and id using the OEChem toolkit
- This is equivalent to calling:
- parse_molecule(content, “inchi”, reader_args={…}, errors=errors)
- Available bit flag flavors are:
- ‘Default’ = 0
Parameters: - aromaticity (None, or one of 'none', 'openeye', 'daylight', 'tripos', 'mdl', or 'mmff') – The OEChem aromaticity model
- flavor (None, integer or string with "|"- or ","-separated terms (default: "Default")) – Input flavor bit flags
- has_header (Boolean (default: False)) – If true, treat the first line of the SMILES file as a header
- delimiter (One of None, 'to_eol', 'space', 'tab', 'comma', 'whitespace', 'native', or the space or tab characters (default: None)) – The separator between the SMILES and the id
- errors (one of "strict", "ignore", or "log") – specify how to handle errors
Returns: an OEChem molecule object
-
chemfp.openeye_toolkit.
to_inchi
(mol: Any, *, id: Optional[str, None] = None, flavor: Union[int, str, None] = 'Default', delimiter: Optional[Literal[to_eol, space, tab, comma, whitespace, native, , ], None] = None, include_id: bool = True, errors: str = 'strict')¶ Generate an InChI string and id from an OEChem molecule
- This is equivalent to calling:
- create_string(mol, “inchi”, id=id, writer_args={…}, errors=errors)
- Available bit flag flavors are:
- ‘Chiral’ = 4 ‘FixedHLayer’ = 8 ‘Hydrogens’ = 1 ‘ReconnectedMetals’ = 16 ‘Stereo’ = 2 (in default bit flags) ‘RelativeStereo’ = 32 ‘RacemicStereo’ = 64 ‘Default’ = 130 (in default bit flags)
Parameters: - mol (an OEChem molecule) – a molecule object
- id (None or a string (default: None)) – an alternate identifier for the output record, if relevant
- flavor (None, integer or string with "|"- or ","-separated terms (default: "Default")) – Output flavor bit flags
- delimiter (One of None, 'to_eol', 'space', 'tab', 'comma', 'whitespace', 'native', or the space or tab characters (default: None)) – The separator between the SMILES and the id
- include_id (Boolean (default: True)) – if true, include the molecule id in the output
- errors (one of "strict", "ignore", or "log") – specify how to handle errors
Returns: an OEChem molecule object
-
chemfp.openeye_toolkit.
from_inchi_file
(source: Union[None, str, BinaryIO], *, aromaticity: Optional[Literal[none, openeye, daylight, tripos, mdl, mmff], None] = None, flavor: Union[int, str, None] = 'Default', has_header: bool = False, delimiter: Optional[Literal[to_eol, space, tab, comma, whitespace, native, , ], None] = None, errors: str = 'strict')¶ Parse an InChI string and id file using the OEChem toolkit
- This is mostly equivalent to calling:
- read_molecules(source, “inchi”, reader_args={…}, errors=errors)
- Available bit flag flavors are:
- ‘Default’ = 0
Parameters: - aromaticity (None, or one of 'none', 'openeye', 'daylight', 'tripos', 'mdl', or 'mmff') – The OEChem aromaticity model
- flavor (None, integer or string with "|"- or ","-separated terms (default: "Default")) – Input flavor bit flags
- has_header (Boolean (default: False)) – If true, treat the first line of the SMILES file as a header
- delimiter (One of None, 'to_eol', 'space', 'tab', 'comma', 'whitespace', 'native', or the space or tab characters (default: None)) – The separator between the SMILES and the id
- errors (one of "strict", "ignore", or "log") – specify how to handle errors
Returns: a
chemfp.base_toolkit.MoleculeReader
iterating OEChem molecules
-
chemfp.openeye_toolkit.
to_inchi_file
(destination: Union[None, str, BinaryIO], *, flavor: Union[int, str, None] = 'Default', delimiter: Optional[Literal[to_eol, space, tab, comma, whitespace, native, , ], None] = None, include_id: bool = True, errors: str = 'strict')¶ Generate an InChI string and id from an OEChem molecule
- This is mostly equivalent to calling:
- open_molecule_writer(destination, “inchi”, writer_args={…}, errors=errors)
- Available bit flag flavors are:
- ‘Chiral’ = 4 ‘FixedHLayer’ = 8 ‘Hydrogens’ = 1 ‘ReconnectedMetals’ = 16 ‘Stereo’ = 2 (in default bit flags) ‘RelativeStereo’ = 32 ‘RacemicStereo’ = 64 ‘Default’ = 130 (in default bit flags)
Parameters: - destination (None, a filename string, or a file-like object) – where to write the molecules
- flavor (None, integer or string with "|"- or ","-separated terms (default: "Default")) – Output flavor bit flags
- delimiter (One of None, 'to_eol', 'space', 'tab', 'comma', 'whitespace', 'native', or the space or tab characters (default: None)) – The separator between the SMILES and the id
- include_id (Boolean (default: True)) – if true, include the molecule id in the output
- errors (one of "strict", "ignore", or "log") – specify how to handle errors
Returns: a
chemfp.base_toolkit.MoleculeWriter
expecting OEChem molecules
-
chemfp.openeye_toolkit.
from_inchistring
(content: str, *, flavor: Union[int, str, None] = 'Default', delimiter: Optional[Literal[to_eol, space, tab, comma, whitespace, native, , ], None] = None, errors: str = 'strict')¶ Parse an InChI string using the OEChem toolkit
- This is equivalent to calling:
- parse_molecule(content, “inchistring”, reader_args={…}, errors=errors)
- Available bit flag flavors are:
- ‘Default’ = 0
Parameters: - flavor (None, integer or string with "|"- or ","-separated terms (default: "Default")) – Input flavor bit flags
- delimiter (One of None, 'to_eol', 'space', 'tab', 'comma', 'whitespace', 'native', or the space or tab characters (default: None)) – The separator between the SMILES and the id
- errors (one of "strict", "ignore", or "log") – specify how to handle errors
Returns: an OEChem molecule object
-
chemfp.openeye_toolkit.
to_inchistring
(mol: Any, *, id: Optional[str, None] = None, flavor: Union[int, str, None] = 'Default', delimiter: Optional[Literal[to_eol, space, tab, comma, whitespace, native, , ], None] = None, errors: str = 'strict')¶ Generate an InChI string from an OEChem molecule
- This is equivalent to calling:
- create_string(mol, “inchistring”, id=id, writer_args={…}, errors=errors)
- Available bit flag flavors are:
- ‘Chiral’ = 4 ‘FixedHLayer’ = 8 ‘Hydrogens’ = 1 ‘ReconnectedMetals’ = 16 ‘Stereo’ = 2 (in default bit flags) ‘RelativeStereo’ = 32 ‘RacemicStereo’ = 64 ‘Default’ = 130 (in default bit flags)
Parameters: - mol (an OEChem molecule) – a molecule object
- id (None or a string (default: None)) – an alternate identifier for the output record, if relevant
- flavor (None, integer or string with "|"- or ","-separated terms (default: "Default")) – Output flavor bit flags
- delimiter (One of None, 'to_eol', 'space', 'tab', 'comma', 'whitespace', 'native', or the space or tab characters (default: None)) – The separator between the SMILES and the id
- errors (one of "strict", "ignore", or "log") – specify how to handle errors
Returns: an OEChem molecule object
-
chemfp.openeye_toolkit.
to_inchikey
(mol: Any, *, id: Optional[str, None] = None, flavor: Union[int, str, None] = 'Default', delimiter: Optional[Literal[to_eol, space, tab, comma, whitespace, native, , ], None] = None, include_id: bool = True, errors: str = 'strict')¶ Generate an InChIKey string and id from an OEChem molecule
- This is equivalent to calling:
- create_string(mol, “inchikey”, id=id, writer_args={…}, errors=errors)
- Available bit flag flavors are:
- ‘Chiral’ = 4 ‘FixedHLayer’ = 8 ‘Hydrogens’ = 1 ‘RacemicStereo’ = 64 ‘ReconnectedMetals’ = 16 ‘RelativeStereo’ = 32 ‘Stereo’ = 2 (in default bit flags) ‘Default’ = 130 (in default bit flags)
Parameters: - mol (an OEChem molecule) – a molecule object
- id (None or a string (default: None)) – an alternate identifier for the output record, if relevant
- flavor (None, integer or string with "|"- or ","-separated terms (default: "Default")) – Output flavor bit flags
- delimiter (One of None, 'to_eol', 'space', 'tab', 'comma', 'whitespace', 'native', or the space or tab characters (default: None)) – The separator between the SMILES and the id
- include_id (Boolean (default: True)) – if true, include the molecule id in the output
- errors (one of "strict", "ignore", or "log") – specify how to handle errors
Returns: an OEChem molecule object
-
chemfp.openeye_toolkit.
to_inchikey_file
(destination: Union[None, str, BinaryIO], *, flavor: Union[int, str, None] = 'Default', delimiter: Optional[Literal[to_eol, space, tab, comma, whitespace, native, , ], None] = None, include_id: bool = True, errors: str = 'strict')¶ Generate an InChIKey string and id from an OEChem molecule
- This is mostly equivalent to calling:
- open_molecule_writer(destination, “inchikey”, writer_args={…}, errors=errors)
- Available bit flag flavors are:
- ‘Chiral’ = 4 ‘FixedHLayer’ = 8 ‘Hydrogens’ = 1 ‘RacemicStereo’ = 64 ‘ReconnectedMetals’ = 16 ‘RelativeStereo’ = 32 ‘Stereo’ = 2 (in default bit flags) ‘Default’ = 130 (in default bit flags)
Parameters: - destination (None, a filename string, or a file-like object) – where to write the molecules
- flavor (None, integer or string with "|"- or ","-separated terms (default: "Default")) – Output flavor bit flags
- delimiter (One of None, 'to_eol', 'space', 'tab', 'comma', 'whitespace', 'native', or the space or tab characters (default: None)) – The separator between the SMILES and the id
- include_id (Boolean (default: True)) – if true, include the molecule id in the output
- errors (one of "strict", "ignore", or "log") – specify how to handle errors
Returns: a
chemfp.base_toolkit.MoleculeWriter
expecting OEChem molecules
-
chemfp.openeye_toolkit.
to_inchikeystring
(mol: Any, *, id: Optional[str, None] = None, flavor: Union[int, str, None] = 'Default', delimiter: Optional[Literal[to_eol, space, tab, comma, whitespace, native, , ], None] = None, errors: str = 'strict')¶ Generate an InChIKey string from an OEChem molecule
- This is equivalent to calling:
- create_string(mol, “inchikeystring”, id=id, writer_args={…}, errors=errors)
- Available bit flag flavors are:
- ‘Chiral’ = 4 ‘FixedHLayer’ = 8 ‘Hydrogens’ = 1 ‘RacemicStereo’ = 64 ‘ReconnectedMetals’ = 16 ‘RelativeStereo’ = 32 ‘Stereo’ = 2 (in default bit flags) ‘Default’ = 130 (in default bit flags)
Parameters: - mol (an OEChem molecule) – a molecule object
- id (None or a string (default: None)) – an alternate identifier for the output record, if relevant
- flavor (None, integer or string with "|"- or ","-separated terms (default: "Default")) – Output flavor bit flags
- delimiter (One of None, 'to_eol', 'space', 'tab', 'comma', 'whitespace', 'native', or the space or tab characters (default: None)) – The separator between the SMILES and the id
- errors (one of "strict", "ignore", or "log") – specify how to handle errors
Returns: an OEChem molecule object