halo.tools
Class Tools

java.lang.Object
  extended by halo.tools.Tools

public class Tools
extends java.lang.Object

Class containing several tools used for HALO analyses

Author:
Stefanie Kaufmann

Field Summary
static java.lang.String HOMEPAGE
           
static java.lang.String HOMEPAGEDOC
           
static java.lang.String LIBRARYNAME
           
static java.lang.String VERSION
           
 
Constructor Summary
Tools()
           
 
Method Summary
static double calculateMedianForHalfLives(double time, Data data)
          Calculates the average median over two available half-life calculation methods
static java.util.ArrayList<java.lang.String> getColumnLabels(java.io.File file)
          Reads the header/description line of a given file and provides all column labels (columns separated by tabulator) as a list
static boolean hasLineColumns(java.lang.String line, int columns)
          Checks whether a line consists of at least the given number of columns, whereas columns are separated through any whitespace sign
static boolean isLineValid(java.lang.String line)
          Tests if a given line is composed of the letters a-z (case ignored), numbers or whitespace symbols like TAB
static boolean testValidityForFile(java.io.File file, int columns, boolean permitUnusualLetters)
          Tests the correctness of a given file according to format (= minimal number of columns has to be correct) and letters (= are there any unusual letters present?)
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LIBRARYNAME

public static final java.lang.String LIBRARYNAME
See Also:
Constant Field Values

VERSION

public static final java.lang.String VERSION
See Also:
Constant Field Values

HOMEPAGE

public static final java.lang.String HOMEPAGE
See Also:
Constant Field Values

HOMEPAGEDOC

public static final java.lang.String HOMEPAGEDOC
See Also:
Constant Field Values
Constructor Detail

Tools

public Tools()
Method Detail

getColumnLabels

public static java.util.ArrayList<java.lang.String> getColumnLabels(java.io.File file)
Reads the header/description line of a given file and provides all column labels (columns separated by tabulator) as a list

Parameters:
file - The file containing the expression data
Returns:
A list containing all column labels

isLineValid

public static boolean isLineValid(java.lang.String line)
Tests if a given line is composed of the letters a-z (case ignored), numbers or whitespace symbols like TAB

Parameters:
line - The line that will be tested
Returns:
TRUE if the line is valid, FALSE otherwise

hasLineColumns

public static boolean hasLineColumns(java.lang.String line,
                                     int columns)
Checks whether a line consists of at least the given number of columns, whereas columns are separated through any whitespace sign

Parameters:
line - The line that will be checked for validity
columns - The minimal number of columns that has to be in this line
Returns:
TRUE if the line consists of this many columns or more

testValidityForFile

public static boolean testValidityForFile(java.io.File file,
                                          int columns,
                                          boolean permitUnusualLetters)
Tests the correctness of a given file according to format (= minimal number of columns has to be correct) and letters (= are there any unusual letters present?) according to the first line after the commentary

Parameters:
file - The input file that will be tested
columns - The minimal number of columns that has to be present in the file
Returns:
TRUE if the file is valid

calculateMedianForHalfLives

public static double calculateMedianForHalfLives(double time,
                                                 Data data)
Calculates the average median over two available half-life calculation methods

Parameters:
time - The labeling time for the calculations
data - The data
Returns:
The average median