Class RemoteQBlastService
- All Implemented Interfaces:
RemotePairwiseAlignmentService
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
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionThis method extracts the actual Blast report for this request ID.getEmail()
Get the email for QBlast.getTool()
Get the tool identifier for QBlast.boolean
This method is used only for the executeBlastSearch method to check for completion of request using the NCBI specified RTOE variablevoid
A simple method to check the availability of the QBlast servicesendAlignmentRequest
(int gid, RemotePairwiseAlignmentProperties rpa) 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.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.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.void
Set the email for QBlast.void
Set the tool identifier for QBlast.
-
Constructor Details
-
RemoteQBlastService
The constructor for a QBlast service request.- Throws:
BioException
- if the NCBI URL is unresponsive
-
-
Method Details
-
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 interfaceRemotePairwiseAlignmentService
- Parameters:
str
- : aString
with a sequencerpa
- : aRemotePairwiseAlignmentProperties
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 interfaceRemotePairwiseAlignmentService
- Parameters:
rs
- :aRichSequence
objectrpa
- :aRemotePairwiseAlignmentProperties
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 GIDrpa
- :aRemotePairwiseAlignmentProperties
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
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 interfaceRemotePairwiseAlignmentService
- Parameters:
id
- : a valid request IDpresent
- : 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.
-
getAlignmentResults
public InputStream getAlignmentResults(String id, RemotePairwiseAlignmentOutputProperties rb) throws BioException This method extracts the actual Blast report for this request ID. It uses an object implementing the RemotePairwiseAlignmentOutputProperties interface which will specify output formatting options.
- Specified by:
getAlignmentResults
in interfaceRemotePairwiseAlignmentService
- Parameters:
id
- :a valid request IDrb
- : aRemotePairwiseAlignmentOutputProperties
that will specify specific output formatting commands- Returns:
- an
InputStream
that can be use any way one might desire - Throws:
BioException
- if it is not possible to recover the results.
-
printRemoteBlastInfo
A simple method to check the availability of the QBlast service- Throws:
BioException
- if unable to connect to the NCBI QBlast service
-
setTool
Set the tool identifier for QBlast. Defaults to 'biojavax'.- Parameters:
tool
- the new identifier.
-
getTool
Get the tool identifier for QBlast. Defaults to 'biojavax'.- Returns:
- the identifier.
-
setEmail
Set the email for QBlast. Defaults to 'anonymous@biojava.org'.- Parameters:
email
- the new email.
-
getEmail
Get the email for QBlast. Defaults to 'anonymous@biojava.org'.- Returns:
- the email.
-