de.unibi.techfak.jpredictor.operator
Interface ICommunicator

All Known Implementing Classes:
DefaultCommunicator

public interface ICommunicator

List of getter and setter methods for all possible options, parameters and settings.


Field Summary
static java.lang.String DISTANCE_ADJACENT
          When creating a DoubleMotif the distance between two motifs is '147 - (length1 + length2)' for minimum and '220 + (length1 + length2)' for maximum.
static java.lang.String DISTANCE_ADJACENT73
          When creating a DoubleMotif the distance between two motifs is '73 - (length1 + length2)' for minimum and '220 + (length1 + length2)' for maximum.
static java.lang.String DISTANCE_ANYSPACE
          When creating a DoubleMotif the distance between two motifs is minimal 0 and maximal Integer.MAX_INT.
static java.lang.String DISTANCE_BELOW220
          When creating a DoubleMotif the distance between two motifs is minimal 0 and maximal 219, messured between the motifs startpoints.
static java.lang.String DISTANCE_ONETURN
          When creating a DoubleMotif the distance between two motifs is '74 +- (length1 + length2)', minus for minimum and plus for maximum.
static java.lang.String DISTANCE_SINGLE
          All motifs are searched and scored as single motifs and are not combined to double motifs.
static java.lang.String DISTANCE_TWOTURNS
          When creating a DoubleMotif the distance between two motifs is '147 +- (length1 + length2)', minus for minimum and plus for maximum.
static int FLAG_B
          Set when the background (negativ training set) was previously set correctly.
static int FLAG_F
          Set when the file to search on is set correctly.
static int FLAG_M
          Set when the model (positive training set) was previously set correctly.
static int OBJECT_FASTA_MODIFIER
          This constant is used to switch on or off for regular objects whether they are FASTA or not.
static int OBJECT_FILENAME
          The object given as Object parameter in some methods is a String containing a filename.
static int OBJECT_FILENAME_FASTA
          The object given as Object parameter in some methods is a String containing the name of a FASTA file.
static int OBJECT_NOTYPE
          The object is not yet given.
static int OBJECT_READER
          The object given as Object parameter in some methods is an arbitrary Reader containing a readable stream.
static int OBJECT_READER_FASTA
          The object given as Object parameter in some methods is an arbitrary Reader containing a readable stream delivering data in FASTA format.
static int OBJECT_SEQUENCE
          The object given as Object parameter in some methods is a Sequence or a MappedCharSequence.
static int OBJECT_STRING
          The object given as Object parameter in some methods is a String containing the sequence.
static int OBJECT_STRING_FASTA
          The object given as Object parameter in some methods is a String containing one or more sequences, which are in FASTA-format.
 
Method Summary
 void allowRunning()
          Sets a flag that signals all running threads started by the operator that they are allowed to run.
 java.io.PrintStream err()
          Returns the output stream to which error messages should be sent.
 boolean flag(int flags)
          Using this method you can test various settings, whether they occured or not.
 double getCutoff()
          Gets the cutoff.
 java.lang.String getDistanceMode()
          Gets the previously set distance mode.
 double[] getGlobalBackground()
          Gives the background distribution over a character set.
 boolean getGraphicalOutput()
           
 MotifList getMotifList()
          Gets the previoulsy set MotifList.
 java.util.Vector getMotifOccurrenceVector()
          If the graphical output is activated, the operator stores information of found motifs in this vector.
 java.lang.Object getNegativeTrainingSequence()
          Gets the sequence object meant as negative training set.
 int getNegativeTrainingSequenceType()
           
 java.lang.Object getNextResult()
          The user interface requests for the next results.
 java.lang.Object getPositiveTrainingSequence()
          Gets the sequence object meant as positive training set.
 int getPositiveTrainingSequenceType()
           
 java.util.Vector getScorePlotVector()
          If the graphical output is activated, the operator stores information for the score plot in this vector.
 long getSeed()
          The seed, the random number generator was initialized with is returned.
 java.lang.Object getSequence()
          Gets the sequence object.
 SequenceEnumeration getSequenceEnumeration(java.lang.Object o, int type)
          Checks for the type and builds a SequenceEnumerator from the object given.
 boolean getSequenceLengthNormalization()
           
 int getSequenceType()
           
 int getSequenceWindowShift()
           
 int getSequenceWindowWidth()
           
 boolean hasNextResult()
          The user interface asks whether the result queue has elements to fetch.
 boolean isRunningAllowed()
          Returns the flag for search and score threads of the operator whether they are allow to proceed or must stop on next occasion.
 java.io.PrintStream out()
          Returns the output stream to which normal output should be sent.
 boolean outputForScoreSequence(IOperator op, boolean best)
           Scores sequences using weighted motifs and generates and prints the appropriate output.
 boolean outputForSearchMotifs(IOperator op, boolean count)
           Searches motifs on sequences and generates and prints the appropriate output.
 boolean outputForWeightMotifs(IOperator op)
           Weights motifs and generates and prints the appropriate output.
 java.util.Random rand()
          Returns the random number generator which is initialized when the communicator object was created.
 double random()
          Returns a double random number generated with the intern random number generator.
 int receiveResults(java.lang.Object o)
          The communicator receives the next result, which is to be stored in a queue-like structure until the user interface requests for the next result by calling getNextResult().
 void setCutoff(double cutoff)
          Sets a cutoff.
 boolean setDistanceMode(java.lang.String distance)
          Sets the distance mode.
 void setErrorStream(java.io.PrintStream ps)
          This method sets a PrintStream as new error message output stream.
 void setGlobalBackground(double[] newBackground)
           Sets the new character occurrence distribution.
 void setGraphicalOutput(boolean graphout)
           The graphical output is activated or deactivated.
 void setMotifList(MotifList ml)
          Sets a MotifList.
 void setNegativeTrainingSequence(java.lang.Object sequ, int type)
          Sets a sequence object (CharSequence, filename or stream) meant as negative training set.
 void setOutputStream(java.io.PrintStream ps)
          This method sets a PrintStream as new output stream.
 void setPositiveTrainingSequence(java.lang.Object sequ, int type)
          Sets a sequence object (CharSequence, filename or stream) meant as positive training set.
 void setSeed(long seed)
          Sets a new seed for the random number generator.
 void setSequence(java.lang.Object sequ, int type)
          Sets a sequence (CharSequence, filename or stream) to perform searching and scoring on.
 void setSequenceLengthNormalization(boolean norm)
          Sets, whether the occurrences on the positive and negativ training set, respectively, are normalized by the sequence length of the set.
 void setSequenceWindowShift(int shift)
          Sets the sequence window's shift.
 void setSequenceWindowWidth(int width)
          Sets the sequence window width.
 void setVerboseStream(java.io.PrintStream ps)
          This method sets a PrintStream as new verbose message output stream.
 void stopRunning()
          Sets a flag that signals all running threads started by the operator to stop as soon as possible.
 java.io.PrintStream ver()
          Returns the output stream to which verbose messages should be sent.
 

Field Detail

DISTANCE_BELOW220

static final java.lang.String DISTANCE_BELOW220
When creating a DoubleMotif the distance between two motifs is minimal 0 and maximal 219, messured between the motifs startpoints.

See Also:
Constant Field Values

DISTANCE_ONETURN

static final java.lang.String DISTANCE_ONETURN
When creating a DoubleMotif the distance between two motifs is '74 +- (length1 + length2)', minus for minimum and plus for maximum.

See Also:
Constant Field Values

DISTANCE_TWOTURNS

static final java.lang.String DISTANCE_TWOTURNS
When creating a DoubleMotif the distance between two motifs is '147 +- (length1 + length2)', minus for minimum and plus for maximum.

See Also:
Constant Field Values

DISTANCE_ADJACENT

static final java.lang.String DISTANCE_ADJACENT
When creating a DoubleMotif the distance between two motifs is '147 - (length1 + length2)' for minimum and '220 + (length1 + length2)' for maximum.

See Also:
Constant Field Values

DISTANCE_ADJACENT73

static final java.lang.String DISTANCE_ADJACENT73
When creating a DoubleMotif the distance between two motifs is '73 - (length1 + length2)' for minimum and '220 + (length1 + length2)' for maximum.

See Also:
Constant Field Values

DISTANCE_ANYSPACE

static final java.lang.String DISTANCE_ANYSPACE
When creating a DoubleMotif the distance between two motifs is minimal 0 and maximal Integer.MAX_INT. But note, that the maximal distance cannot exceed the sequence window width.

See Also:
Constant Field Values

DISTANCE_SINGLE

static final java.lang.String DISTANCE_SINGLE
All motifs are searched and scored as single motifs and are not combined to double motifs.

See Also:
Constant Field Values

OBJECT_NOTYPE

static final int OBJECT_NOTYPE
The object is not yet given. Use this to clear the sequence by setting it to null.

See Also:
Constant Field Values

OBJECT_FASTA_MODIFIER

static final int OBJECT_FASTA_MODIFIER
This constant is used to switch on or off for regular objects whether they are FASTA or not. Disjunct it (OR relation) to switch FASTA on, or conjunct its negation to switch back to RAW.

See Also:
Constant Field Values

OBJECT_FILENAME

static final int OBJECT_FILENAME
The object given as Object parameter in some methods is a String containing a filename. The file itself contains only the sequence itself without status lines (raw).

See Also:
Constant Field Values

OBJECT_FILENAME_FASTA

static final int OBJECT_FILENAME_FASTA
The object given as Object parameter in some methods is a String containing the name of a FASTA file. This file might contain one or more fasta sequences.

See Also:
Constant Field Values

OBJECT_STRING

static final int OBJECT_STRING
The object given as Object parameter in some methods is a String containing the sequence. The sequence has no formating lines or characters (raw).

See Also:
Constant Field Values

OBJECT_STRING_FASTA

static final int OBJECT_STRING_FASTA
The object given as Object parameter in some methods is a String containing one or more sequences, which are in FASTA-format.

See Also:
Constant Field Values

OBJECT_READER

static final int OBJECT_READER
The object given as Object parameter in some methods is an arbitrary Reader containing a readable stream. The reader's content has no predefined format and is meant to consist of only sequence data (raw).

See Also:
Constant Field Values

OBJECT_READER_FASTA

static final int OBJECT_READER_FASTA
The object given as Object parameter in some methods is an arbitrary Reader containing a readable stream delivering data in FASTA format.

See Also:
Constant Field Values

OBJECT_SEQUENCE

static final int OBJECT_SEQUENCE
The object given as Object parameter in some methods is a Sequence or a MappedCharSequence.

See Also:
Constant Field Values

FLAG_B

static final int FLAG_B
Set when the background (negativ training set) was previously set correctly.

See Also:
setNegativeTrainingSequence(Object, int), flag(int), Constant Field Values

FLAG_M

static final int FLAG_M
Set when the model (positive training set) was previously set correctly.

See Also:
setPositiveTrainingSequence(Object, int), flag(int), Constant Field Values

FLAG_F

static final int FLAG_F
Set when the file to search on is set correctly.

See Also:
setSequence(Object, int), flag(int), Constant Field Values
Method Detail

setDistanceMode

boolean setDistanceMode(java.lang.String distance)
Sets the distance mode. That can be for instance any String of the predefined distance modes, e.g. DISTANCE_BELOW220. It is also possible to give a string in the format "min,max". This directly sets the distance to other than the predefined value. But note, that no other string format is accepted.

Parameters:
distance - The distance mode as String.
Returns:
true, if the distance mode could be recognized, false otherwise. If the distance mode was not recognized, it is not set.

getDistanceMode

java.lang.String getDistanceMode()
Gets the previously set distance mode.

Returns:
The distance mode as String.
See Also:
setDistanceMode(String)

getSequenceEnumeration

SequenceEnumeration getSequenceEnumeration(java.lang.Object o,
                                           int type)
Checks for the type and builds a SequenceEnumerator from the object given. Example call: getSequenceEnumeration( ICommunicator.getSequence(), ICommunicator.getSequenceType()).

Parameters:
o - The sequence (CharSequence, Reader or Sequence).
type - The type of sequence, get it from the ICommunicator.
Returns:
null in case of any error, otherwise an enumerator over all possible sequences.
See Also:
SequenceEnumerator, SequenceEnumeration

setSequence

void setSequence(java.lang.Object sequ,
                 int type)
                 throws java.lang.IllegalArgumentException
Sets a sequence (CharSequence, filename or stream) to perform searching and scoring on. Valid values for type are the OBJECT_-variables of this class. Recommended to give are either a filename or a Sequence-Object.
By this method the flag FLAG_F is set. But if you give null as the object's value, any previously set sequence and the FLAG_F are cleared.

Parameters:
sequ - The sequence object, either a String, a Reader or a Sequence from package sequences.
type - The type definition for the object.
Throws:
java.lang.IllegalArgumentException - If the object's type is inequal to what type suggests.
See Also:
FLAG_F, OBJECT_FILENAME, OBJECT_FILENAME_FASTA, OBJECT_NOTYPE, OBJECT_READER, OBJECT_READER_FASTA, OBJECT_SEQUENCE, OBJECT_STRING, OBJECT_STRING_FASTA

getSequence

java.lang.Object getSequence()
Gets the sequence object.

Returns:
The sequence object or null if it was not set.
See Also:
setSequence(Object, int), getSequenceEnumeration(Object, int)

getSequenceType

int getSequenceType()
Returns:
The sequence object's type, or OBJECT_NOTYPE if it was not set.
See Also:
setSequence(Object, int), getSequenceEnumeration(Object, int)

setPositiveTrainingSequence

void setPositiveTrainingSequence(java.lang.Object sequ,
                                 int type)
                                 throws java.lang.IllegalArgumentException
Sets a sequence object (CharSequence, filename or stream) meant as positive training set. Such set consists of one or more sequences with an above-average number of motif occurrences. For PRE-finding it consist of all sequences already confirmed to be true sequences with PRE-functionality.
See setSequence(Object, int) for the parameter's meaning.
By this method the flag FLAG_M is set. But if you give null as the object's value, any previously set sequence and the FLAG_M is cleared.

Parameters:
sequ - The sequence object.
type - The type definition for the object.
Throws:
java.lang.IllegalArgumentException - If the object's type is inequal to what type suggests.
See Also:
FLAG_M, setSequence(Object, int), getSequenceEnumeration(Object, int)

getPositiveTrainingSequence

java.lang.Object getPositiveTrainingSequence()
Gets the sequence object meant as positive training set.

Returns:
The sequence object or null if it was not set.
See Also:
setPositiveTrainingSequence(Object, int), getSequenceEnumeration(Object, int)

getPositiveTrainingSequenceType

int getPositiveTrainingSequenceType()
Returns:
The positive trainings sequence object's type, or OBJECT_NOTYPE if it was not set.
See Also:
setPositiveTrainingSequence(Object, int), getSequenceEnumeration(Object, int)

setNegativeTrainingSequence

void setNegativeTrainingSequence(java.lang.Object sequ,
                                 int type)
                                 throws java.lang.IllegalArgumentException
Sets a sequence object (CharSequence, filename or stream) meant as negative training set. Such set consists of one or more sequences representing the background distribution of alphabet character occurrences. For PRE-finding it consist of a representing sequence with no or at least no PRE-functionality.
See setSequence(Object, int) for the parameter's meaning.
By this method the flag FLAG_B is set. But if you give null as the object's value, any previously set sequence and the FLAG_B is cleared.

Parameters:
sequ - The sequence object.
type - The type definition for the object.
Throws:
java.lang.IllegalArgumentException - If the object's type is inequal to what type suggests.
See Also:
FLAG_B, setSequence(Object, int), getSequenceEnumeration(Object, int)

getNegativeTrainingSequence

java.lang.Object getNegativeTrainingSequence()
Gets the sequence object meant as negative training set.

Returns:
The sequence object or null if it was not set.
See Also:
setNegativeTrainingSequence(Object, int), getSequenceEnumeration(Object, int)

getNegativeTrainingSequenceType

int getNegativeTrainingSequenceType()
Returns:
The negative trainings sequence object's type, or OBJECT_NOTYPE if it was not set.
See Also:
setNegativeTrainingSequence(Object, int), getSequenceEnumeration(Object, int)

setSequenceWindowWidth

void setSequenceWindowWidth(int width)
Sets the sequence window width. The sequence window is a section of the sequence actually considered to do searching or scoring in. E.g., the score is always calculated as sum of all found motif's scores over the whole sequence window.

Parameters:
width - The width of the sequence window.

getSequenceWindowWidth

int getSequenceWindowWidth()
Returns:
The sequence window's width.
See Also:
setSequenceWindowWidth(int)

setSequenceWindowShift

void setSequenceWindowShift(int shift)
Sets the sequence window's shift. The sequence window is a section of the sequence actually considered to do searching or scoring in. When the window is processed it is shifted on the sequence to process another part of the sequence. The shifting value may be less than the window width.

Parameters:
shift - The number of characters the sequence window is shifted by.

getSequenceWindowShift

int getSequenceWindowShift()
Returns:
The number of characters the window is shifted on the sequence.
See Also:
setSequenceWindowShift(int)

setMotifList

void setMotifList(MotifList ml)
Sets a MotifList. The motifs in the list are searched on a sequence and using the occurrences the motifs are weigthed or the sequence is scored.

Parameters:
ml - A list of motifs as MotifList.

getMotifList

MotifList getMotifList()
Gets the previoulsy set MotifList.

Returns:
A list of motifs or null, if no MotifList was set before.
See Also:
setMotifList(MotifList)

setCutoff

void setCutoff(double cutoff)
Sets a cutoff. This value is used when a sequence is scored. If not Double.NaN is set as cutoff the scores are comprised to bands, for which the score is higher than the cutoff. Otherwise, for every sequence window the scores are output.

Parameters:
cutoff - The new cutoff or Double.NaN to switch comprising off.
See Also:
States.fixedCutoffDefault

getCutoff

double getCutoff()
Gets the cutoff. The value of the cutoff decides whether comprising the scores is switched on (Double.isNaN(cutoff)==true) or off.

Returns:
The actually set cutoff.
See Also:
setCutoff(double)

setGlobalBackground

void setGlobalBackground(double[] newBackground)
                         throws java.lang.NullPointerException,
                                java.lang.IllegalArgumentException

Sets the new character occurrence distribution. For every assumed character a probability has to be given, which represents the occurrence frequency of that character in a sequence.

The given double array is cloned, and the cloned version is recalculated such that all values sum up to one (normalization). Thus, the given background is not changed in any way.

Parameters:
newBackground - The new background character distribution. Note, that it must not be null nor empty.
Throws:
java.lang.NullPointerException - If the given background is null.
java.lang.IllegalArgumentException - If the given background is empty or if at least one value is less than zero or if the sum over all probabilities (or counts) is zero.

getGlobalBackground

double[] getGlobalBackground()
Gives the background distribution over a character set.

Returns:
The distribution over a character set (background) is returned.
See Also:
setGlobalBackground(double[])

receiveResults

int receiveResults(java.lang.Object o)
                   throws java.lang.IllegalStateException
The communicator receives the next result, which is to be stored in a queue-like structure until the user interface requests for the next result by calling getNextResult().
Note, that the user interface should not call this method.

Parameters:
o - This object is to be stored as part of the result stream.
Returns:
The number of objects in the queue not yet sent to the user interface.
Throws:
java.lang.IllegalStateException - If the communicator was unable to store the object for any reason.
See Also:
getNextResult()

getNextResult

java.lang.Object getNextResult()
                               throws java.lang.IllegalStateException
The user interface requests for the next results. From the stream of possible results the next one is returned. See the task-performing methods in the IOperator for a notion on what the Objects might be.

Returns:
The next result object, or null if no results are available in the queue.
Throws:
java.lang.IllegalStateException - If the communicator was unable to read an object for any reason.
See Also:
hasNextResult(), IOperator.searchMotifs(boolean), IOperator.weightMotifs(), IOperator.scoreSequence()

hasNextResult

boolean hasNextResult()
The user interface asks whether the result queue has elements to fetch.
Note, that even if this method returns false, a consecutive call to getNextResult() might return other than null because the task-performing thread may have send a result in the meanwhile. What can be assured of is, that in case of a returned true a call to getNextResult() will not return null.

Returns:
true if a result is in the queue and can be fetched by calling getNextresult(), false if actually no result is in the queue.
See Also:
getNextResult()

setSequenceLengthNormalization

void setSequenceLengthNormalization(boolean norm)
Sets, whether the occurrences on the positive and negativ training set, respectively, are normalized by the sequence length of the set. That means, that befor calculating the score for one motif, the number of found occurrences on the positive training set is divided by the over-all-length of the sequences containing to that set. The same fits for the motif's occurrences on the sequences of the negative training set.

Parameters:
norm - true if normalization should be done, false otherwise.

getSequenceLengthNormalization

boolean getSequenceLengthNormalization()
Returns:
true, if normalization is wished, false otherwise.
See Also:
setSequenceLengthNormalization(boolean)

flag

boolean flag(int flags)
Using this method you can test various settings, whether they occured or not. This method test, whether at least one of the given flags is set, e.g. imagine FLAG_B is set, than the call ICommunicator.flag( FLAG_B | FLAG_M ) would return true.

Parameters:
flags - The flag or flags to be tested.
Returns:
true, if at least one flag is set, false otherwise.

setGraphicalOutput

void setGraphicalOutput(boolean graphout)

The graphical output is activated or deactivated. If it is activated, the result data are stored in several vectors, e.g. the one to hold score plot data can be obtained by calling getScorePlotVector.
What is stored in the respective vector relies on the methods of the operator filling it. Every call to this method sets back all vectors, either to the empty state, if the graphical output is activated or to null in case of deactivation.

Parameters:
graphout - If true, the graphical output will be activated, otherwise deactivated.
See Also:
getScorePlotVector(), getMotifOccurrenceVector()

getGraphicalOutput

boolean getGraphicalOutput()
Returns:
true if the graphical output is wished, false otherwise.
See Also:
setGraphicalOutput(boolean)

getScorePlotVector

java.util.Vector getScorePlotVector()

If the graphical output is activated, the operator stores information for the score plot in this vector. For every score on the sequence a Integer for the index and a Double for the score is stored. If the operator ends the scoring a -1 is stored.

Returns:
A Vector containing score plot data. Ends with a -1.
See Also:
setGraphicalOutput(boolean), ScoredSequenceStruct

getMotifOccurrenceVector

java.util.Vector getMotifOccurrenceVector()

If the graphical output is activated, the operator stores information of found motifs in this vector. For every motif found an Integer for the index of the motif in the motif list and an Integer for its position on the sequence (negativ for rev/comp) is stored.

Returns:
A Vector containing data about found motifs.
See Also:
setGraphicalOutput(boolean), FoundMotifStruct

allowRunning

void allowRunning()
Sets a flag that signals all running threads started by the operator that they are allowed to run.
This method is called by the operator before any thread for searching and scoring is started.


stopRunning

void stopRunning()
Sets a flag that signals all running threads started by the operator to stop as soon as possible.
When this method returns the affected threads might be still running for a while. So do not stop reading their output until the end-of-running (finishing) result was received.


isRunningAllowed

boolean isRunningAllowed()
Returns the flag for search and score threads of the operator whether they are allow to proceed or must stop on next occasion.

Returns:
true, if the threads are allowed to run, false if they must stop as soon as possible.

setOutputStream

void setOutputStream(java.io.PrintStream ps)
This method sets a PrintStream as new output stream. For common access to that stream use the method out(). If ps=null the NilOutputStream is set.

Parameters:
ps - The new stream for directing the output to it.
See Also:
out(), NilOutputStream

setErrorStream

void setErrorStream(java.io.PrintStream ps)
This method sets a PrintStream as new error message output stream. For common access to that stream use the method err(). If ps=null the NilOutputStream is set.

Parameters:
ps - The new stream for directing the output to it.
See Also:
err(), NilOutputStream

setVerboseStream

void setVerboseStream(java.io.PrintStream ps)
This method sets a PrintStream as new verbose message output stream. For common access to that stream use the method ver(). If ps=null the NilOutputStream is set.

Parameters:
ps - The new stream for directing the output to it.
See Also:
ver(), NilOutputStream

out

java.io.PrintStream out()
Returns the output stream to which normal output should be sent. If the output stream is not set, the default output stream is returned, which is System.out.

Returns:
The output stream all output should be directed to.
See Also:
setOutputStream(PrintStream)

err

java.io.PrintStream err()
Returns the output stream to which error messages should be sent. If the error stream is not set, this method returns the stream System.err as default.

Returns:
The output stream all error messages should be directed to.
See Also:
setErrorStream(PrintStream)

ver

java.io.PrintStream ver()
Returns the output stream to which verbose messages should be sent. Verbose messages are verifying texts which explain what the program is actually doing. If the verbose stream is not set, this method returns the stream NilOutputStream as default.

Returns:
The output stream all verbose messages should be directed to.
See Also:
setVerboseStream(PrintStream), NilOutputStream

rand

java.util.Random rand()
Returns the random number generator which is initialized when the communicator object was created.

Returns:
An instance of java.util.Random.

random

double random()
Returns a double random number generated with the intern random number generator. This method was introduced to reduce the method call overhead.

Returns:
The next pseudo random double.

setSeed

void setSeed(long seed)
Sets a new seed for the random number generator.

See Also:
Random

getSeed

long getSeed()
The seed, the random number generator was initialized with is returned.

Returns:
The previous set seed for random number generator.

outputForSearchMotifs

boolean outputForSearchMotifs(IOperator op,
                              boolean count)

Searches motifs on sequences and generates and prints the appropriate output. This method uses the given IOperator to start the searchMotifs(boolean)-method, which will get its necessary informations from the ICommunicator the given operator was created with and the parameter count.

The output created and send to comm.out() is the following. First all motif names are printed, followed by a line with '//'. Every next line holds one sequence name followed by the number of occurrences of each motif on that sequence. if count is true, then the sequence' name is printed and then for any sequence section the motif's name with its occurrences within this section.

At the beginning and at the end, some messages are created for the verbose stream comm.ver(). This messages contains the time this output method has waited for the thread to finish. Also an error message is sent to comm.err() if the thread could not be started.

Parameters:
op - The IOperator to start the method searchMotifs(boolean) from.
count - The method searchMotifs(boolean) get this value as parameter and it is also used to slightly change the output sent to comm.out().
Returns:
false if an error occured and no motifs were searched, true otherwise.
See Also:
IOperator.searchMotifs(boolean)

outputForWeightMotifs

boolean outputForWeightMotifs(IOperator op)

Weights motifs and generates and prints the appropriate output. This method uses the given IOperator to call the weightMotifs()-method, which will get its necessary informations from the ICommunicator the given operator was created with.

The output created and sent to comm.out() is the following. First two matrices are output, one for the positive training set named 'Raw model fingerprints' and one for the negative training set named 'Raw background fingerprints'. Every line (row) stands for a sequence from the corresponding training set. Within the rows the values (column) correspond with the motifs and give the occurrences. After both matrices a block named 'Scores:' follows holding within every line the motifs name and its calculated weight/score.

At the beginning and at the end, some messages are created for the verbose stream comm.ver(). This messages contains the time this output method has waited for the thread to finish. Also an error message is sent to comm.err() if the thread could not be started.

Parameters:
op - The IOperator to start the method weightMotifs() from.
Returns:
false if an error occured and no motif was weighted, true otherwise.
See Also:
IOperator.weightMotifs()

outputForScoreSequence

boolean outputForScoreSequence(IOperator op,
                               boolean best)

Scores sequences using weighted motifs and generates and prints the appropriate output. This method uses the given IOperator to start the scoreSequence()-method, which will get its necessary informations from the ICommunicator the given operator was created with.

For every sequence scored the sequence name in FASTA format is output. For the sequence window scores itself their are two possible output mechanisms. If a cutoff other than Double.NaN was set with the given ICommunicator, the scores are comprised to bands where each band is maximal in width, does not overlap with other bands and has scores above the cutoff. For each found band the output is sequenceCounter: start-end: maximumScore; minimumScore; meanScore, e.g. 0:700210-701040: 191.3644; 126.2205; 173.7372. If no cutoff was set in the given ICommunicator or if Double.NaN was set, each line of the output contains the middle position of a sequence window together with its score.

At the beginning and at the end, some messages are created for the verbose stream comm.ver(). This messages contains the time this output method has waited for the thread to finish. Also an error message is sent to comm.err() if the thread could not be started.

Parameters:
op - The IOperator to start the method weightMotifs() from.
best - If true, only the best score for every sequence is output. Cannot be mixed with a comprised output.
Returns:
false if an error occured and no sequence was scored, true otherwise.
See Also:
IOperator.scoreSequence()