nct.service.homology
Class BiojavaLocalBlast

java.lang.Object
  extended by nct.service.homology.BiojavaLocalBlast
All Implemented Interfaces:
HomologyModel

public class BiojavaLocalBlast
extends java.lang.Object
implements HomologyModel

A Blast implementation of the HomologyModel interface that runs Blast locally. BiojavaLocalBlast needs to know how to actually run Blast locally. This is accomplished by specifying these details in a properties file. The specific properties that this command looks for are:

Here is an example of a blast.properties file:
blast.blastall.command=blastall -p blastp -d TARGET_DB -i QUERY_SEQS -m 7 -e E_VALUE -o OUTPUT_FILE
blast.blastall.location=/cellar/users/mes/software/blast-2.2.12/bin
blast.formatdb.command=formatdb -i TARGET_DB
blast.formatdb.location=/cellar/users/mes/software/blast-2.2.12/bin


Field Summary
protected  java.lang.String blastOutputFile
          The file that contains the blast output to be parsed.
static java.lang.String E_VALUE
          Sentinel used to specify the expectation value threshold.
protected  java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Double>> evalues
          The map where the evalues between proteins are stored.
protected  java.lang.String eValueThreshold
          A string representation of a double value that is the expectation value threshold for the blastall command (-e argument).
static java.lang.String OUTPUT_FILE
          Sentinel used to specify the output file name.
protected  java.util.Properties props
          A properties object that contains the installation specific details of where and how to run Blast.
static java.lang.String QUERY_SENTINEL
          Sentinel used to specify the query sequence name in the property string.
protected  SynonymMapper synonyms
          Used for mapping various ids to types of synonyms
static java.lang.String TARGET_DB_SENTINEL
          Sentinel used to specify the target database name in the property string.
 
Constructor Summary
BiojavaLocalBlast(java.util.Properties props, java.lang.String tmpOutFile, double eValue)
          Constructor.
BiojavaLocalBlast(java.util.Properties props, SynonymMapper synonyms, java.lang.String tmpOutFile, double eValue)
          Constructor.
 
Method Summary
 java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Double>> expectationValues(SequenceGraph sg1, SequenceGraph sg2)
          Returns a map of expectation values between nodes of the specified graphs.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TARGET_DB_SENTINEL

public static final java.lang.String TARGET_DB_SENTINEL
Sentinel used to specify the target database name in the property string.

See Also:
Constant Field Values

QUERY_SENTINEL

public static final java.lang.String QUERY_SENTINEL
Sentinel used to specify the query sequence name in the property string.

See Also:
Constant Field Values

OUTPUT_FILE

public static final java.lang.String OUTPUT_FILE
Sentinel used to specify the output file name.

See Also:
Constant Field Values

E_VALUE

public static final java.lang.String E_VALUE
Sentinel used to specify the expectation value threshold.

See Also:
Constant Field Values

blastOutputFile

protected java.lang.String blastOutputFile
The file that contains the blast output to be parsed.


evalues

protected java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Double>> evalues
The map where the evalues between proteins are stored. This must be reset each time expectationValues() is called.


props

protected java.util.Properties props
A properties object that contains the installation specific details of where and how to run Blast.


synonyms

protected SynonymMapper synonyms
Used for mapping various ids to types of synonyms


eValueThreshold

protected java.lang.String eValueThreshold
A string representation of a double value that is the expectation value threshold for the blastall command (-e argument).

Constructor Detail

BiojavaLocalBlast

public BiojavaLocalBlast(java.util.Properties props,
                         java.lang.String tmpOutFile,
                         double eValue)
Constructor. Synonyms are set to null, meaning you get whatever id is present in the blast results.

Parameters:
props - The Properties that specify how and where to run Blast.
tmpOutFile - A temporary output file that holds the blast output.
eValue - The expectation value threshold for the blastall command (the -e argument).

BiojavaLocalBlast

public BiojavaLocalBlast(java.util.Properties props,
                         SynonymMapper synonyms,
                         java.lang.String tmpOutFile,
                         double eValue)
Constructor.

Parameters:
props - The Properties that specify how and where to run Blast.
synonyms - A SynonymMapper object used for mapping the ids in the blast results to meaningful names. If it is set to null, you'll simply get the id found in the blast results.
tmpOutFile - A temporary output file that holds the blast output.
eValue - The expectation value threshold for the blastall command (the -e argument).
Method Detail

expectationValues

public java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Double>> expectationValues(SequenceGraph sg1,
                                                                                                          SequenceGraph sg2)
Returns a map of expectation values between nodes of the specified graphs.

Specified by:
expectationValues in interface HomologyModel
Parameters:
sg1 - The first graph containing sequences whose Blast expectation values are to be found.
sg2 - The second graph containing sequences whose Blast expectation values are to be found.
Returns:
A map of expectation values between nodes of the specified graphs.