Class UnisaveClient

  • All Implemented Interfaces:
    SequenceVersionFetcher

    public class UnisaveClient
    extends Object
    implements SequenceVersionFetcher
    Client to query unisave and collect sequence versions or sequence from a particular version
    Since:
    30/09/13
    Version:
    $Id$
    Author:
    Marine Dumousseau (marine@ebi.ac.uk)
    • Constructor Detail

      • UnisaveClient

        public UnisaveClient()

        Constructor for UnisaveClient.

    • Method Detail

      • getVersions

        public List<Integer> getVersions​(String identifier)
                                  throws BridgeFailedException
        Searches for all entry version given its identifier.
        Parameters:
        identifier - the identifier of the entry we are interested in.
        Returns:
        list of all versions of the given entry from the most recent to the oldest.
        Throws:
        BridgeFailedException - if the identifier cannot be found in UniSave.
      • getFastaSequence

        public FastaSequence getFastaSequence​(String identifier,
                                              int version)
                                       throws BridgeFailedException
        Retrieve a fasta sequence corresponding to a given EntryVersion.
        Parameters:
        version - the version for which we want the sequence
        identifier - a String object.
        Returns:
        a fasta sequence.
        Throws:
        BridgeFailedException - if the version given doesn't have an entryId that can be found in UniSave.
      • getSequenceVersion

        public int getSequenceVersion​(String identifier,
                                      String sequence)
                               throws BridgeFailedException
        Returns the sequence version of a sequence for a certain uniprot ac. Returns -1 if the sequence cannot be found for this uniprot ac
        Parameters:
        identifier - a String object.
        sequence - a String object.
        Returns:
        a int.
        Throws:
        BridgeFailedException - if any.
      • getAvailableSequenceUpdate

        public List<SequenceVersion> getAvailableSequenceUpdate​(String identifier,
                                                                String sequence)
                                                         throws BridgeFailedException
        Collects all available sequence update fro mUniSave.
        Parameters:
        identifier - identifier of the uniprot entry
        sequence - sequence for which we want the subsequent updates
        Returns:
        a non null ordered list. If the given sequence is found in the entry history, this sequence at least is returned. If there were say, 2 updates since that protein sequence, the list would contain 3 versions. If we fail to find a match for the given sequence in UniSave, the list would contain all existing sequence update available. The list of ordered from the oldest to the most recent sequence.
        Throws:
        BridgeFailedException - if the identifier cannot be found in UniSave.
      • getSocketTimeout

        public int getSocketTimeout()

        Getter for the field socketTimeout.

        Returns:
        a int.
      • setSocketTimeout

        public void setSocketTimeout​(int socketTimeout)

        Setter for the field socketTimeout.

        Parameters:
        socketTimeout - a int.
      • getConnectionTimeOut

        public int getConnectionTimeOut()

        Getter for the field connectionTimeOut.

        Returns:
        a int.
      • setConnectionTimeOut

        public void setConnectionTimeOut​(int connectionTimeOut)

        Setter for the field connectionTimeOut.

        Parameters:
        connectionTimeOut - a int.