SuperstructureQuery
#
- class biotite.database.pubchem.SuperstructureQuery(**kwargs)[source]#
Bases:
SuperOrSubstructureQuery
A query that searches for all structures, where the given input structure is a superstructure. In other words, this query matches substructures of the input structure.
Exactly one of the input structure parameters smiles, smarts, inchi, sdf or cid must be given.
- Parameters:
- smilesstr, optional
The query SMILES string.
- smartsstr, optional
The query SMARTS pattern.
- inchistr, optional
The query InChI string.
- sdfstr, optional
A query structure as SDF formatted string. Usually
from_atoms()
is used to create the SDF from anAtomArray
.- cidint, optional
The query structure given as CID.
- numberint, optional
The maximum number of matches that this query may return. By default, the PubChem default value is used, which can be considered unlimited.
- match_chargesbool, optional
If set to true, atoms must match the specified charge. (Default: False)
- match_tautomersbool, optional
If set to true, allow match to tautomers of the given structure. (Default: False)
- rings_not_embeddedbool, optional
If set to true, rings may not be embedded in a larger system. (Default: False)
- single_double_bonds_matchbool, optional
If set to true, single or double bonds match aromatic bonds. (Default: True)
- chains_match_ringsbool, optional
If set to true, chain bonds in the query may match rings in hits. (Default: True)
- strip_hydrogenbool, optional
If set to true, remove any explicit hydrogens before searching. (Default: False)
- stereo{‘ignore’, ‘exact’, ‘relative’, ‘nonconflicting’}, optional
How to handle stereo. (Default: ‘ignore’)
Notes
Optional parameter descriptions are taken from the PubChem REST API documentation.
Examples
>>> # CID of alanine >>> print(search(SuperstructureQuery(cid=5950, number=5))) [..., ..., ..., ..., ...] >>> # AtomArray of alanine >>> atom_array = residue("ALA") >>> print(search(SuperstructureQuery.from_atoms(atom_array, number=5))) [..., ..., ..., ..., ...]
- classmethod from_atoms(atoms, *args, **kwargs)#
Create a query using the given query structure.
- Parameters:
- atomsAtomArray or AtomArrayStack
The query structure.
- **kwargsdict, optional
See the constructor for additional options.
- get_files()#
Get the POST file payload for this query.
- Returns:
- paramsdict (str -> object)
The file payload.
- get_input_url_path()#
Get the input part of the request URL.
- Returns:
- get_input_url_pathstr
The input part of the request URL. Must not contain slash characters at the beginning and end of the string.
- get_params()#
Get the POST payload for this query.
- Returns:
- paramsdict (str -> object)
The payload.
- search_options()#
Get additional options for the POST options.
PROTECTED: Override when inheriting.
- Returns:
- optionsdict (str -> object)
They keys are automatically converted from snake case to camel case required by the request parameters.
- search_type()#
Get the type of performed search for the request input part.
PROTECTED: Override when inheriting.
- Returns:
- search_typestr
The search type for the input part, i.e. the part directly after
compound/
.