util.classificationFeatures
Class ClassificationFeatureUtils

java.lang.Object
  extended by util.classificationFeatures.ClassificationFeatureUtils

public class ClassificationFeatureUtils
extends java.lang.Object

This class contains some different utility methods for feature extraction.

Author:
Michiel Van Bel

Nested Class Summary
static class ClassificationFeatureUtils.CLASSIFICATIONFEATURE_TYPES
           
 
Method Summary
static java.lang.String convertFullSecToReducedSec(java.lang.String t)
          Replace all ( and ) by | in the secondary structure string
static java.util.List<java.util.List<ValPosCombination>> divide(java.util.List<ClassificationFeature> cfList, java.util.List<ValPosCombination> vpcList)
           
static java.lang.String[] generateCompositionalTypes(int length)
          Recursively computes all possible n-nucleotides (with n being the length)
static java.lang.String[] generateFullSecStructCompositionalTypes(int length)
          Recursively computes all possible combinations of stems and loops of length n 3 possible characters : ( ) .
static java.lang.String[] generateGeneralCompositionalTypes(int length, char[] alphabet)
          Generates all possible combinations, according to the provided alphabet and the required length of the combinations.
static java.lang.String[] generateGeneralCompositionalTypes(int length, java.lang.String[] alphabet)
          Generates all possible combinations, according to the provided alphabet and the required length of the combinations.
static java.lang.String[] generateReducedCompositionalTypes(int length)
          Recusrively computes all possible n-nucleotides that are reduced to the set of purines and pyrimidines.
static java.lang.String[] generateReducedSecStructCompositionalTypes(int length)
          Recursively computes all possible combinations of stems and loops of length n 2 possible characters : | .
static int getMaximum(java.util.List<java.lang.Integer> list)
          Selects and returns te maximum value of integers in a list.
static void main(java.lang.String[] args)
           
static boolean mergeListFeatureVector(java.util.List<java.lang.Integer> list, int[] featureVec)
          Adds all items from the featurevector (represented by an array) to the list with items.
static ClassificationFeature parseFeatureFromString(java.lang.String s)
          This method creates a ClassificationFeature from a string, by using the java-reflection to locate the correct ClassificationFeature implementation.
static ClassificationFeature parseFeatureFromString(java.lang.String[] split)
           
static ClassificationFeature parseFeatureFromStringJar(java.lang.String[] split)
           
static ClassificationFeature parseFeatureFromStringNonJar(java.lang.String[] split)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

parseFeatureFromString

public static ClassificationFeature parseFeatureFromString(java.lang.String[] split)

parseFeatureFromStringJar

public static ClassificationFeature parseFeatureFromStringJar(java.lang.String[] split)

parseFeatureFromStringNonJar

public static ClassificationFeature parseFeatureFromStringNonJar(java.lang.String[] split)

parseFeatureFromString

public static ClassificationFeature parseFeatureFromString(java.lang.String s)
This method creates a ClassificationFeature from a string, by using the java-reflection to locate the correct ClassificationFeature implementation. This approach may not be the fastest, but it allows to dynamically add new ClassificationFeatures to the right directory without having to recompile other files (such as this ClassificationFeatureUtils - java file).

Parameters:
s - The String representation of the ClassificationFeature, as defined in a configuration file
Returns:
The correct ClassificationFeature if it could be located and loaded, null otherwise.

divide

public static java.util.List<java.util.List<ValPosCombination>> divide(java.util.List<ClassificationFeature> cfList,
                                                                       java.util.List<ValPosCombination> vpcList)

getMaximum

public static int getMaximum(java.util.List<java.lang.Integer> list)
Selects and returns te maximum value of integers in a list. If the item is smaller then 0, then 0 is returned.

Parameters:
list - The list with integer data
Returns:
The maximum value

generateCompositionalTypes

public static java.lang.String[] generateCompositionalTypes(int length)
Recursively computes all possible n-nucleotides (with n being the length)

Parameters:
length - The length of the nucleotides
Returns:
The array with all possible combinations

generateGeneralCompositionalTypes

public static java.lang.String[] generateGeneralCompositionalTypes(int length,
                                                                   char[] alphabet)
Generates all possible combinations, according to the provided alphabet and the required length of the combinations.

Parameters:
length - The length of the combinations
alphabet - The alphabet used to produce the combinations
Returns:
The list of possible combinations

generateGeneralCompositionalTypes

public static java.lang.String[] generateGeneralCompositionalTypes(int length,
                                                                   java.lang.String[] alphabet)
Generates all possible combinations, according to the provided alphabet and the required length of the combinations.

Parameters:
length - The length of the combinations
alphabet - The alphabet used to produce the combinations
Returns:
The list of possible combinations

generateReducedCompositionalTypes

public static java.lang.String[] generateReducedCompositionalTypes(int length)
Recusrively computes all possible n-nucleotides that are reduced to the set of purines and pyrimidines.

Parameters:
length - The length of the combinations
Returns:
The array with all possible combinations

generateFullSecStructCompositionalTypes

public static java.lang.String[] generateFullSecStructCompositionalTypes(int length)
Recursively computes all possible combinations of stems and loops of length n 3 possible characters : ( ) .

Parameters:
length - The length of the combinations
Returns:
The array with all the possible combinations

generateReducedSecStructCompositionalTypes

public static java.lang.String[] generateReducedSecStructCompositionalTypes(int length)
Recursively computes all possible combinations of stems and loops of length n 2 possible characters : | .

Parameters:
length - The length of the combinations
Returns:
The array with all the possible combinations

convertFullSecToReducedSec

public static java.lang.String convertFullSecToReducedSec(java.lang.String t)
Replace all ( and ) by | in the secondary structure string

Parameters:
t - original string
Returns:
The reformed string

mergeListFeatureVector

public static boolean mergeListFeatureVector(java.util.List<java.lang.Integer> list,
                                             int[] featureVec)
Adds all items from the featurevector (represented by an array) to the list with items.

Parameters:
list - The existing list
featureVec - The featurevector
Returns:
The boolean value indicates whether or not the merge did go flawless.

main

public static void main(java.lang.String[] args)