net.sf.snver.pileup.core
Class CoreAnalysis

java.lang.Object
  extended by net.sf.snver.pileup.core.CoreAnalysis

public class CoreAnalysis
extends java.lang.Object

Core analysis algorithm

Created by IntelliJ IDEA. User: weicheng hu Date: 10/29/11 Time: 10:42 PM


Field Summary
 int failed
           
 
Constructor Summary
CoreAnalysis()
           
 
Method Summary
 void analyze(SnverMeta meta, java.util.Properties properties, java.io.PrintWriter out, java.io.PrintWriter log)
          Evaluate SnverMeta for output
 void close()
          Close the file handler
static CoreAnalysis getInstance()
          Get singleton instance
 double getpValue(SnverMeta meta, int n)
          Deprecated. 
 double getpValue(SnverMeta meta, java.util.Properties properties)
          Calculate P value
static boolean makeInstance(java.util.Properties properties)
          Make the singleton instance for CoreAnalysis
 void print(SnverMeta meta, java.util.Properties properties, java.io.PrintWriter out)
          Print meta information into vcf file
static void printCountHeader(java.io.PrintWriter out)
          Print the count file Header for debug
static void printHeader(java.io.PrintWriter out, java.lang.String name)
          Print the vcf header
 void printoutIndividual(java.lang.String chr, java.lang.String pos, java.lang.String ref, double pvalue, java.lang.String alt, int altCount, int depth, double fisher, double sp, int altfor, int altrev, int reffor, int refrev, double gt0, double gt1, double gt2, java.io.PrintWriter out)
          Print for individual vcf file
 boolean test(SnverMeta meta, java.util.Properties properties, java.io.PrintWriter errorLog)
          Check for SnverMeta is satisfied with conditions
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

failed

public int failed
Constructor Detail

CoreAnalysis

public CoreAnalysis()
Method Detail

printoutIndividual

public void printoutIndividual(java.lang.String chr,
                               java.lang.String pos,
                               java.lang.String ref,
                               double pvalue,
                               java.lang.String alt,
                               int altCount,
                               int depth,
                               double fisher,
                               double sp,
                               int altfor,
                               int altrev,
                               int reffor,
                               int refrev,
                               double gt0,
                               double gt1,
                               double gt2,
                               java.io.PrintWriter out)
Print for individual vcf file

Parameters:
chr - String
pos - int
ref - char
pvalue - double
alt - char
altCount - int
depth - int
fisher - double
sp - double
altfor - int
altrev - int
reffor - int
refrev - int
gt0 - double
gt1 - double
gt2 - double
out - PrintWriter

close

public void close()
Close the file handler


makeInstance

public static boolean makeInstance(java.util.Properties properties)
Make the singleton instance for CoreAnalysis

Parameters:
properties - Properties
Returns:
boolean

getInstance

public static CoreAnalysis getInstance()
                                throws java.io.FileNotFoundException
Get singleton instance

Returns:
CoreAnalysis
Throws:
java.io.FileNotFoundException

printHeader

public static void printHeader(java.io.PrintWriter out,
                               java.lang.String name)
Print the vcf header

Parameters:
out - PrintWriter
name - String

printCountHeader

public static void printCountHeader(java.io.PrintWriter out)
Print the count file Header for debug

Parameters:
out - PrintWriter

print

public void print(SnverMeta meta,
                  java.util.Properties properties,
                  java.io.PrintWriter out)
Print meta information into vcf file

Parameters:
meta - SnverMeta
out - PrintWriter

analyze

public void analyze(SnverMeta meta,
                    java.util.Properties properties,
                    java.io.PrintWriter out,
                    java.io.PrintWriter log)
             throws org.apache.commons.math.MathException
Evaluate SnverMeta for output

Parameters:
meta - SnverMeta
out - PrintWriter
Throws:
org.apache.commons.math.MathException - Error in Calculation

test

public boolean test(SnverMeta meta,
                    java.util.Properties properties,
                    java.io.PrintWriter errorLog)
             throws org.apache.commons.math.MathException
Check for SnverMeta is satisfied with conditions

Parameters:
meta - SnverMeta
Returns:
boolean
Throws:
org.apache.commons.math.MathException - Error in Calculation

getpValue

public double getpValue(SnverMeta meta,
                        java.util.Properties properties)
Calculate P value

Parameters:
meta - SnverMeta
Returns:
double

getpValue

@Deprecated
public double getpValue(SnverMeta meta,
                                   int n)
Deprecated. 

Calculate P value with specific n

Parameters:
meta - SnverMeta
n - int
Returns:
double