find_results | R Documentation |
This function searches the Protein Data Bank (PDB) for entries related to a specified search term and retrieves specific information from those entries. It is useful for extracting targeted data from search results, such as citations, experimental methods, or structural details. The function leverages 'query_search' to perform the initial search and 'get_info' to fetch detailed data for each PDB entry.
find_results(search_term, field = "citation")
search_term |
A string specifying the term to search for in the PDB. This term can relate to various aspects of the PDB entries, such as keywords, molecular functions, protein names, or specific research areas. |
field |
A string indicating the specific field to retrieve for each search result. The default is "citation". The field should correspond to one of the following valid options:
|
This function is ideal for researchers who need to extract specific data fields from multiple PDB entries efficiently. The process involves two main steps:
**Search Query**: The function uses 'query_search' to find PDB entries that match the provided search term.
**Field Retrieval**: For each PDB ID returned by the search, 'get_info' is used to retrieve the specified field.
Error handling is robust, with informative messages provided when the search term yields no results, when an individual PDB entry cannot be retrieved, or when the specified field is not found in the retrieved data.
A named list where each element's name is a PDB ID and its value is the information for the specified field from the corresponding search result. If no results are found, or if an error occurs during data retrieval, the function returns an empty list with appropriate warnings or error messages.
# Retrieve citation information for PDB entries related to CRISPR
crispr_citations <- find_results("CRISPR", field = "citation")
crispr_citations
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.