util.classificationFeatures.implementations
Class BranchpointClassificationFeature

java.lang.Object
  extended by util.classificationFeatures.implementations.BranchpointClassificationFeature
All Implemented Interfaces:
java.lang.Cloneable, ClassificationFeature

public class BranchpointClassificationFeature
extends java.lang.Object
implements ClassificationFeature


Field Summary
static double[][] BASEPAIRMATRIX
          A basepairmatrix, which describes the binding force between different nucleotides.
 
Fields inherited from interface util.classificationFeatures.ClassificationFeature
ERROR_STRING
 
Constructor Summary
BranchpointClassificationFeature()
           
 
Method Summary
 int countInterAg(java.lang.String sequence, int start, int stop)
          Finds the number of other possible acceptorsites ("AG") between two locations (mostly used between a branchpoint and an acceptorsite)
 int countPyrimidines(java.lang.String sequence, int start, int stop)
          Counts the number of pyrimidines between the possible splicesite and the possible acceptorsite
 java.util.List<java.lang.Double> extractFeatures(java.lang.String[] sequences, int splicesite, java.lang.String[] types, java.util.List<Conversion> conversions, java.lang.String[] conversion_sequences)
          This method extracts the features from a sequence (relative to the splicesite) and returns those features in a list of double-values (standardized on double values because of its generic but still small-sized nature).
 double[] getBasePairScore(java.lang.String sequence, int location, char[] u2RNA, int loc_dash)
          Computes basepairscores for possible branchpoints
 int getBPVal(char c)
          Returns the place wihtin the basepairbinding matrix for a nucleotide
 ClassificationFeatureDrawing getClassificationFeatureDrawing()
          Because all classificationfeatures need different algorithms to draw them, according to the specifications, these utilities are also moved to the implementations of the ClassificationFeatures.
 Conversion getConversion()
          This method asks the classificationfeature for its conversion-type.
 int getLength()
          This method returns the length of the feature.
 AttributeDescription getLocationDescription(int loc)
          Returns a standardized description of the location that is indicated.
 int getMaximum_upstream()
           
 int getMinimum_upstream()
           
 int getNumberOfAttributes()
          Returns the number of attributes that are created by this classificationfeature, according to the internal parameters (e.g. up- and downstreamranges).
 int[] getUpDownRanges()
          This method asks for the up- and downstreamranges of the feature
 ClassificationFeature make_copy()
          Makes a copy of this particular classificationfeature.
 boolean needCompositionalTypes()
          Asks whether the computer needs to precompute compositional types.
 java.lang.String reverseString(java.lang.String string)
          reverses the U2RNA string
 void setParameters(java.lang.String[] args)
          This method sets the necessary parameters for the classificationfeature.
 void setUpDownRanges(int up, int down)
          This method sets the new upstream and downstream ranges
 java.lang.String toNoRangeString()
          String representation of the classificationFeature that contains the core elements, and discards the upstream/downstream range elements.
 java.lang.String toString()
          String representation of the classificationFeature
 java.lang.String toStringUnderscore()
          Returns the string representation of the classificationfeature, but with all possible spaces and tabs replaced by underscores.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

BASEPAIRMATRIX

public static final double[][] BASEPAIRMATRIX
A basepairmatrix, which describes the binding force between different nucleotides. Order is : A-C-G-T/U in both horizontal and vertical order

Constructor Detail

BranchpointClassificationFeature

public BranchpointClassificationFeature()
Method Detail

getUpDownRanges

public int[] getUpDownRanges()
This method asks for the up- and downstreamranges of the feature

Specified by:
getUpDownRanges in interface ClassificationFeature
Returns:
The up/down ranges

getConversion

public Conversion getConversion()
This method asks the classificationfeature for its conversion-type.

Specified by:
getConversion in interface ClassificationFeature
Returns:
The used conversion type. Null of not appropriate.

setUpDownRanges

public void setUpDownRanges(int up,
                            int down)
This method sets the new upstream and downstream ranges

Specified by:
setUpDownRanges in interface ClassificationFeature
Parameters:
up - The new upstream range
down - The new downstream range

needCompositionalTypes

public boolean needCompositionalTypes()
Asks whether the computer needs to precompute compositional types. When a conversion is taken with a large alphabet and/or a large length, this computation can take WAAAY to long (and take too much memory as well). Therefore, prior to this operation, this flag should be checked.

Specified by:
needCompositionalTypes in interface ClassificationFeature
Returns:
Whether or not to supply compositional types of certain length.

extractFeatures

public java.util.List<java.lang.Double> extractFeatures(java.lang.String[] sequences,
                                                        int splicesite,
                                                        java.lang.String[] types,
                                                        java.util.List<Conversion> conversions,
                                                        java.lang.String[] conversion_sequences)
                                                 throws FeatureExtractionException
This method extracts the features from a sequence (relative to the splicesite) and returns those features in a list of double-values (standardized on double values because of its generic but still small-sized nature).

Specified by:
extractFeatures in interface ClassificationFeature
Parameters:
sequences - The sequence from which the features should be extracted.
splicesite - The location of the splicesite (pseudo or real)
types - The compositional types (if requested, otherwise null).
conversions - A list with all the conversion types
conversion_sequences - An array with all the converted sequences.
Returns:
A list with the features
Throws:
FeatureExtractionException - Thrown when something goes wrong when extracting the features.

countInterAg

public int countInterAg(java.lang.String sequence,
                        int start,
                        int stop)
Finds the number of other possible acceptorsites ("AG") between two locations (mostly used between a branchpoint and an acceptorsite)

Parameters:
sequence - The sequence in which the number of AG's should be counted
start - The starting point in the sequence
stop - The stop point in the sequence
Returns:
The number of AG's between 2 sites.

countPyrimidines

public int countPyrimidines(java.lang.String sequence,
                            int start,
                            int stop)
Counts the number of pyrimidines between the possible splicesite and the possible acceptorsite

Parameters:
sequence - The sequence in which the pyrimidines should be counted
start - startlocation from which to start counting
stop - Stoplocation from which to stop counting
Returns:
The number of pyrimidines in the sequence between a start and stop point.

getBPVal

public int getBPVal(char c)
Returns the place wihtin the basepairbinding matrix for a nucleotide

Parameters:
c - The nucleotide
Returns:
The place within matrix BASEPAIRMATRIX

getBasePairScore

public double[] getBasePairScore(java.lang.String sequence,
                                 int location,
                                 char[] u2RNA,
                                 int loc_dash)
Computes basepairscores for possible branchpoints

Parameters:
sequence - The sequence
location - Location of the possible branchpoint
u2RNA - The U2RNA sequence
loc_dash - The location of the binding-nucleotide within the u2RNA sequence
Returns:
An array which contains at its first position a summation score, and at its second position a multiplication score.

reverseString

public java.lang.String reverseString(java.lang.String string)
reverses the U2RNA string

Parameters:
string - Original U2RNA sequence
Returns:
Reversed U2RNA sequence

toStringUnderscore

public java.lang.String toStringUnderscore()
Returns the string representation of the classificationfeature, but with all possible spaces and tabs replaced by underscores.

Specified by:
toStringUnderscore in interface ClassificationFeature
Returns:
Alternative string representation

toString

public java.lang.String toString()
String representation of the classificationFeature

Specified by:
toString in interface ClassificationFeature
Overrides:
toString in class java.lang.Object
Returns:
String representation of the classificationfeature

toNoRangeString

public java.lang.String toNoRangeString()
String representation of the classificationFeature that contains the core elements, and discards the upstream/downstream range elements.

Specified by:
toNoRangeString in interface ClassificationFeature
Returns:
Shortened version of the string representation of the classificationfeature

getNumberOfAttributes

public int getNumberOfAttributes()
Returns the number of attributes that are created by this classificationfeature, according to the internal parameters (e.g. up- and downstreamranges). When the internal parameters are not set, or they are in an incorrect state, this method will return -1 as value

Specified by:
getNumberOfAttributes in interface ClassificationFeature
Returns:
The number of attributes created by this classificationfeature

getLocationDescription

public AttributeDescription getLocationDescription(int loc)
Returns a standardized description of the location that is indicated. e.g. 5 bp upstream of splicesite. In case the location is outside the range of the feature, an error string is returned.

Specified by:
getLocationDescription in interface ClassificationFeature
Parameters:
loc - The location
Returns:
The description

setParameters

public void setParameters(java.lang.String[] args)
                   throws IncorrectClassificationFeatureException
This method sets the necessary parameters for the classificationfeature. The parameters are all generically passed as an array of strings, which of course need to be decoded by the classificationfeature itself.

Specified by:
setParameters in interface ClassificationFeature
Parameters:
args - The array with the parameters in string format
Throws:
IncorrectClassificationFeatureException - Can be thrown when the parameters are incorrect (outside possible ranges) and/or the parameters could not be parsed.

getClassificationFeatureDrawing

public ClassificationFeatureDrawing getClassificationFeatureDrawing()
Because all classificationfeatures need different algorithms to draw them, according to the specifications, these utilities are also moved to the implementations of the ClassificationFeatures. However, as not to clutter them, we have chosen to place this data in a seperate interface. The programmer thus has a choice of using one or two classes to implement both interfaces.

Specified by:
getClassificationFeatureDrawing in interface ClassificationFeature
Returns:
The object which can draw the classification features.

getMaximum_upstream

public int getMaximum_upstream()

getMinimum_upstream

public int getMinimum_upstream()

getLength

public int getLength()
Description copied from interface: ClassificationFeature
This method returns the length of the feature. If not applicable, (such as in case of branchpointfeatures), return 0;

Specified by:
getLength in interface ClassificationFeature
Returns:
length of the feature

make_copy

public ClassificationFeature make_copy()
Makes a copy of this particular classificationfeature. The cloneable interface cannot be used directly because it is only applicable on classes, not interfaces.

Specified by:
make_copy in interface ClassificationFeature
Returns:
A copy of the classificationfeature