trans.tpmap
Class WindowMaker

java.lang.Object
  extended bytrans.tpmap.WindowMaker

public class WindowMaker
extends java.lang.Object

Creates Windows (start position, end position) of a given length, containing a given number of oligo start positions and maximum number of features. Remember for any given oligo it may have multiple features, ie spotted multiple times on the array due to multiple hits. Thus a window with 3 oligos, each with 10 spottings has 30 features for the window. Can limit the amount added by setting the maxNumFeatures field. Used to assemble subsets of the array data for performing statistical tests. Each window contains a unique set of features, tries to maximize its size to the max size, and is only saved if it contains the minimum number of features.


Constructor Summary
WindowMaker(int windowSize, int minNumOligos)
           
WindowMaker(int windowSize, int minNumOligos, int maxNumFeatures)
           
 
Method Summary
static java.lang.String[] extractChrFiles(java.io.File directory)
           
 int getMaxNumFeatures()
           
static void main(java.lang.String[] args)
           
 int[][] makeWindows(int[] bpStartPositions)
          Takes an int[] of sorted bp start positions and finds unique windows of a maximized width with a minimal # of oligos.
 void makeWindowsFromFiles(java.lang.String[] files)
          Takes int[] files containing bp start positions for each oligo, ordered.
static int numberUniqueValues(int[] values, int startIndex, int stopIndex)
          Given a sorted set of values, a start and stop index (inclusive) returns the number of unique values.
 void setMaxNumFeatures(int maxNumFeatures)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WindowMaker

public WindowMaker(int windowSize,
                   int minNumOligos)

WindowMaker

public WindowMaker(int windowSize,
                   int minNumOligos,
                   int maxNumFeatures)
Method Detail

makeWindowsFromFiles

public void makeWindowsFromFiles(java.lang.String[] files)
Takes int[] files containing bp start positions for each oligo, ordered. Saves the results as a int[][] where each window has a start index and stop index that correspond to the indexes in the original bp start positions. Indexes of indexes...


numberUniqueValues

public static int numberUniqueValues(int[] values,
                                     int startIndex,
                                     int stopIndex)
Given a sorted set of values, a start and stop index (inclusive) returns the number of unique values.


makeWindows

public int[][] makeWindows(int[] bpStartPositions)
Takes an int[] of sorted bp start positions and finds unique windows of a maximized width with a minimal # of oligos. Returns an int[window number][start index, stop index]. Stop is inclusive! Be sure you have at least two start positions. Single bpStartPositions will throw an index out of bounds exception!


main

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

extractChrFiles

public static java.lang.String[] extractChrFiles(java.io.File directory)

getMaxNumFeatures

public int getMaxNumFeatures()

setMaxNumFeatures

public void setMaxNumFeatures(int maxNumFeatures)