util
Class Util

java.lang.Object
  extended by util.Util

public class Util
extends java.lang.Object

Class with different methods for organizing, re-organizing, extracting and normalizing data from standard datastructures used in the FunSiP program package.

Author:
Michiel Van Bel

Constructor Summary
Util()
           
 
Method Summary
static void doubleSort(double[] toSortList, double[] followList)
          Bubblesort algorithm which sorts one list, and sorts (changing of indices) another list in exactly the same way.
static java.util.List<java.lang.String> extractFromMap(java.util.Map<java.lang.String,?> map)
          Extracts a list of strings from the values of a map, but it keeps the normal alphabetical order between the keys of the map.
static java.util.List<java.lang.String> mergeUpDownInt(java.util.List<java.lang.Integer> upData, java.util.List<java.lang.Integer> downData)
          Merges 2 lists of integer data to one list of string data.
static java.util.Map<java.lang.String,java.lang.Double> normalize(java.util.Map<java.lang.String,java.lang.Integer> map, int max)
          Normalizes the values of a map to the interval [0,1].
static java.lang.String toForwardStrand(java.lang.String sequence)
          This method changes the strand of a sequence by both replacing the nucleotides by their complements and by inversing the order of the sequence.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Util

public Util()
Method Detail

doubleSort

public static void doubleSort(double[] toSortList,
                              double[] followList)
Bubblesort algorithm which sorts one list, and sorts (changing of indices) another list in exactly the same way.

Parameters:
toSortList - original list to be sorted.
followList - The list which will be sorted by the same indices of toSortList.

normalize

public static java.util.Map<java.lang.String,java.lang.Double> normalize(java.util.Map<java.lang.String,java.lang.Integer> map,
                                                                         int max)
Normalizes the values of a map to the interval [0,1]. It is assumed that the values in the original map are all positive, and that the given max value is indeed the maximum.

Parameters:
map - The map with data to be normalized. Strings are the keys, ints are the values
max - The maximum int value in the map
Returns:
A map with normalized data, String are the keys and doubles are the values

mergeUpDownInt

public static java.util.List<java.lang.String> mergeUpDownInt(java.util.List<java.lang.Integer> upData,
                                                              java.util.List<java.lang.Integer> downData)
Merges 2 lists of integer data to one list of string data.

Parameters:
upData - The data from upstream the splicesite
downData - The data from downstream the splicesite
Returns:
A merged datalist

toForwardStrand

public static java.lang.String toForwardStrand(java.lang.String sequence)
This method changes the strand of a sequence by both replacing the nucleotides by their complements and by inversing the order of the sequence.

Parameters:
sequence - The original (most likely reverse strand) sequence
Returns:
The new sequence on the (most likely forward) other strand

extractFromMap

public static java.util.List<java.lang.String> extractFromMap(java.util.Map<java.lang.String,?> map)
Extracts a list of strings from the values of a map, but it keeps the normal alphabetical order between the keys of the map.

Parameters:
map - The map, with strings as keys and ints as values
Returns:
A list with the keys from the map being represented by strings