IdentityQuery
#
- class biotite.database.pubchem.IdentityQuery(identity_type='same_stereo_isotope', **kwargs)[source]#
Bases:
StructureQuery
A query that searches for all structures that are identical to the given input structure.
Exactly one of the input structure parameters smiles, smarts, inchi, sdf or cid must be given.
- Parameters:
- identity_type{‘same_connectivity’, ‘same_tautomer’, ‘same_stereo’, ‘same_isotope’, ‘same_stereo_isotope’, ‘nonconflicting_stereo’, ‘same_isotope_nonconflicting_stereo’}, optional
The type of identity search.
- 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.
Examples
>>> # CID of alanine >>> print(search(IdentityQuery(cid=5950))) [5950] >>> # AtomArray of alanine >>> atom_array = residue("ALA") >>> print(search(IdentityQuery.from_atoms(atom_array))) [5950]
- 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/
.