syndirella.Postera ================== .. py:module:: syndirella.Postera .. autoapi-nested-parse:: Postera.py This module contains the functionality for a Postera search. Classes ------- .. autoapisummary:: syndirella.Postera.Postera Module Contents --------------- .. py:class:: Postera Bases: :py:obj:`syndirella.DatabaseSearch.DatabaseSearch` This class contains information about the Postera search. It will perform the Postera search using the perform_database_search function. It will also store the results of the Postera search as a .csv file. .. py:attribute:: url :value: 'https://api.postera.ai' .. py:attribute:: api_key .. py:attribute:: logger .. py:method:: perform_route_search(compound: str) -> List[Dict[str, List[Dict[str, str]]]] This function is used to perform the route query. .. py:method:: perform_database_search(reactant: rdkit.Chem.Mol, reaction_name: str, search_type: str = 'superstructure', vendors: list[str] = ['enamine_bb', 'mcule', 'mcule_ultimate', 'enamine_real', 'enamine_made']) -> List[str] | None This function is used to perform the Postera search using the database_search_function. .. py:method:: perform_superstructure_search(smiles: str, queryThirdPartyServices: bool = False, keep_catalogue: bool = False, vendors: list[str] = ['all']) -> List[Tuple[str, Tuple[str, str] | None]] | None This function is used to perform the Postera superstructure search. .. py:method:: perform_exact_search(smiles: str, queryThirdPartyServices: bool = False, catalogues: List[str] = ['all']) -> List[Dict] This function is used to perform the Postera exact search. .. py:method:: perform_exact_batch_search(smiles_list: List[str], queryThirdPartyServices: bool = False, catalogues: List[str] = ['all']) -> List[Dict] Performs exact search with a batch of smiles. .. py:method:: structure_output(hits: List[Dict] | None, query_smiles: str, keep_catalogue: bool = False) -> List[Tuple[str, Tuple[str, str] | None]] | None Formats output into a list of tuples with smiles and catalogue. .. py:method:: get_resp_json(url: str, api_key: str, data: Dict = None, retries: int = 50, backoff_factor: float = 0.5) -> Optional[Dict] | None :staticmethod: Directly get the response json from a request, with retry mechanism for handling 429 status code. .. py:method:: get_search_results(url: str, api_key: str, data: Dict[str, Any], page: int = 1, max_pages: int = 900) -> List[Dict] | None :staticmethod: Recursively get all pages for the endpoint until reach null next page or the max_pages threshold. The default max_pages is set to 900 since the recursion limit is 1000. .. py:method:: make_query() This function is used to make a query to the Postera database. .. py:method:: save_database_search() This function is used to save the results of the Postera search as a .csv file. .. py:method:: load_database_search() This function is used to load the results of the Postera search from a .csv file.