Class UniprotProteinAPIClient


  • public class UniprotProteinAPIClient
    extends Object
    Client for the Uniprot Protein API
    • Field Detail

      • log

        public static final Logger log
        Sets up a logger for that class.
    • Constructor Detail

      • UniprotProteinAPIClient

        public UniprotProteinAPIClient()
    • Method Detail

      • getSwissprotIdsForAccession

        public List<String> getSwissprotIdsForAccession​(String accession,
                                                        String taxonId)
                                                 throws UniprotProteinAPIClientException
        Finds the list of swissProtIds for a provided ID and taxonId
        Parameters:
        accession - the accession to look for
        taxonId - the organism of the protein
        Returns:
        the swissprotIds if found, empty list otherwise
        Throws:
        UniprotProteinAPIClientException - an exception if the given accession is null
      • getTremblIdsForAccession

        public List<String> getTremblIdsForAccession​(String accession,
                                                     String taxonId)
                                              throws UniprotProteinAPIClientException
        Finds the list of termblIds for a provided ID and taxonId
        Parameters:
        accession - the accession to look for
        taxonId - the organism of the protein
        Returns:
        the tremblId if found, empty list otherwise
        Throws:
        UniprotProteinAPIClientException - an exception if the given accession is null
      • getUniparcEntries

        public List<Entry> getUniparcEntries​(String accession,
                                             String taxonId)
                                      throws UniprotProteinAPIClientException
        Gets the list of uniparcId matching this accession number
        Parameters:
        accession - the accession to look for
        taxonId - : the organism of the protein
        Returns:
        the list of uniparc Id or empty list if the accession doesn't match any Uniparc sequence
        Throws:
        UniprotProteinAPIClientException - an exception if the given accession is null
      • getUPEntriesForAccession

        public List<Entry> getUPEntriesForAccession​(String accession,
                                                    String taxonId,
                                                    SearchDatabase... databases)
                                             throws UniprotProteinAPIClientException
        Finds the list of UPEntries for a provided ID and organism from the provided list of databases
        Parameters:
        accession - the accession to look for
        taxonId - the organism of the protein
        databases - the databases to query
        Returns:
        the uniprot ID if found, null otherwise
        Throws:
        UniprotProteinAPIClientException - an exception if the given accession is null
      • getSwissprotIdsForSequence

        public List<String> getSwissprotIdsForSequence​(String sequence,
                                                       String taxonId)
                                                throws UniprotProteinAPIClientException
        Finds the list of swissProtIds for a provided sequence and taxonId
        Parameters:
        sequence - the sequence to look for
        taxonId - the organism of the protein
        Returns:
        the swissprotIds if found, empty list otherwise
        Throws:
        UniprotProteinAPIClientException - an exception if the given sequence is null
      • getTremblIdsForSequence

        public List<String> getTremblIdsForSequence​(String sequence,
                                                    String taxonId)
                                             throws UniprotProteinAPIClientException
        Finds the list of termblIds for a provided sequence and taxonId
        Parameters:
        sequence - the sequence to look for
        taxonId - the organism of the protein
        Returns:
        the tremblId if found, empty list otherwise
        Throws:
        UniprotProteinAPIClientException - an exception if the given sequence is null
      • getUniparcIdFromSequence

        public String getUniparcIdFromSequence​(String sequence,
                                               String taxonId)
                                        throws UniprotProteinAPIClientException
        Gets the uniparcId matching this sequence
        Parameters:
        sequence - the sequence to look for
        taxonId - the organism of the sequence
        Returns:
        the uniparc Id or null if the sequence doesn't match any Uniparc sequence
        Throws:
        UniprotProteinAPIClientException - an exception if the given sequence is null
      • getUPEntriesForSequence

        public Entry getUPEntriesForSequence​(String sequence,
                                             String taxonId,
                                             SearchDatabase... databases)
                                      throws UniprotProteinAPIClientException
        Get the Entry which matches the sequence and taxonId in the given databases
        Parameters:
        sequence - sequence of the protein to retrieve
        taxonId - organism of the sequence
        databases - the databases to look into
        Returns:
        an Entry instance matching the sequence, taxonId in the specific databases
        Throws:
        UniprotProteinAPIClientException - if the given sequence is null
      • getUniprotEntryForAccession

        public List<uk.ac.ebi.kraken.interfaces.uniprot.UniProtEntry> getUniprotEntryForAccession​(String accession)
        Get the UniprotEntry with its accession number
        Parameters:
        accession - the Uniprot identifier of the protein we want to retrieve
        Returns:
        A list of UniprotEntry instances for this identifier
      • getUniparcEntryForAccession

        public List<uk.ac.ebi.kraken.interfaces.uniparc.UniParcEntry> getUniparcEntryForAccession​(String accession)
        Get the UniparcEntry with an accession number
        Parameters:
        accession - the identifier of the protein we want to retrieve
        Returns:
        a list of UniparcEntry instances for this accession