### Install PyUniProt using pip Source: https://pyuniprot.readthedocs.io/en/latest/quick_start Installs the PyUniProt library using pip. This command can be run with or without root privileges by adding the `--user` flag. ```shell python3 -m pip install pyuniprot ``` -------------------------------- ### Database Setup for MariaDB/MySQL Source: https://pyuniprot.readthedocs.io/en/latest/quick_start Creates a database and a user with necessary privileges for PyUniProt in MariaDB or MySQL. Ensure you replace placeholder credentials with your actual values. This requires root access to the database server. ```sql CREATE DATABASE `pyuniprot` CHARACTER SET utf8 COLLATE utf8_general_ci; CREATE USER 'pyuniprot_user'@'localhost' IDENTIFIED BY 'pyuniprot_passwd'; GRANT ALL PRIVILEGES ON pytcd.* TO 'pyuniprot_user'@'localhost'; FLUSH PRIVILEGES; ``` -------------------------------- ### Import UniProt Data using PyUniProt Source: https://pyuniprot.readthedocs.io/en/latest/quick_start Imports UniProt data into the configured database. This involves starting a Python console, importing the PyUniProt library, setting the database connection, and initiating the data update process. The SQLAlchemy connection string must be correctly set before running the update. ```python import pyuniprot pyuniprot.set_mysql_connection(host='localhost', user='pyuniprot_user', passwd='pyuniprot_passwd', db='pyuniprot') pyuniprot.update(sqlalchemy_connection_string) ``` -------------------------------- ### Install PyUniProt from GitHub Development Version - Python Source: https://pyuniprot.readthedocs.io/en/latest/installation Installs the latest development version of PyUniProt directly from its GitHub repository. This involves cloning the repository, navigating into the directory, and then installing the package using `pip install -e .`. This method is recommended for experienced developers interested in the source code and may result in an unstable version. ```bash git clone https://github.com/cebel/pyuniprot.git cd pyuniprot pip install -e . ``` -------------------------------- ### Install PyUniProt from PyPI (System-wide) - Python Source: https://pyuniprot.readthedocs.io/en/latest/installation Installs the PyUniProt package system-wide using pip. This command requires superuser privileges (sudo) and is suitable for Linux/macOS environments. Ensure pip is up-to-date before running. ```bash sudo pip install pyuniprot ``` -------------------------------- ### Install PyUniProt from PyPI (User-specific) - Python Source: https://pyuniprot.readthedocs.io/en/latest/installation Installs the PyUniProt package for the current user only, without requiring superuser privileges. This is useful when system-wide installation is not permitted or desired. It uses the `--user` flag with pip. ```bash pip install --user pyuniprot ``` -------------------------------- ### MySQL/MariaDB Database and User Setup - SQL Source: https://pyuniprot.readthedocs.io/en/latest/installation SQL commands to create a new database named 'pyuniprot' with UTF8 character set and collation, and a user 'pyuniprot_user' with '%' host, granting all privileges on the 'pyuniprot' database. Finally, it flushes privileges to apply the changes. This is a prerequisite for using MySQL/MariaDB with PyUniProt. ```sql CREATE DATABASE pyuniprot CHARACTER SET utf8 COLLATE utf8_general_ci; GRANT ALL PRIVILEGES ON pyuniprot.* TO 'pyuniprot_user'@'%' IDENTIFIED BY 'pyuniprot_passwd'; FLUSH PRIVILEGES; ``` -------------------------------- ### Query Proteins by Alternative Short Name Source: https://pyuniprot.readthedocs.io/en/latest/query_functions This code example shows how to search for proteins using their alternative short name. The `alternative_short_name` method is utilized with the entry name. Ensure pyuniprot is installed. ```python import pyuniprot query = pyuniprot.query() query.alternative_short_name(entry_name='A4_HUMAN') ``` -------------------------------- ### Install PyUniProt in Python 3 Environment - Python Source: https://pyuniprot.readthedocs.io/en/latest/installation Installs the PyUniProt package specifically within a Python 3 environment. This command uses `python3 -m pip` to ensure the package is installed for the correct Python version and may require superuser privileges. ```bash sudo python3 -m pip install pyuniprot ``` -------------------------------- ### Access Datasets Property Source: https://pyuniprot.readthedocs.io/en/latest/query_functions This code demonstrates accessing the `datasets` property of the pyuniprot query object, which may list available datasets for querying. Ensure pyuniprot is installed. ```python import pyuniprot query = pyuniprot.query() query.datasets ``` -------------------------------- ### Update PyUniProt Database - Python Source: https://pyuniprot.readthedocs.io/en/latest/installation Initiates the process of updating the PyUniProt database. This function downloads the latest data from UniProt, which can be a large file and take a significant amount of time. A new database will be created with each update. ```python import pyuniprot pyuniprot.update() ``` -------------------------------- ### Force Update PyUniProt Database - Python Source: https://pyuniprot.readthedocs.io/en/latest/installation Forces an update of the PyUniProt database, ensuring that the absolute latest UniProt version is downloaded. This is achieved by setting the `force_download` parameter to `True`. This can be useful to guarantee data freshness. ```python import pyuniprot pyuniprot.update(force_download=True) ``` -------------------------------- ### Access Keywords Property Source: https://pyuniprot.readthedocs.io/en/latest/query_functions This code demonstrates accessing the `keywords` property of the pyuniprot query object, which might provide a list of available keywords for searching proteins. Ensure pyuniprot is installed. ```python import pyuniprot query = pyuniprot.query() query.keywords ``` -------------------------------- ### Search Human Proteins by Recommended Full Name (Starts With) Source: https://pyuniprot.readthedocs.io/en/latest/query Searches for human proteins (taxid=9606) where the recommended full name starts with 'Myeloid cell surface'. Uses '%' as a wildcard. Returns a list of matching protein entries. Requires an initialized query object. ```python >>> query.entry(recommended_full_name='Myeloid cell surface%', taxid=9606) [Myeloid cell surface antigen CD33] ``` -------------------------------- ### Initialize pyuniprot Query Object Source: https://pyuniprot.readthedocs.io/en/latest/query Initializes the pyuniprot library by updating data for specified taxids (human, mouse, rat) and creates a query object for subsequent data retrieval. Requires the pyuniprot library to be installed. ```python import pyuniprot pyuniprot.update(taxids=[9606,10090,10116]) # human, mouse, rat update query = pyuniprot.query() ``` -------------------------------- ### Set Default MySQL Connection - Python Source: https://pyuniprot.readthedocs.io/en/latest/installation Initializes the default MySQL connection for PyUniProt. This function can be called without arguments if the default connection parameters (host, user, password, database) are already configured or will be used by default. It's a simple call to establish the connection. ```python import pyuniprot pyuniprot.set_mysql_connection() ``` -------------------------------- ### Query Proteins by Alternative Full Name Source: https://pyuniprot.readthedocs.io/en/latest/query_functions This snippet demonstrates querying for proteins using their alternative full name. The `alternative_full_name` method is used with the name as an argument. Ensure pyuniprot is installed. ```python import pyuniprot query = pyuniprot.query() query.alternative_full_name(name='Alzheimer disease amyloid protein') ``` -------------------------------- ### Query Proteins by Function Description Source: https://pyuniprot.readthedocs.io/en/latest/query_functions This code demonstrates searching for proteins based on a functional description using pattern matching. The `function` method is employed with a text parameter. Ensure pyuniprot is installed. ```python import pyuniprot query = pyuniprot.query() query.function(text='%Alzheimer%') ``` -------------------------------- ### Query Proteins by Organism Host TaxID Source: https://pyuniprot.readthedocs.io/en/latest/query_functions This snippet shows how to query for proteins based on the host organism's taxonomy ID (taxid). The `organism_host` method is used, and a note indicates that results may be limited if only human data is installed. Ensure pyuniprot is installed. ```python import pyuniprot query = pyuniprot.query() query.organism_host(taxid=9606) # 0 results if you have only installed human ``` -------------------------------- ### Set Custom MySQL Connection - Python Source: https://pyuniprot.readthedocs.io/en/latest/installation Configures a specific MySQL/MariaDB connection for PyUniProt using custom parameters such as host, user, password, and database name. This allows flexibility in connecting to different MySQL instances or using specific credentials. ```python import pyuniprot pyuniprot.set_mysql_connection(host='localhost', user='pyuniprot_user', passwd='pyuniprot_passwd', db='pyuniprot') ``` -------------------------------- ### Set Generic Database Connection - Python Source: https://pyuniprot.readthedocs.io/en/latest/installation Sets a generic database connection for PyUniProt using a SQLAlchemy connection string. This function supports various database systems like Oracle, PostgreSQL, MSSQL, and SQLite, allowing flexible connection configurations based on SQLAlchemy's URI format. ```python import pyuniprot pyuniprot.set_connection('oracle://user:passwd@127.0.0.1:1521/database') ``` -------------------------------- ### Access DBReference Types Property Source: https://pyuniprot.readthedocs.io/en/latest/query_functions This code demonstrates how to access the `dbreference_types` property of the pyuniprot query object, which likely lists available database reference types. Ensure pyuniprot is installed. ```python import pyuniprot query = pyuniprot.query() query.dbreference_types ``` -------------------------------- ### Query Proteins by Accession and Entry Name Source: https://pyuniprot.readthedocs.io/en/latest/query_functions This snippet illustrates querying for a protein using both its accession number and entry name. The `accession` method is used for this combined search. Ensure pyuniprot is installed. ```python import pyuniprot query = pyuniprot.query() query.accession(accession='P05067', entry_name='A4_HUMAN') ``` -------------------------------- ### Access TaxIDs Property Source: https://pyuniprot.readthedocs.io/en/latest/query_functions This code shows how to access the `taxids` property of the pyuniprot query object, which likely provides a list of available taxonomy IDs. Ensure pyuniprot is installed. ```python import pyuniprot query = pyuniprot.query() query.taxids ``` -------------------------------- ### Query Proteins by DBReference Type and Identifier Source: https://pyuniprot.readthedocs.io/en/latest/query_functions This code demonstrates querying for proteins based on a database reference type and identifier. The `db_reference` method is used, specifying the type and identifier. Ensure pyuniprot is installed. ```python import pyuniprot query = pyuniprot.query() query.db_reference(type_='EMBL', identifier='U20972') ``` -------------------------------- ### Access Subcellular Locations Property Source: https://pyuniprot.readthedocs.io/en/latest/query_functions This code demonstrates accessing the `subcellular_locations` property of the pyuniprot query object, which may list known subcellular locations. Ensure pyuniprot is installed. ```python import pyuniprot query = pyuniprot.query() query.subcellular_locations ``` -------------------------------- ### Query Protein Entry by Name and Gene Source: https://pyuniprot.readthedocs.io/en/latest/query_functions This snippet shows how to query for a specific protein entry using its recommended full name and gene name. It utilizes the `entry` method from the pyuniprot query object. Ensure pyuniprot is installed. ```python import pyuniprot query = pyuniprot.query() query.entry(name='1433E_HUMAN', recommended_full_name='14-3-3 protein epsilon', gene_name='YWHAE') ``` -------------------------------- ### Query Proteins by Disease Comment Source: https://pyuniprot.readthedocs.io/en/latest/query_functions This snippet illustrates how to search for proteins based on a disease-related comment. It uses the `disease_comment` method with a pattern matching the desired comment. Ensure pyuniprot is installed. ```python import pyuniprot query = pyuniprot.query() query.disease_comment(comment='%Alzheimer%') ``` -------------------------------- ### Query Proteins by Tissue in Reference Source: https://pyuniprot.readthedocs.io/en/latest/query_functions This snippet shows how to find proteins associated with a specific tissue in a reference. The `tissue_in_reference` method is used with the tissue name. Ensure pyuniprot is installed. ```python import pyuniprot query = pyuniprot.query() query.tissue_in_reference(tissue: 'Substantia nigra') ``` -------------------------------- ### PyUniProt Query: Navigating Linked Data Models (1-n, n-m) Source: https://pyuniprot.readthedocs.io/en/latest/query_functions Explains how to access related data models from a UniProt entry object obtained through PyUniProt queries. It provides examples of accessing sequences, accessions, organism hosts, features, functions, EC numbers, and more. It also shows how to navigate back from an EC number to its associated entries and their EC numbers. ```python import pyuniprot query = pyuniprot.query() r = query.entry(limit=1)[0] r.sequence r.accessions r.organism_hosts r.features r.functions r.ec_numbers r.db_references r.alternative_full_names r.alternative_short_names r.disease_comments r.tissue_specificities r.other_gene_names r = query.ec_number(ec_number='1.1.1.1') [x.entry for x in r] # following is crazy but possible, again go back to ec_number [x.entry.ec_numbers for x in r] ``` -------------------------------- ### Accessing Protein Entry Attributes Source: https://pyuniprot.readthedocs.io/en/latest/query Demonstrates how to access attributes of a protein entry object returned by pyuniprot queries. Shows how to get the type of an entry and access its keywords. Requires an initialized query object and prior search results. ```python >>> first_protein = results[0] # fetch first result >>> type(first_protein) pyuniprot.manager.models.Entry >>> first_protein Charged multivesicular body protein 1a # get first 3 of all other keywords to this protein >>> first_protein.keywords[:3] [Reference proteome:KW-1185, Coiled coil:KW-0175, Repressor:KW-0678] ``` -------------------------------- ### Query Proteins by Subcellular Location Source: https://pyuniprot.readthedocs.io/en/latest/query_functions This snippet shows how to search for proteins based on their subcellular location. The `subcellular_location` method is used with the location name as a parameter. Ensure pyuniprot is installed. ```python import pyuniprot query = pyuniprot.query() query.subcellular_location(location='Autophagosome lumen') ``` -------------------------------- ### Search Proteins by Keyword and Retrieve Gene Names Source: https://pyuniprot.readthedocs.io/en/latest/query Queries for all proteins associated with the keyword 'Neurodegeneration' and retrieves their gene names. Shows how to get the total count of results and a subset of gene names. Requires an initialized query object. ```python >>> results = query.entry(keywords='Neurodegeneration') >>> len(results) # number of results 322 >>> [x.gene_name for x in results][:3] # show only the first 2 gene names ['CHMP1A', 'CLN3', 'COQ8A'] ``` -------------------------------- ### Query Proteins by Keyword and Retrieve Entries Source: https://pyuniprot.readthedocs.io/en/latest/query_functions This snippet shows how to find proteins associated with a specific keyword (e.g., 'Phagocytosis') and then retrieve the entries for those proteins. It uses the `keyword` method and list comprehension. Ensure pyuniprot is installed. ```python import pyuniprot query = pyuniprot.query() r = query.keyword(name='Phagocytosis')[0] [x.entry for x in r] # all proteins linked to keyword Phagocytosis ``` -------------------------------- ### Access Feature Types Property Source: https://pyuniprot.readthedocs.io/en/latest/query_functions This code shows how to access the `feature_types` property of the pyuniprot query object, likely listing available feature types for protein entries. Ensure pyuniprot is installed. ```python import pyuniprot query = pyuniprot.query() query.feature_types ``` -------------------------------- ### Query Proteins by Other Gene Name Source: https://pyuniprot.readthedocs.io/en/latest/query_functions This code shows how to find proteins using an alternative gene name. The `other_gene_name` method is employed with the entry name as a parameter. Ensure pyuniprot is installed. ```python import pyuniprot query = pyuniprot.query() query.other_gene_name(entry_name='A4_HUMAN') ``` -------------------------------- ### Access Tissues in References Property Source: https://pyuniprot.readthedocs.io/en/latest/query_functions This code shows how to access the `tissues_in_references` property of the pyuniprot query object, likely providing a list of tissues mentioned in references. Ensure pyuniprot is installed. ```python import pyuniprot query = pyuniprot.query() query.tissues_in_references ``` -------------------------------- ### Query Proteins by Tissue Specificity Comment with Limit Source: https://pyuniprot.readthedocs.io/en/latest/query_functions This code demonstrates querying for proteins based on a tissue specificity comment, with a limit on the number of results. The `tissue_specificity` method is used with a pattern and limit. Ensure pyuniprot is installed. ```python import pyuniprot query = pyuniprot.query() query.tissue_specificity(comment='%brain%', limit=1) ``` -------------------------------- ### Query Proteins by Feature Type with Limit Source: https://pyuniprot.readthedocs.io/en/latest/query_functions This snippet shows how to query for proteins based on a feature type, with a limit on the number of results. The `feature` method is used, specifying the feature type and limit. Ensure pyuniprot is installed. ```python import pyuniprot query = pyuniprot.query() query.feature(type_='sequence variant', limit=1) ``` -------------------------------- ### Query Proteins by Disease Acronym Source: https://pyuniprot.readthedocs.io/en/latest/query_functions This code demonstrates how to retrieve proteins associated with a specific disease using its acronym. The `disease` method of the pyuniprot query object is used for this purpose. Ensure pyuniprot is installed. ```python import pyuniprot query = pyuniprot.query() query.disease(acronym='AD') ``` -------------------------------- ### Query Proteins by PMID Source: https://pyuniprot.readthedocs.io/en/latest/query_functions This code demonstrates how to retrieve proteins associated with a specific PubMed ID (PMID). The `pmid` method of the pyuniprot query object is used for this purpose. Ensure pyuniprot is installed. ```python import pyuniprot query = pyuniprot.query() query.pmid(pmid=7644510) ``` -------------------------------- ### Query Proteins by EC Number Source: https://pyuniprot.readthedocs.io/en/latest/query_functions This code demonstrates how to retrieve proteins based on their Enzyme Commission (EC) number. The `ec_number` method is used with the specific EC number as an argument. Ensure pyuniprot is installed. ```python import pyuniprot query = pyuniprot.query() query.ec_number(ec_number='1.1.1.1') ``` -------------------------------- ### Create MySQL/MariaDB Database for pyuniprot Source: https://pyuniprot.readthedocs.io/en/latest/benchmarks This SQL snippet demonstrates how to create a new database named 'pyuniprot' with UTF8 character set and collation. It is a prerequisite for setting up the pyuniprot data. ```sql CREATE DATABASE pyuniprot CHARACTER SET utf8 COLLATE utf8_general_ci; ``` -------------------------------- ### Create and Grant Privileges to pyuniprot MySQL/MariaDB User Source: https://pyuniprot.readthedocs.io/en/latest/benchmarks This SQL snippet shows how to create a database user 'pyuniprot_user' with a specified password and grant all privileges on the 'pyuniprot' database to this user. It also includes flushing privileges. ```sql GRANT ALL PRIVILEGES ON pyuniprot.* TO 'pyuniprot_user'@'%' IDENTIFIED BY 'pyuniprot_passwd'; FLUSH PRIVILEGES; ``` -------------------------------- ### PyUniProt Query: Using Wildcards for Entry Search Source: https://pyuniprot.readthedocs.io/en/latest/query_functions Demonstrates how to use the '%' wildcard character in PyUniProt queries to perform exact, prefix, suffix, and substring searches on the 'recommended_name' field of entries. This allows for flexible matching of protein names. ```python import pyuniprot query = pyuniprot.query() # exact search query.entry(recommended_name='Amyloid beta A4 protein') # starts with 'Amyloid beta' query.entry(recommended_name='Amyloid beta%') # ends with 'A4 protein' query.entry(recommended_name='%A4 protein') # contains 'beta A4' query.entry(recommended_name='%beta A4%') ``` -------------------------------- ### PyUniProt Query: Accessing Entry Data as Dictionary Source: https://pyuniprot.readthedocs.io/en/latest/query_functions Demonstrates how to retrieve the first entry from a PyUniProt query and then access its attributes as a dictionary using the .__dict__ method. This provides a convenient way to inspect all available properties of an entry. ```python import pyuniprot query = pyuniprot.query() first_entry = query.entry(limit=1)[0] first_entry.__dict__ ``` -------------------------------- ### Query Properties Source: https://pyuniprot.readthedocs.io/en/latest/query_functions Provides access to various queryable properties and lists within PyUniprot. ```APIDOC ## Query Properties ### Description Accesses various lists and properties related to PyUniprot queries. ### Available Properties: - **dbreference_types**: Returns a list of available database reference types. - **taxids**: Returns a list of available taxonomy IDs. - **datasets**: Returns a list of available datasets. - **feature_types**: Returns a list of available feature types. - **subcellular_locations**: Returns a list of available subcellular locations. - **tissues_in_references**: Returns a list of available tissues in references. - **keywords**: Returns a list of available keywords. ### Usage Example: ```python import pyuniprot query = pyuniprot.query() # Example: Accessing a list print(query.keywords) ``` ### Response Example: (The response will be a list or string depending on the property queried, e.g., a list of strings for keywords or taxids.) ``` -------------------------------- ### Query by Alternative Short Name Source: https://pyuniprot.readthedocs.io/en/latest/query_functions Searches for protein entries using an alternative short name. Consult the `pyuniprot.manager.query.QueryManager.alternative_short_name()` documentation for all available parameters. ```APIDOC ## GET /query/alternative_short_name ### Description Retrieves protein entries using an alternative short name. ### Method GET ### Endpoint /query/alternative_short_name ### Parameters #### Query Parameters - **entry_name** (string) - Required - The entry name of the protein. ### Request Example ```python import pyuniprot query = pyuniprot.query() query.alternative_short_name(entry_name='A4_HUMAN') ``` ### Response #### Success Response (200) - **proteins_by_short_name** (array) - A list of proteins matching the alternative short name. #### Response Example (Response structure depends on the matched protein data) ``` -------------------------------- ### Import UniProt Data using pyuniprot Python Library Source: https://pyuniprot.readthedocs.io/en/latest/benchmarks This Python snippet illustrates how to import UniProt data for specified NCBI taxonomy IDs (human, mouse, rat) using the pyuniprot library. It requires setting up the MySQL connection first. ```python import pyuniprot pyuniprot.set_mysql_connection() pyuniprot.update(taxids=[9606, 10090, 10116]) ``` -------------------------------- ### PyUniProt Query: Limiting Results and Pagination Source: https://pyuniprot.readthedocs.io/en/latest/query_functions Illustrates how to limit the number of results returned by PyUniProt queries using the 'limit' parameter. It also shows how to implement pagination by providing a tuple (page_number, results_per_page) to the 'limit' parameter, enabling retrieval of specific result pages. ```python import pyuniprot query = pyuniprot.query() query.entry(limit=10) # first page with 3 results (every page have 3 results) query.entry(limit=(0,3)) # fourth page with 10 results (every page have 10 results) query.entry(limit=(4,10)) ``` -------------------------------- ### PyUniProt Query: Retrieving Single Values by Key Name Source: https://pyuniprot.readthedocs.io/en/latest/query_functions Illustrates how to query for entries matching a pattern (e.g., recommended_full_name containing 'kinase') and then directly access a specific attribute, such as 'recommended_full_name', from the first result. This is useful for extracting a single piece of information. ```python import pyuniprot query = pyuniprot.query() query.entry(recommended_full_name='%kinase')[0].recommended_full_name ``` -------------------------------- ### Query by Function Source: https://pyuniprot.readthedocs.io/en/latest/query_functions Searches for proteins based on a text description of their function, allowing for pattern matching. Consult the `pyuniprot.manager.query.QueryManager.function()` documentation for a full list of parameters. ```APIDOC ## GET /query/function ### Description Retrieves protein entries based on a text description of their function, with pattern matching capabilities. ### Method GET ### Endpoint /query/function ### Parameters #### Query Parameters - **text** (string) - Required - The text pattern to search within the function description (e.g., '%Alzheimer%'). ### Request Example ```python import pyuniprot query = pyuniprot.query() query.function(text='%Alzheimer%') ``` ### Response #### Success Response (200) - **proteins_by_function** (array) - A list of proteins matching the function description criteria. #### Response Example (Response structure depends on the matched protein data) ``` -------------------------------- ### Query by DB Reference Source: https://pyuniprot.readthedocs.io/en/latest/query_functions Searches for proteins based on a database reference type and identifier. Consult the `pyuniprot.manager.query.QueryManager.db_reference()` documentation for a full list of parameters. ```APIDOC ## GET /query/db_reference ### Description Retrieves protein entries based on a database reference type and identifier. ### Method GET ### Endpoint /query/db_reference ### Parameters #### Query Parameters - **type_** (string) - Required - The type of the database reference (e.g., 'EMBL'). - **identifier** (string) - Required - The identifier within the specified database. ### Request Example ```python import pyuniprot query = pyuniprot.query() query.db_reference(type_='EMBL', identifier='U20972') ``` ### Response #### Success Response (200) - **proteins_by_db_reference** (array) - A list of proteins matching the database reference. #### Response Example (Response structure depends on the matched protein data) ``` -------------------------------- ### Query by Entry Source: https://pyuniprot.readthedocs.io/en/latest/query_functions Retrieves protein entries based on name, recommended full name, or gene name. Refer to the `pyuniprot.manager.query.QueryManager.entry()` documentation for all available parameters. ```APIDOC ## GET /query/entry ### Description Retrieves protein entries based on specific criteria like name, recommended full name, or gene name. ### Method GET ### Endpoint /query/entry ### Parameters #### Query Parameters - **name** (string) - Optional - The name of the protein entry. - **recommended_full_name** (string) - Optional - The recommended full name of the protein. - **gene_name** (string) - Optional - The gene name associated with the protein. ### Request Example ```python import pyuniprot query = pyuniprot.query() query.entry(name='1433E_HUMAN', recommended_full_name='14-3-3 protein epsilon', gene_name='YWHAE') ``` ### Response #### Success Response (200) - **protein_data** (object) - Details of the protein entry matching the query. #### Response Example (Response structure depends on the matched entry data) ``` -------------------------------- ### Search Proteins by List of Gene Names Source: https://pyuniprot.readthedocs.io/en/latest/query Retrieves UniProt entries for a given list of gene names. Returns a list of protein entries. Requires an initialized query object. ```python >>> query.entry(name=('TREM2_HUMAN', 'CD33_HUMAN')) [Myeloid cell surface antigen CD33, Triggering receptor expressed on myeloid cells 2] ``` -------------------------------- ### Query by Organism Host Source: https://pyuniprot.readthedocs.io/en/latest/query_functions Fetches proteins based on the host organism's taxonomy ID. Refer to the `pyuniprot.manager.query.QueryManager.organism_host()` documentation for all available parameters. ```APIDOC ## GET /query/organism_host ### Description Retrieves protein entries based on the host organism's taxonomy ID. ### Method GET ### Endpoint /query/organism_host ### Parameters #### Query Parameters - **taxid** (integer) - Required - The taxonomy ID of the host organism. ### Request Example ```python import pyuniprot query = pyuniprot.query() query.organism_host(taxid=9606) # Note: 0 results if only human data is installed. ``` ### Response #### Success Response (200) - **proteins_by_host_organism** (array) - A list of proteins from the specified host organism. #### Response Example (Response structure depends on the matched protein data) ``` -------------------------------- ### PyUniProt Query: Filtering by Entry Name Source: https://pyuniprot.readthedocs.io/en/latest/query_functions Demonstrates how to use the 'entry_name' parameter in PyUniProt queries to specifically target UniProt entries by their primary key. This is applicable across various query functions and allows for precise data retrieval. ```python import pyuniprot query = pyuniprot.query() query.other_gene_name(entry_name='A4_HUMAN') ``` -------------------------------- ### Query by Keyword Source: https://pyuniprot.readthedocs.io/en/latest/query_functions Fetches proteins associated with a specific keyword. The `pyuniprot.manager.query.QueryManager.keyword()` documentation provides details on all available parameters. This method returns a list of protein entries linked to the keyword. ```APIDOC ## GET /query/keyword ### Description Retrieves protein entries associated with a specific keyword. ### Method GET ### Endpoint /query/keyword ### Parameters #### Query Parameters - **name** (string) - Required - The name of the keyword. ### Request Example ```python import pyuniprot query = pyuniprot.query() r = query.keyword(name='Phagocytosis')[0] [x.entry for x in r] # all proteins linked to keyword Phagocytosis ``` ### Response #### Success Response (200) - **proteins_by_keyword** (array) - A list of proteins associated with the specified keyword. #### Response Example (Response structure depends on the matched protein data) ``` -------------------------------- ### Query by Accession Source: https://pyuniprot.readthedocs.io/en/latest/query_functions Fetches protein entries using their accession number and entry name. Refer to the `pyuniprot.manager.query.QueryManager.accession()` documentation for all available parameters. ```APIDOC ## GET /query/accession ### Description Retrieves protein entries based on their accession number and entry name. ### Method GET ### Endpoint /query/accession ### Parameters #### Query Parameters - **accession** (string) - Required - The accession number of the protein. - **entry_name** (string) - Required - The entry name of the protein. ### Request Example ```python import pyuniprot query = pyuniprot.query() query.accession(accession='P05067', entry_name='A4_HUMAN') ``` ### Response #### Success Response (200) - **protein_by_accession** (object) - Details of the protein entry matching the accession. #### Response Example (Response structure depends on the matched protein data) ``` -------------------------------- ### Query by Alternative Full Name Source: https://pyuniprot.readthedocs.io/en/latest/query_functions Retrieves protein entries by their alternative full name. For a full list of parameters, refer to the `pyuniprot.manager.query.QueryManager.alternative_full_name()` documentation. ```APIDOC ## GET /query/alternative_full_name ### Description Fetches protein entries based on their alternative full name. ### Method GET ### Endpoint /query/alternative_full_name ### Parameters #### Query Parameters - **name** (string) - Required - The alternative full name of the protein. ### Request Example ```python import pyuniprot query = pyuniprot.query() query.alternative_full_name(name='Alzheimer disease amyloid protein') ``` ### Response #### Success Response (200) - **proteins_by_full_name** (array) - A list of proteins matching the alternative full name. #### Response Example (Response structure depends on the matched protein data) ``` -------------------------------- ### PyUniProt Query: Returning Results as pandas DataFrame Source: https://pyuniprot.readthedocs.io/en/latest/query_functions Shows how to configure PyUniProt queries to return results directly as a pandas DataFrame by setting the 'as_df' parameter to True. This facilitates easy data manipulation and analysis using pandas functionalities. ```python import pyuniprot query = pyuniprot.query() query.entry(as_df=True) ``` -------------------------------- ### Query Object Properties Source: https://pyuniprot.readthedocs.io/en/latest/query Lists available properties of a pyuniprot query object, which can be used to access different types of protein-related data. These properties are part of the query manager reference. ```python q.gene_forms q.interaction_actions q.actions q.pathways ``` -------------------------------- ### Query by Disease Source: https://pyuniprot.readthedocs.io/en/latest/query_functions Fetches protein information associated with a specific disease acronym. Consult the `pyuniprot.manager.query.QueryManager.disease()` documentation for a comprehensive list of parameters. ```APIDOC ## GET /query/disease ### Description Retrieves protein entries associated with a given disease acronym. ### Method GET ### Endpoint /query/disease ### Parameters #### Query Parameters - **acronym** (string) - Required - The acronym of the disease. ### Request Example ```python import pyuniprot query = pyuniprot.query() query.disease(acronym='AD') ``` ### Response #### Success Response (200) - **disease_related_proteins** (array) - A list of proteins related to the specified disease. #### Response Example (Response structure depends on the matched protein data) ``` -------------------------------- ### Query by Feature Source: https://pyuniprot.readthedocs.io/en/latest/query_functions Finds proteins based on feature type, with an optional limit. Refer to the `pyuniprot.manager.query.QueryManager.feature()` documentation for all available parameters. ```APIDOC ## GET /query/feature ### Description Retrieves protein entries based on feature type, with an option to limit the number of results. ### Method GET ### Endpoint /query/feature ### Parameters #### Query Parameters - **type_** (string) - Required - The type of feature to search for (e.g., 'sequence variant'). - **limit** (integer) - Optional - The maximum number of results to return. ### Request Example ```python import pyuniprot query = pyuniprot.query() query.feature(type_='sequence variant', limit=1) ``` ### Response #### Success Response (200) - **proteins_by_feature** (array) - A list of proteins matching the feature criteria. #### Response Example (Response structure depends on the matched protein data) ``` -------------------------------- ### Query by Disease Comment Source: https://pyuniprot.readthedocs.io/en/latest/query_functions Searches for proteins based on comments related to diseases, using a pattern match. For a full list of parameters, refer to the `pyuniprot.manager.query.QueryManager.disease_comment()` documentation. ```APIDOC ## GET /query/disease_comment ### Description Searches for proteins based on disease-related comments, allowing for pattern matching. ### Method GET ### Endpoint /query/disease_comment ### Parameters #### Query Parameters - **comment** (string) - Required - A pattern to search within disease comments (e.g., '%Alzheimer%'). ### Request Example ```python import pyuniprot query = pyuniprot.query() query.disease_comment(comment='%Alzheimer%') ``` ### Response #### Success Response (200) - **proteins_with_disease_comment** (array) - A list of proteins matching the disease comment criteria. #### Response Example (Response structure depends on the matched protein data) ``` -------------------------------- ### Search Human Proteins by Gene Name Source: https://pyuniprot.readthedocs.io/en/latest/query Searches for human proteins (taxid=9606) with the specific gene name 'TP53'. Returns a list of protein entries. Requires an initialized query object. ```python >>> query.entry(gene_name='TP53', taxid=9606) [Cellular tumor antigen p53] ``` -------------------------------- ### Query by Tissue Specificity Source: https://pyuniprot.readthedocs.io/en/latest/query_functions Searches for proteins based on comments related to tissue specificity, allowing for pattern matching and limiting results. Refer to the `pyuniprot.manager.query.QueryManager.tissue_specificity()` documentation for all available parameters. ```APIDOC ## GET /query/tissue_specificity ### Description Retrieves protein entries based on comments related to tissue specificity, with pattern matching and result limiting. ### Method GET ### Endpoint /query/tissue_specificity ### Parameters #### Query Parameters - **comment** (string) - Required - The pattern to search within tissue specificity comments (e.g., '%brain%'). - **limit** (integer) - Optional - The maximum number of results to return. ### Request Example ```python import pyuniprot query = pyuniprot.query() query.tissue_specificity(comment='%brain%', limit=1) ``` ### Response #### Success Response (200) - **proteins_by_tissue_specificity** (array) - A list of proteins matching the tissue specificity criteria. #### Response Example (Response structure depends on the matched protein data) ``` -------------------------------- ### Query by Subcellular Location Source: https://pyuniprot.readthedocs.io/en/latest/query_functions Fetches proteins based on their subcellular location. Consult the `pyuniprot.manager.query.QueryManager.subcellular_location()` documentation for a full list of parameters. ```APIDOC ## GET /query/subcellular_location ### Description Retrieves protein entries based on their subcellular location. ### Method GET ### Endpoint /query/subcellular_location ### Parameters #### Query Parameters - **location** (string) - Required - The name of the subcellular location. ### Request Example ```python import pyuniprot query = pyuniprot.query() query.subcellular_location(location='Autophagosome lumen') ``` ### Response #### Success Response (200) - **proteins_by_location** (array) - A list of proteins found in the specified subcellular location. #### Response Example (Response structure depends on the matched protein data) ``` -------------------------------- ### Query by EC Number Source: https://pyuniprot.readthedocs.io/en/latest/query_functions Searches for proteins based on their Enzyme Commission (EC) number. Refer to the `pyuniprot.manager.query.QueryManager.ec_number()` documentation for all available parameters. ```APIDOC ## GET /query/ec_number ### Description Retrieves protein entries based on their Enzyme Commission (EC) number. ### Method GET ### Endpoint /query/ec_number ### Parameters #### Query Parameters - **ec_number** (string) - Required - The EC number of the enzyme. ### Request Example ```python import pyuniprot query = pyuniprot.query() query.ec_number(ec_number='1.1.1.1') ``` ### Response #### Success Response (200) - **proteins_by_ec_number** (array) - A list of proteins matching the EC number. #### Response Example (Response structure depends on the matched protein data) ``` -------------------------------- ### Query by Tissue in Reference Source: https://pyuniprot.readthedocs.io/en/latest/query_functions Fetches proteins associated with a specific tissue mentioned in a reference. Consult the `pyuniprot.manager.query.QueryManager.tissue_in_reference()` documentation for a full list of parameters. ```APIDOC ## GET /query/tissue_in_reference ### Description Retrieves protein entries associated with a specific tissue mentioned in a reference. ### Method GET ### Endpoint /query/tissue_in_reference ### Parameters #### Query Parameters - **tissue** (string) - Required - The name of the tissue. ### Request Example ```python import pyuniprot query = pyuniprot.query() query.tissue_in_reference(tissue='Substantia nigra') ``` ### Response #### Success Response (200) - **proteins_by_reference_tissue** (array) - A list of proteins associated with the specified reference tissue. #### Response Example (Response structure depends on the matched protein data) ``` -------------------------------- ### Search Human Proteins by Name (Contains) as DataFrame Source: https://pyuniprot.readthedocs.io/en/latest/query Finds all UniProt entries for human proteins (taxid=9606) where the name contains 'CD33', returning the results as a pandas DataFrame. Demonstrates selecting specific columns and rows from the DataFrame. Requires pandas and pyuniprot. ```python >>> results = query.entry(name='%CD33%', taxid=9606, as_df=True) # get first 2 lines of results with columns 'name','recommended_full_name', 'taxid' >>> results.ix[:2,('name','recommended_full_name', 'taxid')] name recommended_full_name taxid 0 CD33_HUMAN Myeloid cell surface antigen CD33 9606 1 CCD33_HUMAN Coiled-coil domain-containing protein 33 9606 ``` -------------------------------- ### Query by PMID Source: https://pyuniprot.readthedocs.io/en/latest/query_functions Searches for proteins associated with a specific PubMed ID (PMID). For a full list of parameters, consult the `pyuniprot.manager.query.QueryManager.pmid()` documentation. ```APIDOC ## GET /query/pmid ### Description Retrieves protein entries associated with a given PubMed ID. ### Method GET ### Endpoint /query/pmid ### Parameters #### Query Parameters - **pmid** (integer) - Required - The PubMed ID. ### Request Example ```python import pyuniprot query = pyuniprot.query() query.pmid(pmid=7644510) ``` ### Response #### Success Response (200) - **proteins_by_pmid** (array) - A list of proteins associated with the PMID. #### Response Example (Response structure depends on the matched protein data) ``` -------------------------------- ### Query by Other Gene Name Source: https://pyuniprot.readthedocs.io/en/latest/query_functions Finds proteins using an alternative gene name. The `pyuniprot.manager.query.QueryManager.other_gene_name()` documentation provides details on all available parameters. ```APIDOC ## GET /query/other_gene_name ### Description Retrieves protein entries using an alternative gene name. ### Method GET ### Endpoint /query/other_gene_name ### Parameters #### Query Parameters - **entry_name** (string) - Required - The entry name of the protein. ### Request Example ```python import pyuniprot query = pyuniprot.query() query.other_gene_name(entry_name='A4_HUMAN') ``` ### Response #### Success Response (200) - **proteins_by_gene_name** (array) - A list of proteins matching the alternative gene name. #### Response Example (Response structure depends on the matched protein data) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.