Class RemoteQBlastService

  • All Implemented Interfaces:
    RemotePairwiseAlignmentService

    public class RemoteQBlastService
    extends Object
    implements RemotePairwiseAlignmentService
    RemoteQBlastService - A simple way of submitting BLAST request to the QBlast service at NCBI.

    NCBI provides a Blast server through a CGI-BIN interface. RemoteQBlastService simply encapsulates an access to it by giving users access to get/set methods to fix sequence, program and database as well as advanced options.

    The philosophy behind RemoteQBlastService is to disconnect submission of Blast requests from collection of Blast results. This is done so to allow a user to submit multiple Blast requests while allowing recovery of the reports at a later time.

    Presently, only blastall programs are accessible. blastpgp and megablast are high-priorities.

    Since:
    1.8
    Author:
    Sylvain Foisy, Diploide BioIT
    • Method Detail

      • sendAlignmentRequest

        public String sendAlignmentRequest​(String str,
                                           RemotePairwiseAlignmentProperties rpa)
                                    throws BioException
        This method is a wrapper that executes the Blast request via the Put command of the CGI-BIN interface with the specified parameters and a string representing the sequence. It gets the estimated time of completion by capturing the value of the RTOE variable and sets a loop that will check for completion of analysis at intervals specified by RTOE.

        It also capture the value for the RID variable, necessary for fetching the actual results after completion.

        Specified by:
        sendAlignmentRequest in interface RemotePairwiseAlignmentService
        Parameters:
        str - : a String with a sequence
        rpa - : a RemotePairwiseAlignmentProperties object
        Returns:
        rid : a String with the request ID for this sequence
        Throws:
        BioException - if it is not possible to sent the BLAST command
      • sendAlignmentRequest

        public String sendAlignmentRequest​(RichSequence rs,
                                           RemotePairwiseAlignmentProperties rpa)
                                    throws BioException
        This method is a wrapper that executes the Blast request via the Put command of the CGI-BIN interface with the specified parameters and a RichSequence. It gets the estimated time of completion by capturing the value of the RTOE variable and sets a loop that will check for completion of analysis at intervals specified by RTOE.

        It also capture the value for the RID variable, necessary for fetching the actual results after completion.

        Specified by:
        sendAlignmentRequest in interface RemotePairwiseAlignmentService
        Parameters:
        rs - :a RichSequence object
        rpa - :a RemotePairwiseAlignmentProperties object
        Returns:
        rid : a String with the request ID for this sequence
        Throws:
        BioException - if it is not possible to sent the BLAST command
      • sendAlignmentRequest

        public String sendAlignmentRequest​(int gid,
                                           RemotePairwiseAlignmentProperties rpa)
                                    throws BioException
        This method is a wrapper that executes the Blast request via the Put command of the CGI-BIN interface with the specified parameters and a GenBank GID. It gets the estimated time of completion by capturing the value of the RTOE variable and sets a loop that will check for completion of analysis at intervals specified by RTOE.

        It also capture the value for the RID variable, necessary for fetching the actual results after completion.

        Parameters:
        gid - :an integer with a Genbank GID
        rpa - :a RemotePairwiseAlignmentProperties object
        Returns:
        rid : a String with the request ID for this sequence
        Throws:
        BioException - if it is not possible to sent the BLAST command
      • isReady

        public boolean isReady​(String id,
                               long present)
                        throws BioException

        This method is used only for the executeBlastSearch method to check for completion of request using the NCBI specified RTOE variable

        Specified by:
        isReady in interface RemotePairwiseAlignmentService
        Parameters:
        id - : a valid request ID
        present - : a representation of "now" using System.currentTimeMillis().
        Returns:
        a boolean value telling if the request has been completed or not.
        Throws:
        BioException - if the ID does not exist.
      • setTool

        public void setTool​(String tool)
        Set the tool identifier for QBlast. Defaults to 'biojavax'.
        Parameters:
        tool - the new identifier.
      • getTool

        public String getTool()
        Get the tool identifier for QBlast. Defaults to 'biojavax'.
        Returns:
        the identifier.
      • setEmail

        public void setEmail​(String email)
        Set the email for QBlast. Defaults to 'anonymous@biojava.org'.
        Parameters:
        email - the new email.
      • getEmail

        public String getEmail()
        Get the email for QBlast. Defaults to 'anonymous@biojava.org'.
        Returns:
        the email.