edu.unc.csbio.RNASim
Class MainCmdline

java.lang.Object
  extended by edu.unc.csbio.RNASim.MainCmdline

public class MainCmdline
extends java.lang.Object

The class MainCmdline is the main class

Version:
0.1
Author:
Shunping Huang , Jack Wang

Field Summary
(package private) static java.util.HashMap<java.lang.String,java.lang.Double> abundancePool
          a Hashmap that maps a string to an abundance value
(package private) static int annotLimit
          max number of lines allowed for annotation file
(package private) static java.lang.String chrom
          this will be the prefix of the all read ID
(package private) static java.lang.String chromMatching
          specify the matching of chromosome string, Exact or Fuzzy.
(package private) static java.util.TreeSet<java.lang.String> chromPool
          a TreeSet that stores the chromosome names
(package private) static double coverageFactor
          coverage factor = total read length / total sequence size
(package private) static double distMean
          distribution mean value, will be used when calculating abundance.
(package private) static double expressionPercentage
          percentage of gene that will be expressed
(package private) static int fragMaxLength
          maximum sequence length
(package private) static int fragMinLength
          minimum sequence length
(package private) static java.util.TreeMap<java.lang.String,Gene> genePool
          a TreeMap that maps a string to a gene
(package private) static Gene[] genes
          an array that stores the genes
(package private) static java.lang.String IDPREFIX
          this will be the prefix of the all read ID
(package private) static int inputBufferSize
          input buffer size
(package private) static FqWriter out1
          the file location of fq writer file (for first pair end read)
(package private) static FqWriter out2
          the file location of fq writer file (for second pair end read)
(package private) static int outputBufferSize
          output buffer size
(package private) static int processBufferSize
          buffer size for accumulating gene range
(package private) static QualityGenerator qg
          a qualityGenerator
(package private) static int readLength
          read length
(package private) static long startTime
          time when program start running
(package private) static java.util.HashMap<java.lang.String,java.util.ArrayList<Feature>> svPool
          an array that stores the structure variants
(package private) static double tDistDOF
          the value used to calculate distMean.
(package private) static long totalGenes
          total number of the genes
(package private) static long totalGenesByChrom
          total number of genes in a chromosome
(package private) static long totalReads
          total number of the reads
(package private) static long totalReadsByChrom
          total number of reads in a chromosome
(package private) static long totalTranscripts
          total number of transcripts
(package private) static long totalTranscriptsByChrom
          total number of transcripts in a chromosome
(package private) static java.util.TreeMap<java.lang.String,Transcript> transcriptPool
          a TreeMap that maps a string to a transcript
 
Constructor Summary
MainCmdline()
           
 
Method Summary
static void abort(java.lang.Exception e)
          the method to abort the program
static void BuildAbundance(java.lang.String abundanceFn)
          this method creates abundance file with default settings
static void GenerateSequence()
          this method generate read sequence from given Config file
static void GenerateSequenceForGenes(java.lang.String chrom)
          Given a chromosome, this method call public static void GenerateSequenceForSingleGene(Gene g, SequenceBuffer buffer) throws IOException on all genes of that chromosome, and prints out total genes, reads and transcripts associated with chromosome.
static void GenerateSequenceForSingleGene(Gene g, SequenceBuffer buffer)
          given a gene, this method generates read and appends read information to output fq file
static void main(java.lang.String[] args)
          this is the driver for the whole program
static void printRuntime()
          the method to print out the run time of the program
static void ReadAnnotation()
          this method reads annotation file.
static void ReadConfig(java.lang.String[] args)
          this method read configuration file
static void ReadStructureVariant()
          this method read structure variants.
static void ReadTranscriptAbundance()
          this method read the transcript abundance from Abundance_File in Config file
static void shuffle(java.lang.Object[] array)
          given an array, this method sequentially changes a position with another randomly selected position, for n times, where n is the size of array.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

IDPREFIX

static java.lang.String IDPREFIX
this will be the prefix of the all read ID


chrom

static java.lang.String chrom
this will be the prefix of the all read ID


chromMatching

static java.lang.String chromMatching
specify the matching of chromosome string, Exact or Fuzzy.


annotLimit

static int annotLimit
max number of lines allowed for annotation file


inputBufferSize

static int inputBufferSize
input buffer size


outputBufferSize

static int outputBufferSize
output buffer size


processBufferSize

static int processBufferSize
buffer size for accumulating gene range


readLength

static int readLength
read length


fragMinLength

static int fragMinLength
minimum sequence length


fragMaxLength

static int fragMaxLength
maximum sequence length


coverageFactor

static double coverageFactor
coverage factor = total read length / total sequence size


expressionPercentage

static double expressionPercentage
percentage of gene that will be expressed


distMean

static double distMean
distribution mean value, will be used when calculating abundance. abundance is related to distMean and probability associated with T-distribution.


tDistDOF

static double tDistDOF
the value used to calculate distMean. distMean = the value of TDistribution at tDistDOF


startTime

static long startTime
time when program start running


transcriptPool

static java.util.TreeMap<java.lang.String,Transcript> transcriptPool
a TreeMap that maps a string to a transcript


genePool

static java.util.TreeMap<java.lang.String,Gene> genePool
a TreeMap that maps a string to a gene


abundancePool

static java.util.HashMap<java.lang.String,java.lang.Double> abundancePool
a Hashmap that maps a string to an abundance value


chromPool

static java.util.TreeSet<java.lang.String> chromPool
a TreeSet that stores the chromosome names


svPool

static java.util.HashMap<java.lang.String,java.util.ArrayList<Feature>> svPool
an array that stores the structure variants


genes

static Gene[] genes
an array that stores the genes


out1

static FqWriter out1
the file location of fq writer file (for first pair end read)


out2

static FqWriter out2
the file location of fq writer file (for second pair end read)


qg

static QualityGenerator qg
a qualityGenerator


totalReads

static long totalReads
total number of the reads


totalGenes

static long totalGenes
total number of the genes


totalTranscripts

static long totalTranscripts
total number of transcripts


totalReadsByChrom

static long totalReadsByChrom
total number of reads in a chromosome


totalTranscriptsByChrom

static long totalTranscriptsByChrom
total number of transcripts in a chromosome


totalGenesByChrom

static long totalGenesByChrom
total number of genes in a chromosome

Constructor Detail

MainCmdline

public MainCmdline()
Method Detail

printRuntime

public static void printRuntime()
the method to print out the run time of the program


abort

public static void abort(java.lang.Exception e)
the method to abort the program


shuffle

public static void shuffle(java.lang.Object[] array)
given an array, this method sequentially changes a position with another randomly selected position, for n times, where n is the size of array.


ReadConfig

public static void ReadConfig(java.lang.String[] args)
this method read configuration file

Parameters:
args - the argument array from command line

ReadAnnotation

public static void ReadAnnotation()
this method reads annotation file.


BuildAbundance

public static void BuildAbundance(java.lang.String abundanceFn)
this method creates abundance file with default settings

Parameters:
abundanceFn - file location of abundance file to be created

ReadTranscriptAbundance

public static void ReadTranscriptAbundance()
this method read the transcript abundance from Abundance_File in Config file


ReadStructureVariant

public static void ReadStructureVariant()
this method read structure variants.


GenerateSequenceForSingleGene

public static void GenerateSequenceForSingleGene(Gene g,
                                                 SequenceBuffer buffer)
                                          throws java.io.IOException
given a gene, this method generates read and appends read information to output fq file

Parameters:
g - A Gene object
buffer - A SequenceBuffer object
Throws:
java.io.IOException - if an input or output exception occurred

GenerateSequenceForGenes

public static void GenerateSequenceForGenes(java.lang.String chrom)
                                     throws java.io.IOException
Given a chromosome, this method call public static void GenerateSequenceForSingleGene(Gene g, SequenceBuffer buffer) throws IOException on all genes of that chromosome, and prints out total genes, reads and transcripts associated with chromosome.

Parameters:
chrom - A chromosome
Throws:
java.io.IOException - if an input or output exception occurred

GenerateSequence

public static void GenerateSequence()
this method generate read sequence from given Config file


main

public static void main(java.lang.String[] args)
this is the driver for the whole program

Parameters:
args - program arguments