de.unibi.techfak.jpredictor.motifs
Class SequenceMotif

java.lang.Object
  extended by de.unibi.techfak.jpredictor.motifs.MotifSearchAdapter
      extended by de.unibi.techfak.jpredictor.motifs.Motif
          extended by de.unibi.techfak.jpredictor.motifs.RegularExpressionMotif
              extended by de.unibi.techfak.jpredictor.motifs.SequenceMotif
All Implemented Interfaces:
MotifSearcher, MotifSearchWithError, SequenceWindowScorer, Markable, java.lang.Cloneable, java.lang.Comparable

public class SequenceMotif
extends RegularExpressionMotif

Specialization of a RegularExpressionMotif. Contains a single sequence as motif, that is given as a string, e.g. "CCAT". No degenerated code is allowed to be used.


Nested Class Summary
 
Nested classes/interfaces inherited from class de.unibi.techfak.jpredictor.motifs.MotifSearchAdapter
MotifSearchAdapter.SearchFields
 
Field Summary
 
Fields inherited from class de.unibi.techfak.jpredictor.motifs.RegularExpressionMotif
motif
 
Fields inherited from class de.unibi.techfak.jpredictor.motifs.Motif
DNA_DEGENERATED_CODE, DNA_DEGENERATED_CODE_JOINING, MARK_USABLE
 
Fields inherited from class de.unibi.techfak.jpredictor.motifs.MotifSearchAdapter
searchFields
 
Fields inherited from interface de.unibi.techfak.jpredictor.motifs.MotifSearcher
SEARCH_ALL_ORIENTATIONS, SEARCH_DIRECTION_MAX, SEARCH_DIRECTION_MINUS, SEARCH_DIRECTION_PLUS
 
Fields inherited from interface de.unibi.techfak.misc.Markable
MARK_BASIC, MARK_DELETED, MARK_EXP, MARK_MOVED, MARK_REPLACED, MARK_SELECTED, MARK_TOBEDELETED, MARK_TOBEMOVED, MARK_TOBEREPLACED
 
Constructor Summary
SequenceMotif()
          Inits all values and strings with null.
SequenceMotif(java.lang.String name, java.lang.String description, java.lang.String motif, int errorNumberAllowedForMatch)
          Sets all the motif's characteristics.
 
Method Summary
 java.lang.Object clone()
           Clones the motif by creating the same motif again and copying all importent fields.
 Motif createReversedComplement()
          Creates the reversed complementary motif.
 java.lang.String getConsensusSequence()
          Calculates the consensus sequence from the motif, replaces the degenerated letter-representations of DNA with the base letters in the order A,C,G,T.
protected  boolean match(char sequ, char reg)
          Matches two chars.
 void setMotif(java.lang.String motif)
          Sets the motif from a given String.
 
Methods inherited from class de.unibi.techfak.jpredictor.motifs.RegularExpressionMotif
compareTo, createConsensusFromMotifBlock, getErrorNumberAllowedForMatch, getRegularExpression, getRegularExpressionChar, length, matchComplement, print, readMotifBlockFromFile, search, setErrorNumberAllowedForMatch
 
Methods inherited from class de.unibi.techfak.jpredictor.motifs.Motif
clearMark, clearMark, equals, getDescription, getMark, getName, getWeight, isMarked, isMarked, print, scoreSequenceWindow, setDescription, setMark, setName, setWeight, toString
 
Methods inherited from class de.unibi.techfak.jpredictor.motifs.MotifSearchAdapter
getSearchMode, initSearch, searchAll, setSearchMode
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface de.unibi.techfak.jpredictor.motifs.MotifSearcher
getSearchMode, initSearch, searchAll, setSearchMode
 

Constructor Detail

SequenceMotif

public SequenceMotif()
Inits all values and strings with null.


SequenceMotif

public SequenceMotif(java.lang.String name,
                     java.lang.String description,
                     java.lang.String motif,
                     int errorNumberAllowedForMatch)
Sets all the motif's characteristics. The motif is marked not usable (this mark has nothing to do with being incomplete or so but tells the program to not use this motif for operations until otherwise stated).

Parameters:
name - The name of the motif.
description - A short description of the motif.
motif - The motif itself as a short sequence.
errorNumberAllowedForMatch - The number of mismatch errors allowed for a perfect match.
Method Detail

setMotif

public void setMotif(java.lang.String motif)
Sets the motif from a given String. The motif is filtered to represent only valid DNA- or RNA-sequences, respectivly.

Overrides:
setMotif in class RegularExpressionMotif
Parameters:
motif - The motifs representation as RNA,DNA-String.
See Also:
MotifFilter.DNA_RNA_FILTER

getConsensusSequence

public java.lang.String getConsensusSequence()
Description copied from class: RegularExpressionMotif
Calculates the consensus sequence from the motif, replaces the degenerated letter-representations of DNA with the base letters in the order A,C,G,T. So a Y is always replaced with a C, and an N always with an A.

Overrides:
getConsensusSequence in class RegularExpressionMotif
Returns:
the motif as it is.
See Also:
Motif.getConsensusSequence()

match

protected boolean match(char sequ,
                        char reg)
Matches two chars.

Overrides:
match in class RegularExpressionMotif
Parameters:
sequ - The char from the sequence.
reg - The char from the motif.
Returns:
true iff the chars are equal, false otherwise

createReversedComplement

public Motif createReversedComplement()
Description copied from class: Motif
Creates the reversed complementary motif.

Overrides:
createReversedComplement in class RegularExpressionMotif
Returns:
The reversed and complemented motif.

clone

public java.lang.Object clone()
Description copied from class: Motif

Clones the motif by creating the same motif again and copying all importent fields. The result is at least of class Motif. When cloning a MultiMotif the referred single motifs are not cloned.

The fields that are copied are: Name, Description, the Motif itself, errorNumberAllowedForMatch or Threshold, respectively, Weight and searchMode (altogether 6 fields by now). What is not copied are the fields of the MotifSearchAdapter.

Note, that any matrices are not cloned. Thus, if cloning a PSPMotif or a PSSMotif the cloned motif does contain a reference to the matrix of the old motif. This was done to preserve memory.

Overrides:
clone in class RegularExpressionMotif
Returns:
The Motif itself as a doubled copy.
See Also:
Object.clone()