contextFold.rnaFolding
Class StructureRecognizerImpl

java.lang.Object
  extended by contextFold.rnaFolding.StructureRecognizerImpl
All Implemented Interfaces:
StructureRecognizer, java.io.Serializable

public class StructureRecognizerImpl
extends java.lang.Object
implements StructureRecognizer

This class defines the structural elements which are considered by the Folder class.

Base-pairs elements:

--------------------

Base-pair elements are oriented and are considered with respect to the loop they terminate. Each base-pair (i,j) induces two "loop termination" elements: one for the loop it "closes" (including i+1 and j-1), and one for the loop it "opens" (including i-1 and j+1). In addition, there are specific base-pair elements for short hairpin, internal, and bulge loops (each short loop length induces its unique element).

Loop types: hairpin (HP), stem, internal loop (IL), left bulge (LB), right bulge (RB), multi-loop (ML), external loop (XL).

Unpaired base elements:

-----------------------

Every unpaired base induces an element which depends in the loop within it is enclosed. These elements allow linear score expressions with respect to loop lengths.

Base types: HP_BASE, IL_BASE, ML_BASE, BLG_BASE, XI_BASE_5 (a base in an external interval at the 5` end of the string), XI_BASE_3 (the same, at the 3` end of the string), and XI_BASE_MID (the same, but neither at the 5` nor 3` end).

Length elements:

----------------

Loops and external intervals induce length elements. The score of such elements is usually a correction to the linear score which is obtained by the unpaired bases. For bulges and internal loops, length elements are only induced by medium length loops, where for longer loops the score is linear with respect to the length (for multi-loop, the score is always linear).

Length element types: HP_LENGTH, IL_LENGTH (the summation of lengths of both unpaired regions of the loop), IL_ASYM (the absolute difference between the lengths of the two unpaired regions), BLG_LENGTH, XI_LENGTH_5 (XI = external interval), XI_LENGTH_3, XI_LENGTH_MID.

See Also:
Serialized Form

Field Summary
 int BASE_TYPES_NUM
           
 int FIRST_BASE_TYPE
           
 int FIRST_LENGTH_TYPE
           
 int FIRST_LOOP_TERMINATION_TYPE
           
 int HP_BASE
           
 int[] HP_CLOSE
           
 int HP_LENGTH
           
 int HP_MAX_IX
           
 int[][] IL_BASE
           
 int[][] IL_CLOSE
           
 int[] IL_LONG
           
 int IL_MAX_IX
           
 int[] IL_MEDIUM
           
 int[] IL_MEDIUM_LENGTH
           
 int IL_MEDIUM_MAX_TOTAL_LENGTH
           
 int[][] IL_OPEN
           
 int IL_SHORT_MAX_IX
           
 int LAST_BASE_TYPE
           
 int LAST_LENGTH_TYPE
           
 int LAST_LOOP_TERMINATION_TYPE
           
 int LENGTH_TYPES_NUM
           
 int LOOP_TERMINATION_TYPES_NUM
           
 int ML_BASE
           
 int ML_CLOSE
           
 int ML_OPEN
           
 int XI_BASE_3
           
 int XI_BASE_5
           
 int XI_BASE_MID
           
 int XI_LENGTH_3
           
 int XI_LENGTH_5
           
 int XI_LENGTH_MID
           
 int XL_OPEN
           
 
Fields inherited from interface contextFold.rnaFolding.StructureRecognizer
MIN_HAIRPIN_LENGTH, UNPAIRED_BASE
 
Constructor Summary
StructureRecognizerImpl()
           
StructureRecognizerImpl(int hpShortMaxLength, int[] ilLong, int[] ilMedium)
           
 
Method Summary
 java.lang.String elementsString(int[] fold)
           
 java.lang.String elementToString(int[] element)
           
 java.util.Collection<int[]> getCombinedElements(int[] fold)
           
 java.lang.String getElementName(int elementType)
           
 int getFirstBasepairType()
           
 int getFirstBaseType()
           
 int getFirstLengthType()
           
 int getLastBasepairType()
           
 int getLastBaseType()
           
 int getLastLengthType()
           
 boolean isBasepairType(int type)
           
 boolean isBaseType(int type)
           
 boolean isLengthType(int type)
           
 int numTypes()
           
 void sortElements(java.util.List<int[]> elements)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FIRST_BASE_TYPE

public final int FIRST_BASE_TYPE

LAST_BASE_TYPE

public final int LAST_BASE_TYPE

BASE_TYPES_NUM

public final int BASE_TYPES_NUM

HP_BASE

public final int HP_BASE

IL_BASE

public final int[][] IL_BASE

ML_BASE

public final int ML_BASE

XI_BASE_5

public final int XI_BASE_5

XI_BASE_3

public final int XI_BASE_3

XI_BASE_MID

public final int XI_BASE_MID

IL_MEDIUM

public final int[] IL_MEDIUM

IL_LONG

public final int[] IL_LONG

IL_MEDIUM_MAX_TOTAL_LENGTH

public final int IL_MEDIUM_MAX_TOTAL_LENGTH

FIRST_LOOP_TERMINATION_TYPE

public final int FIRST_LOOP_TERMINATION_TYPE

LAST_LOOP_TERMINATION_TYPE

public final int LAST_LOOP_TERMINATION_TYPE

LOOP_TERMINATION_TYPES_NUM

public final int LOOP_TERMINATION_TYPES_NUM

HP_CLOSE

public final int[] HP_CLOSE

IL_CLOSE

public final int[][] IL_CLOSE

IL_OPEN

public final int[][] IL_OPEN

ML_CLOSE

public final int ML_CLOSE

ML_OPEN

public final int ML_OPEN

XL_OPEN

public final int XL_OPEN

HP_MAX_IX

public final int HP_MAX_IX

IL_SHORT_MAX_IX

public final int IL_SHORT_MAX_IX

IL_MAX_IX

public final int IL_MAX_IX

FIRST_LENGTH_TYPE

public final int FIRST_LENGTH_TYPE

LAST_LENGTH_TYPE

public final int LAST_LENGTH_TYPE

LENGTH_TYPES_NUM

public final int LENGTH_TYPES_NUM

HP_LENGTH

public final int HP_LENGTH

IL_MEDIUM_LENGTH

public final int[] IL_MEDIUM_LENGTH

XI_LENGTH_5

public final int XI_LENGTH_5

XI_LENGTH_3

public final int XI_LENGTH_3

XI_LENGTH_MID

public final int XI_LENGTH_MID
Constructor Detail

StructureRecognizerImpl

public StructureRecognizerImpl(int hpShortMaxLength,
                               int[] ilLong,
                               int[] ilMedium)

StructureRecognizerImpl

public StructureRecognizerImpl()
Method Detail

numTypes

public int numTypes()
Specified by:
numTypes in interface StructureRecognizer

getCombinedElements

public java.util.Collection<int[]> getCombinedElements(int[] fold)
Specified by:
getCombinedElements in interface StructureRecognizer

isBaseType

public boolean isBaseType(int type)
Specified by:
isBaseType in interface StructureRecognizer

isBasepairType

public boolean isBasepairType(int type)
Specified by:
isBasepairType in interface StructureRecognizer

isLengthType

public boolean isLengthType(int type)
Specified by:
isLengthType in interface StructureRecognizer

getFirstBaseType

public int getFirstBaseType()
Specified by:
getFirstBaseType in interface StructureRecognizer

getLastBaseType

public int getLastBaseType()
Specified by:
getLastBaseType in interface StructureRecognizer

getFirstBasepairType

public int getFirstBasepairType()
Specified by:
getFirstBasepairType in interface StructureRecognizer

getLastBasepairType

public int getLastBasepairType()
Specified by:
getLastBasepairType in interface StructureRecognizer

getFirstLengthType

public int getFirstLengthType()
Specified by:
getFirstLengthType in interface StructureRecognizer

getLastLengthType

public int getLastLengthType()
Specified by:
getLastLengthType in interface StructureRecognizer

getElementName

public java.lang.String getElementName(int elementType)
Specified by:
getElementName in interface StructureRecognizer

sortElements

public void sortElements(java.util.List<int[]> elements)
Specified by:
sortElements in interface StructureRecognizer

elementToString

public java.lang.String elementToString(int[] element)
Specified by:
elementToString in interface StructureRecognizer

elementsString

public java.lang.String elementsString(int[] fold)