Class NCBIQBlastAlignmentProperties

java.lang.Object
org.biojava.nbio.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:
  • Constructor Details

    • NCBIQBlastAlignmentProperties

      public NCBIQBlastAlignmentProperties()
  • Method Details

    • 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 https://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:
    • 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:
    • getBlastToPosition

      public int getBlastToPosition()
      Returns:
      QUERY_TO parameter
      See Also:
    • 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:
      • -r: integer to reward for match. Default = 1
      • -q: negative integer for penalty to allow mismatch. Default = -3
      • -y: dropoff for blast extensions in bits, using default if not specified. Default = 20 for blastn, 7 for all others (except megablast for which it is not applicable).
      • -X: X dropoff value for gapped alignment, in bits. Default = 30 for blastn/megablast, 15 for all others.
      • -Z: final X dropoff value for gapped alignement, in bits. Default = 50 for blastn, 25 for all others (except megablast for which it is not applicable)
      • -P: equals 0 for multiple hits 1-pass, 1 for single hit 1-pass. Does not apply to blastn ou megablast.
      • -A: multiple hits window size. Default = 0 (for single hit algorithm)
      • -I: number of database sequences to save hits for. Default = 500
      • -Y: effective length of the search space. Default = 0 (0 represents using the whole space)
      • -z: a real specifying the effective length of the database to use. Default = 0 (0 represents the real size)
      • -c: an integer representing pseudocount constant for PSI-BLAST. Default = 7
      • -F: any filtering directive

      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