org.biojava3.ws.alignment.qblast
Class NCBIQBlastAlignmentProperties

java.lang.Object
  extended by org.biojava3.ws.alignment.qblast.NCBIQBlastAlignmentProperties
All Implemented Interfaces:
Serializable, RemotePairwiseAlignmentProperties

public class NCBIQBlastAlignmentProperties
extends Object
implements RemotePairwiseAlignmentProperties

This class wraps a QBlast search request parameter Map by adding several convenient parameter addition methods. Other QBlast URL API parameters should be added using setAlignmentOption(BlastAlignmentParameterEnum, String)

Required parameters are PROGRAM and DATABASE, other parameters are optional

Author:
Sylvain Foisy, Diploide BioIT, Gediminas Rimsa
See Also:
Serialized Form

Constructor Summary
NCBIQBlastAlignmentProperties()
           
 
Method Summary
 String getAlignmentOption(BlastAlignmentParameterEnum key)
          Gets the value of specified parameter or null if it is not set.
 String getAlignmentOption(String key)
          This method forwards to getAlignmentOption(BlastAlignmentParameterEnum).
 Set<String> getAlignmentOptions()
          Gets parameters, which are currently set
 String getBlastAdvancedOptions()
           
 String getBlastDatabase()
           
 double getBlastExpect()
           
 int getBlastFromPosition()
           
 String getBlastGapCosts()
          Returns the actual string for the GAPCOSTS parameter which is used to build the URL
 int getBlastGapCreation()
          Returns the value for the GAP_CREATION parameter (first half of GAPCOSTS parameter)
 int getBlastGapExtension()
          Returns the value for the gap extension parameter (second half of GAPCOSTS parameter)
 String getBlastMatrix()
          Returns the value of the specified substitution matrix
 BlastProgramEnum getBlastProgram()
           
 int getBlastToPosition()
           
 int getBlastWordSize()
          Returns the value of the WORD_SIZE parameter used for this blast run
 void removeAlignmentOption(BlastAlignmentParameterEnum key)
          Removes given parameter
 void setAlignementOption(String key, String val)
          This method forwards to setAlignmentOption(BlastAlignmentParameterEnum, String).
 void setAlignmentOption(BlastAlignmentParameterEnum key, String val)
          Sets the value of specified parameter
 void setBlastAdvancedOptions(String advancedOptions)
          This method is to be used if a request is to use non-default values at submission.
 void setBlastDatabase(String database)
          Sets the database to be used with blastall
 void setBlastExpect(double expect)
          Sets the EXPECT parameter to be use with blastall
 void setBlastFromToPosition(int start, int end)
          Sets the QUERY_FROM and QUERY_TO parameters to be use by blast.
 void setBlastGapCosts(int gapCreation, int gapExtension)
          Sets the GAPCOSTS parameter
 void setBlastMatrix(BlastMatrixEnum matrix)
          Sets the value for the MATRIX parameter to use for blastall
 void setBlastProgram(BlastProgramEnum program)
          Sets the program to be used with blastall
 void setBlastWordSize(int word)
          Sets the WORD_SIZE parameter to be use with blastall
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NCBIQBlastAlignmentProperties

public NCBIQBlastAlignmentProperties()
Method Detail

getAlignmentOption

public String getAlignmentOption(String key)
This method forwards to getAlignmentOption(BlastAlignmentParameterEnum). Consider using it instead.

Specified by:
getAlignmentOption in interface RemotePairwiseAlignmentProperties
Parameters:
key - :a String with the required key for this map.
Returns:
a String with the value associated with this key

setAlignementOption

public void setAlignementOption(String key,
                                String val)
This method forwards to setAlignmentOption(BlastAlignmentParameterEnum, String). Consider using it instead.

Specified by:
setAlignementOption in interface RemotePairwiseAlignmentProperties
Parameters:
key - :the key use to designate the value to be stored
val - :the actual value matched to key

getAlignmentOptions

public Set<String> getAlignmentOptions()
Gets parameters, which are currently set

Specified by:
getAlignmentOptions in interface RemotePairwiseAlignmentProperties
Returns:
a Set with all keys held in this instance of the object

getAlignmentOption

public String getAlignmentOption(BlastAlignmentParameterEnum key)
Gets the value of specified parameter or null if it is not set.


setAlignmentOption

public void setAlignmentOption(BlastAlignmentParameterEnum key,
                               String val)
Sets the value of specified parameter


removeAlignmentOption

public void removeAlignmentOption(BlastAlignmentParameterEnum key)
Removes given parameter


getBlastProgram

public BlastProgramEnum getBlastProgram()
Returns:
BlastProgramEnum used for blast run

setBlastProgram

public void setBlastProgram(BlastProgramEnum program)
Sets the program to be used with blastall

Parameters:
program - : one of blastall programs

getBlastDatabase

public String getBlastDatabase()
Returns:
name of database used with blastall

setBlastDatabase

public void setBlastDatabase(String database)
Sets the database to be used with blastall

A list of available databases can be acquired by calling NCBIQBlastService#printRemoteBlastInfo()

Blastall equivalent: -d

Parameters:
db - : a valid name to a NCBI blastable database

getBlastExpect

public double getBlastExpect()
Returns:
double value of EXPECT parameter used for blast run

setBlastExpect

public void setBlastExpect(double expect)
Sets the EXPECT parameter to be use with blastall

Example: if you want a EXPECT of 1e-10, pass Double.parseDouble("1e-10") as a parameter

Blastall equivalent: -e

Parameters:
expect: - a double value of EXPECT parameter

getBlastWordSize

public int getBlastWordSize()
Returns the value of the WORD_SIZE parameter used for this blast run

Returns:
int value of WORD_SIZE used by this search
Throws:
IllegalArgumentException - when program type is not set and program type is not supported

setBlastWordSize

public void setBlastWordSize(int word)
Sets the WORD_SIZE parameter to be use with blastall

WARNING!! At this point, the method does not verify the validity of your choice; for example, word size of greater than 5 with blastp returns error messages from QBlast. Word size range depends on the algorithm chosen.

More at http://www.ncbi.nlm.nih.gov/staff/tao/URLAPI/new/node74.html

Blastall equivalent: -W

Parameters:
word: - an int used to set WORD_SIZE

getBlastGapCreation

public int getBlastGapCreation()
Returns the value for the GAP_CREATION parameter (first half of GAPCOSTS parameter)

Returns:
an integer value for gap creation used by this search, -1 if not set or not a number

getBlastGapExtension

public int getBlastGapExtension()
Returns the value for the gap extension parameter (second half of GAPCOSTS parameter)

Returns:
an integer for the value for gap extension used by this search, -1 if not set or not a number

getBlastGapCosts

public String getBlastGapCosts()
Returns the actual string for the GAPCOSTS parameter which is used to build the URL

Returns:
the string representation of the GAPCOSTS parameter formatted for the URL

setBlastGapCosts

public void setBlastGapCosts(int gapCreation,
                             int gapExtension)
Sets the GAPCOSTS parameter

Parameters:
gapCreation - integer to use as gap creation value
gapExtension - integer to use as gap extension value

getBlastMatrix

public String getBlastMatrix()
Returns the value of the specified substitution matrix

Returns:
matrix: the name of the specified substitution matrix

setBlastMatrix

public void setBlastMatrix(BlastMatrixEnum matrix)
Sets the value for the MATRIX parameter to use for blastall

Blastall equivalent: -M

Parameters:
matrix - : a String to use as gap creation value
See Also:
BlastMatrixEnum

setBlastFromToPosition

public void setBlastFromToPosition(int start,
                                   int end)
Sets the QUERY_FROM and QUERY_TO parameters to be use by blast. Do not use if you want to use the whole sequence.
Blastall equivalent: -L

Parameters:
start - QUERY_FROM parameter
end - QUERY_TO parameter

getBlastFromPosition

public int getBlastFromPosition()
Returns:
an integer value for the QUERY_FROM parameter
See Also:
setBlastFromToPosition(int, int)

getBlastToPosition

public int getBlastToPosition()
Returns:
QUERY_TO parameter
See Also:
setBlastFromToPosition(int, int)

setBlastAdvancedOptions

public void setBlastAdvancedOptions(String advancedOptions)
This method is to be used if a request is to use non-default values at submission. Useful for the following blastall parameters:

WARNING!! This method is still very much in flux and might not work as expected...

You have to be aware that at no moment is there any error checking on the use of these parameters by this class.

Parameters:
advancedOptions - : a String with any number of optional parameters with an associated value.

getBlastAdvancedOptions

public String getBlastAdvancedOptions()
Returns:
the String with the advanced options