mkt.databases.pfam
Pfam API client and helper for locating kinase-domain boundaries.
Provides Pfam, a REST client for Pfam domain annotations, and
find_pfam_domain() to identify kinase-domain boundaries for a sequence.
Functions
|
Find Pfam domain for a given HGNC symbol and position |
Classes
|
Class to interact with the Pfam API. |
- class mkt.databases.pfam.Pfam(uniprot_id: str, url: str = 'https://www.ebi.ac.uk/interpro/api/entry/pfam/protein/UniProt/')[source]
Bases:
RESTAPIClientClass to interact with the Pfam API.
- __init__(uniprot_id: str, url: str = 'https://www.ebi.ac.uk/interpro/api/entry/pfam/protein/UniProt/') None
- query_api()[source]
Queries Pfam API for UniProt ID as DataFrame object.
- Returns:
DataFrame with Pfam domain information if request is successful, None if response is empty or request fails
- Return type:
pd.DataFrame | str | None
- uniprot_id: str
UniProt ID to query Pfam API.
- url: str = 'https://www.ebi.ac.uk/interpro/api/entry/pfam/protein/UniProt/'
Pfam API URL.
- mkt.databases.pfam.find_pfam_domain(input_id: str, input_position: int, df_ref: DataFrame, col_ref_id: str, col_ref_start: str | None = None, col_ref_end: str | None = None, col_ref_domain: str | None = None) str | None[source]
Find Pfam domain for a given HGNC symbol and position
- Parameters:
input_id (str) – Input ID that matches
input_position (int) – Codon position in UniProt canonical sequence
df_ref (pd.DataFrame) – DataFrame with Pfam domain information
col_ref_id (str) – Column that contains the IDs to match to in the df_ref dataframe
col_ref_start (None | str) – Column containing the domain start position; if None defaults to “start” (Pfam API default)
col_ref_end (None | str) – Column containing the domain end position; if None defaults to “end” (Pfam API default)
col_ref_domain (None | str) – Column containing the domain name; if None defaults to “name” (Pfam API default)
- Returns:
Pfam domain if found, None if not found
- Return type:
str | None