freqsap.uniprot =============== .. py:module:: freqsap.uniprot .. autoapi-nested-parse:: Module for interacting with the UniProt API. Classes ------- .. autoapisummary:: freqsap.uniprot.UniProt Module Contents --------------- .. py:class:: UniProt(timeout: int = 3) Bases: :py:obj:`freqsap.interfaces.ProteinVariantAPI` Interface to the UniProt protein database API. Provides methods to query protein information and variations from UniProt. .. py:attribute:: _params .. py:attribute:: _headers .. py:attribute:: _timeout :value: 3 .. py:method:: get(accession: freqsap.accession.Accession) -> freqsap.protein.Protein Retrieve protein and its variations from UniProt. :param accession: The protein accession identifier. :type accession: Accession :returns: The protein object with its variations. :rtype: Protein .. py:method:: query(accession: str) -> dict Query UniProt for protein data. :param accession: The protein accession identifier. :type accession: str :returns: JSON response from UniProt API. :rtype: dict :raises requests.HTTPError: If the request fails. .. py:method:: parse(feature: dict) -> freqsap.variation.Variation | None Parse a feature dictionary to extract variation information. :param feature: Feature dictionary from UniProt response. :type feature: dict :returns: Variation object if a valid dbSNP reference is found, None otherwise. :rtype: Variation | None .. py:method:: request(url: str) -> requests.Response Make an HTTP GET request to UniProt. :param url: The URL to request. :type url: str :returns: The HTTP response. :rtype: requests.Response .. py:method:: is_dbsnp(xref: dict) -> bool Check if a cross-reference is a dbSNP reference. :param xref: Cross-reference dictionary. :type xref: dict :returns: True if the reference is from dbSNP and starts with 'rs', False otherwise. :rtype: bool .. py:method:: available() -> bool Check if the UniProt API is available. :returns: True if the service is available, False otherwise. :rtype: bool