ee.ut.ga.util
Class DataLoaderUtil

java.lang.Object
  extended byee.ut.ga.util.DataLoaderUtil

public class DataLoaderUtil
extends java.lang.Object


Field Summary
static org.apache.log4j.Logger log
           
 
Constructor Summary
DataLoaderUtil()
           
 
Method Summary
static java.util.Map loadData(java.lang.String pathToFile)
          Loads data from file.
static java.util.List loadInitialPopulation(java.lang.String pathToFile, java.util.Map priors)
          Loads PAMs from file.
static void writeResult(java.lang.String result, java.lang.String path, boolean appendToFile)
          Writes into given file specified results.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

public static org.apache.log4j.Logger log
Constructor Detail

DataLoaderUtil

public DataLoaderUtil()
Method Detail

loadData

public static java.util.Map loadData(java.lang.String pathToFile)
                              throws java.lang.Exception
Loads data from file. Keeps Map of row number in data and DNA sequence. Reads as data all lines that only consist of letters A,T,G and C. All other lines are ignored.

Returns:
Map of (Long, String)
Throws:
java.lang.Exception

loadInitialPopulation

public static java.util.List loadInitialPopulation(java.lang.String pathToFile,
                                                   java.util.Map priors)
                                            throws java.lang.Exception
Loads PAMs from file. Used as initial population. Reads pwm-props exactly after line '>pwm-props' and pam exactly after line '>pam'. Other lines are ignored. 'pwm-props' may not be set. If 'pwm-props' are set, they must be set before pam.

Returns:
List of PWM.
Throws:
java.lang.Exception

writeResult

public static void writeResult(java.lang.String result,
                               java.lang.String path,
                               boolean appendToFile)
Writes into given file specified results.