util.classificationFeatures
Interface ClassificationFeature

All Superinterfaces:
java.lang.Cloneable
All Known Subinterfaces:
SeconderyStructureClassificationFeature
All Known Implementing Classes:
BranchpointClassificationFeature, CompositionalClassificationFeature, CompositionalGeneralClassificationFeature, CompositionalSecondaryStructureClassificationFeature, DeterminantClassificationFeature, GcContentClassificationFeature, HydrophilicClassificationFeature, IntronRetention1ClassificationFeature, IntronRetention2ClassificationFeature, IntronRetentionCompareClassificationFeature, NearestEqualClassificationFeature, NearSecondaryStructureClassificationFeature, NonBindingClassificationFeature, PentaClassificationFeature, PhysicalPropertiesClassificationFeature, PositionalClassificationFeature, PositionalGeneralClassificationFeature, PositionalSecondaryStructureClassificationFeature, RF2ClassificationFeature, RFClassificationFeature, SecStructEvalClassificationFeature, SecStructSimpleClassificationFeature, TestNucleotideDistanceClassificationFeature, TetraHedronClassificationFeature, VarianceClassificationFeature, WaveContentClassificationFeature

public interface ClassificationFeature
extends java.lang.Cloneable

This interface contains all methods that a classification feature should implement to be fully functional. While it is possible that some of these methods do not explicitly need to be implemented (as they are not currently used within the project), it is advised to follow the standard procedure of implementing all the methods.

Author:
Michiel Van Bel

Field Summary
static java.lang.String ERROR_STRING
           
 
Method Summary
 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).
 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 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.
 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.
 

Field Detail

ERROR_STRING

static final java.lang.String ERROR_STRING
See Also:
Constant Field Values
Method Detail

needCompositionalTypes

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.

Returns:
Whether or not to supply compositional types of certain length.

getConversion

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

Returns:
The used conversion type. Null of not appropriate.

make_copy

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.

Returns:
A copy of the classificationfeature

extractFeatures

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).

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.

toStringUnderscore

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

Returns:
Alternative string representation

toString

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

Overrides:
toString in class java.lang.Object
Returns:
String representation of the classificationfeature

toNoRangeString

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

Returns:
Shortened version of the string representation of the classificationfeature

getNumberOfAttributes

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

Returns:
The number of attributes created by this classificationfeature

setParameters

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.

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

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.

Returns:
The object which can draw the classification features.

getUpDownRanges

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

Returns:
The up/down ranges

setUpDownRanges

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

Parameters:
up - The new upstream range
down - The new downstream range

getLength

int getLength()
This method returns the length of the feature. If not applicable, (such as in case of branchpointfeatures), return 0;

Returns:
length of the feature

getLocationDescription

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.

Parameters:
loc - The location
Returns:
The description