public class RemoteQBlastService extends Object implements 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.
Constructor and Description |
---|
RemoteQBlastService()
The constructor for a QBlast service request.
|
Modifier and Type | Method and Description |
---|---|
InputStream |
getAlignmentResults(String id,
RemotePairwiseAlignmentOutputProperties rb)
This method extracts the actual Blast report for this request ID.
|
String |
getEmail()
Get the email for QBlast.
|
String |
getTool()
Get the tool identifier for QBlast.
|
boolean |
isReady(String id,
long present)
This method is used only for the executeBlastSearch method to check for
completion of request using the NCBI specified RTOE variable
|
void |
printRemoteBlastInfo()
A simple method to check the availability of the QBlast service
|
String |
sendAlignmentRequest(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.
|
String |
sendAlignmentRequest(RichSequence rs,
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
RichSequence.
|
String |
sendAlignmentRequest(String str,
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
string representing the sequence.
|
void |
setEmail(String email)
Set the email for QBlast.
|
void |
setTool(String tool)
Set the tool identifier for QBlast.
|
public RemoteQBlastService() throws BioException
BioException
- if the NCBI URL is unresponsivepublic String sendAlignmentRequest(String str, RemotePairwiseAlignmentProperties rpa) throws BioException
It also capture the value for the RID variable, necessary for fetching the actual results after completion.
sendAlignmentRequest
in interface RemotePairwiseAlignmentService
str
- : a String
with a sequencerpa
- : a RemotePairwiseAlignmentProperties
objectString
with the request ID for this sequenceBioException
- if it is not possible to sent the BLAST commandpublic String sendAlignmentRequest(RichSequence rs, RemotePairwiseAlignmentProperties rpa) throws BioException
It also capture the value for the RID variable, necessary for fetching the actual results after completion.
sendAlignmentRequest
in interface RemotePairwiseAlignmentService
rs
- :a RichSequence
objectrpa
- :a RemotePairwiseAlignmentProperties
objectString
with the request ID for this sequenceBioException
- if it is not possible to sent the BLAST commandpublic String sendAlignmentRequest(int gid, RemotePairwiseAlignmentProperties rpa) throws BioException
It also capture the value for the RID variable, necessary for fetching the actual results after completion.
gid
- :an integer with a Genbank GIDrpa
- :a RemotePairwiseAlignmentProperties
objectBioException
- if it is not possible to sent the BLAST commandpublic 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
isReady
in interface RemotePairwiseAlignmentService
id
- : a valid request IDpresent
- : a representation of "now" using System.currentTimeMillis().BioException
- if the ID does not exist.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.
getAlignmentResults
in interface RemotePairwiseAlignmentService
id
- :a valid request IDrb
- : a RemotePairwiseAlignmentOutputProperties
that
will specify specific output formatting commandsInputStream
that can be use any way one might
desireBioException
- if it is not possible to recover the results.public void printRemoteBlastInfo() throws BioException
BioException
- if unable to connect to the NCBI QBlast servicepublic void setTool(String tool)
tool
- the new identifier.public String getTool()
public void setEmail(String email)
email
- the new email.Copyright © 2014 BioJava. All rights reserved.