Example usage for org.apache.commons.math3.distribution RealDistribution getNumericalVariance

List of usage examples for org.apache.commons.math3.distribution RealDistribution getNumericalVariance

Introduction

In this page you can find the example usage for org.apache.commons.math3.distribution RealDistribution getNumericalVariance.

Prototype

double getNumericalVariance();

Source Link

Document

Use this method to get the numerical value of the variance of this distribution.

Usage

From source file:org.nmdp.ngs.reads.GeneratePairedEndReads.java

/**
 * Generate paired-end next generation sequencing (NGS/HTS) reads.
 *
 * @param reference reference, must not be null
 * @param variant FASTQ variant, must not be null
 * @param random random, must not be null
 * @param length length distribution, must not be null
 * @param insertSize insert size distribution, must not be null
 * @param quality quality strategy, must not be null
 * @param coverage coverage strategy, must not be null
 * @param mutationRate mutation rate, must be between <code>0.0</code> and <code>1.0</code>, inclusive
 * @param mutation mutation strategy, must not be null
 * @param first first appendable, must not be null
 * @param second second appendable, must not be null
 * @param writer FASTQ writer, must not be null
 *///  ww  w  . jav  a  2s.  co  m
public GeneratePairedEndReads(final Sequence reference, final FastqVariant variant,
        final RandomGenerator random, final RealDistribution length, final RealDistribution insertSize,
        final QualityStrategy quality, final CoverageStrategy coverage, final double mutationRate,
        final MutationStrategy mutation, final Appendable first, final Appendable second,
        final FastqWriter writer) {

    checkNotNull(reference, "reference must not be null");
    checkNotNull(variant, "variant must not be null");
    checkNotNull(random, "random must not be null");
    checkNotNull(length, "length must not be null");
    checkNotNull(insertSize, "insertSize must not be null");
    checkNotNull(quality, "quality must not be null");
    checkNotNull(coverage, "coverage must not be null");
    checkArgument(mutationRate >= 0.0d, "mutationRate must be greater than or equal to 0.0d");
    checkArgument(mutationRate <= 1.0d, "mutationRate must be less than or equal to 1.0d");
    checkNotNull(mutation, "mutation must not be null");
    checkNotNull(first, "first must not be null");
    checkNotNull(second, "second must not be null");
    checkNotNull(writer, "writer must not be null");

    this.reference = reference;
    this.variant = variant;
    this.random = random;
    this.length = length;
    this.insertSize = insertSize;
    this.quality = quality;
    this.coverage = coverage;
    this.mutationRate = mutationRate;
    this.mutation = mutation;
    this.first = first;
    this.second = second;
    this.writer = writer;

    int flanking = (int) (length.getNumericalMean() + length.getNumericalVariance()
            + insertSize.getNumericalMean() + insertSize.getNumericalVariance());
    location = new UniformIntegerDistribution(this.random, 1 - flanking, this.reference.length() + flanking);
}

From source file:org.nmdp.ngs.reads.GenerateReads.java

/**
 * Generate next generation sequencing (NGS/HTS) reads.
 *
 * @param reference reference, must not be null
 * @param variant FASTQ variant, must not be null
 * @param random random, must not be null
 * @param length length distribution, must not be null
 * @param quality quality strategy, must not be null
 * @param coverage coverage strategy, must not be null
 * @param mutationRate mutation rate, must be between <code>0.0</code> and <code>1.0</code>, inclusive
 * @param mutation mutation strategy, must not be null
 * @param appendable appendable, must not be null
 * @param writer FASTQ writer, must not be null
 *//*w w  w. ja va 2s .c  o  m*/
public GenerateReads(final Sequence reference, final FastqVariant variant, final RandomGenerator random,
        final RealDistribution length, final QualityStrategy quality, final CoverageStrategy coverage,
        final double mutationRate, final MutationStrategy mutation, final Appendable appendable,
        final FastqWriter writer) {

    checkNotNull(reference, "reference must not be null");
    checkNotNull(variant, "variant must not be null");
    checkNotNull(random, "random must not be null");
    checkNotNull(length, "length must not be null");
    checkNotNull(quality, "quality must not be null");
    checkNotNull(coverage, "coverage must not be null");
    checkArgument(mutationRate >= 0.0d, "mutationRate must be greater than or equal to 0.0d");
    checkArgument(mutationRate <= 1.0d, "mutationRate must be less than or equal to 1.0d");
    checkNotNull(mutation, "mutation must not be null");
    checkNotNull(appendable, "appendable must not be null");
    checkNotNull(writer, "writer must not be null");

    this.reference = reference;
    this.variant = variant;
    this.random = random;
    this.length = length;
    this.quality = quality;
    this.coverage = coverage;
    this.mutationRate = mutationRate;
    this.mutation = mutation;
    this.appendable = appendable;
    this.writer = writer;

    int flanking = (int) (length.getNumericalMean() + length.getNumericalVariance());
    location = new UniformIntegerDistribution(this.random, 1 - flanking, this.reference.length() + flanking);
}

From source file:org.nmdp.ngs.tools.GenerateBed.java

/**
 * Generate records in BED format.// w  w  w.  j  av  a  2s.com
 *
 * @param bedFile output BED file, if any
 * @param n number of BED records to generate, must be at least zero
 * @param size chromosome size, must be at least zero
 * @param chrom chromosome name, must not be null
 * @param random random generator, must not be null
 * @param length length distribution, must not be null
 */
public GenerateBed(final File bedFile, final int n, final int size, final String chrom,
        final RandomGenerator random, final RealDistribution length) {
    checkArgument(n >= 0, "n must be at least zero");
    checkArgument(size >= 0, "size must be at least zero");
    checkNotNull(chrom);
    checkNotNull(random);
    checkNotNull(length);
    this.bedFile = bedFile;
    this.n = n;
    this.size = size;
    this.chrom = chrom;
    this.random = random;
    this.length = length;

    int flanking = (int) (length.getNumericalMean() + length.getNumericalVariance());
    location = new UniformIntegerDistribution(this.random, 1 - flanking, size + flanking);
}