Abstract class for the statistics
Addressing the code duplication issue raised by Mark.
This commit is contained in:
parent
38662f1d47
commit
8f8f339e4b
|
|
@ -0,0 +1,150 @@
|
||||||
|
/*
|
||||||
|
* By downloading the PROGRAM you agree to the following terms of use:
|
||||||
|
*
|
||||||
|
* BROAD INSTITUTE - SOFTWARE LICENSE AGREEMENT - FOR ACADEMIC NON-COMMERCIAL RESEARCH PURPOSES ONLY
|
||||||
|
*
|
||||||
|
* This Agreement is made between the Broad Institute, Inc. with a principal address at 7 Cambridge Center, Cambridge, MA 02142 (BROAD) and the LICENSEE and is effective at the date the downloading is completed (EFFECTIVE DATE).
|
||||||
|
*
|
||||||
|
* WHEREAS, LICENSEE desires to license the PROGRAM, as defined hereinafter, and BROAD wishes to have this PROGRAM utilized in the public interest, subject only to the royalty-free, nonexclusive, nontransferable license rights of the United States Government pursuant to 48 CFR 52.227-14; and
|
||||||
|
* WHEREAS, LICENSEE desires to license the PROGRAM and BROAD desires to grant a license on the following terms and conditions.
|
||||||
|
* NOW, THEREFORE, in consideration of the promises and covenants made herein, the parties hereto agree as follows:
|
||||||
|
*
|
||||||
|
* 1. DEFINITIONS
|
||||||
|
* 1.1 PROGRAM shall mean copyright in the object code and source code known as GATK2 and related documentation, if any, as they exist on the EFFECTIVE DATE and can be downloaded from http://www.broadinstitute/GATK on the EFFECTIVE DATE.
|
||||||
|
*
|
||||||
|
* 2. LICENSE
|
||||||
|
* 2.1 Grant. Subject to the terms of this Agreement, BROAD hereby grants to LICENSEE, solely for academic non-commercial research purposes, a non-exclusive, non-transferable license to: (a) download, execute and display the PROGRAM and (b) create bug fixes and modify the PROGRAM.
|
||||||
|
* The LICENSEE may apply the PROGRAM in a pipeline to data owned by users other than the LICENSEE and provide these users the results of the PROGRAM provided LICENSEE does so for academic non-commercial purposes only. For clarification purposes, academic sponsored research is not a commercial use under the terms of this Agreement.
|
||||||
|
* 2.2 No Sublicensing or Additional Rights. LICENSEE shall not sublicense or distribute the PROGRAM, in whole or in part, without prior written permission from BROAD. LICENSEE shall ensure that all of its users agree to the terms of this Agreement. LICENSEE further agrees that it shall not put the PROGRAM on a network, server, or other similar technology that may be accessed by anyone other than the LICENSEE and its employees and users who have agreed to the terms of this agreement.
|
||||||
|
* 2.3 License Limitations. Nothing in this Agreement shall be construed to confer any rights upon LICENSEE by implication, estoppel, or otherwise to any computer software, trademark, intellectual property, or patent rights of BROAD, or of any other entity, except as expressly granted herein. LICENSEE agrees that the PROGRAM, in whole or part, shall not be used for any commercial purpose, including without limitation, as the basis of a commercial software or hardware product or to provide services. LICENSEE further agrees that the PROGRAM shall not be copied or otherwise adapted in order to circumvent the need for obtaining a license for use of the PROGRAM.
|
||||||
|
*
|
||||||
|
* 3. OWNERSHIP OF INTELLECTUAL PROPERTY
|
||||||
|
* LICENSEE acknowledges that title to the PROGRAM shall remain with BROAD. The PROGRAM is marked with the following BROAD copyright notice and notice of attribution to contributors. LICENSEE shall retain such notice on all copies. LICENSEE agrees to include appropriate attribution if any results obtained from use of the PROGRAM are included in any publication.
|
||||||
|
* Copyright 2012 Broad Institute, Inc.
|
||||||
|
* Notice of attribution: The GATK2 program was made available through the generosity of Medical and Population Genetics program at the Broad Institute, Inc.
|
||||||
|
* LICENSEE shall not use any trademark or trade name of BROAD, or any variation, adaptation, or abbreviation, of such marks or trade names, or any names of officers, faculty, students, employees, or agents of BROAD except as states above for attribution purposes.
|
||||||
|
*
|
||||||
|
* 4. INDEMNIFICATION
|
||||||
|
* LICENSEE shall indemnify, defend, and hold harmless BROAD, and their respective officers, faculty, students, employees, associated investigators and agents, and their respective successors, heirs and assigns, (Indemnitees), against any liability, damage, loss, or expense (including reasonable attorneys fees and expenses) incurred by or imposed upon any of the Indemnitees in connection with any claims, suits, actions, demands or judgments arising out of any theory of liability (including, without limitation, actions in the form of tort, warranty, or strict liability and regardless of whether such action has any factual basis) pursuant to any right or license granted under this Agreement.
|
||||||
|
*
|
||||||
|
* 5. NO REPRESENTATIONS OR WARRANTIES
|
||||||
|
* THE PROGRAM IS DELIVERED AS IS. BROAD MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE PROGRAM OR THE COPYRIGHT, EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, WHETHER OR NOT DISCOVERABLE. BROAD EXTENDS NO WARRANTIES OF ANY KIND AS TO PROGRAM CONFORMITY WITH WHATEVER USER MANUALS OR OTHER LITERATURE MAY BE ISSUED FROM TIME TO TIME.
|
||||||
|
* IN NO EVENT SHALL BROAD OR ITS RESPECTIVE DIRECTORS, OFFICERS, EMPLOYEES, AFFILIATED INVESTIGATORS AND AFFILIATES BE LIABLE FOR INCIDENTAL OR CONSEQUENTIAL DAMAGES OF ANY KIND, INCLUDING, WITHOUT LIMITATION, ECONOMIC DAMAGES OR INJURY TO PROPERTY AND LOST PROFITS, REGARDLESS OF WHETHER BROAD SHALL BE ADVISED, SHALL HAVE OTHER REASON TO KNOW, OR IN FACT SHALL KNOW OF THE POSSIBILITY OF THE FOREGOING.
|
||||||
|
*
|
||||||
|
* 6. ASSIGNMENT
|
||||||
|
* This Agreement is personal to LICENSEE and any rights or obligations assigned by LICENSEE without the prior written consent of BROAD shall be null and void.
|
||||||
|
*
|
||||||
|
* 7. MISCELLANEOUS
|
||||||
|
* 7.1 Export Control. LICENSEE gives assurance that it will comply with all United States export control laws and regulations controlling the export of the PROGRAM, including, without limitation, all Export Administration Regulations of the United States Department of Commerce. Among other things, these laws and regulations prohibit, or require a license for, the export of certain types of software to specified countries.
|
||||||
|
* 7.2 Termination. LICENSEE shall have the right to terminate this Agreement for any reason upon prior written notice to BROAD. If LICENSEE breaches any provision hereunder, and fails to cure such breach within thirty (30) days, BROAD may terminate this Agreement immediately. Upon termination, LICENSEE shall provide BROAD with written assurance that the original and all copies of the PROGRAM have been destroyed, except that, upon prior written authorization from BROAD, LICENSEE may retain a copy for archive purposes.
|
||||||
|
* 7.3 Survival. The following provisions shall survive the expiration or termination of this Agreement: Articles 1, 3, 4, 5 and Sections 2.2, 2.3, 7.3, and 7.4.
|
||||||
|
* 7.4 Notice. Any notices under this Agreement shall be in writing, shall specifically refer to this Agreement, and shall be sent by hand, recognized national overnight courier, confirmed facsimile transmission, confirmed electronic mail, or registered or certified mail, postage prepaid, return receipt requested. All notices under this Agreement shall be deemed effective upon receipt.
|
||||||
|
* 7.5 Amendment and Waiver; Entire Agreement. This Agreement may be amended, supplemented, or otherwise modified only by means of a written instrument signed by all parties. Any waiver of any rights or failure to act in a specific instance shall relate only to such instance and shall not be construed as an agreement to waive any rights or fail to act in any other instance, whether or not similar. This Agreement constitutes the entire agreement among the parties with respect to its subject matter and supersedes prior agreements or understandings between the parties relating to its subject matter.
|
||||||
|
* 7.6 Binding Effect; Headings. This Agreement shall be binding upon and inure to the benefit of the parties and their respective permitted successors and assigns. All headings are for convenience only and shall not affect the meaning of any provision of this Agreement.
|
||||||
|
* 7.7 Governing Law. This Agreement shall be construed, governed, interpreted and applied in accordance with the internal laws of the Commonwealth of Massachusetts, U.S.A., without regard to conflict of laws principles.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package org.broadinstitute.sting.gatk.walkers.diagnostics.diagnosetargets;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.LinkedList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generic code for Diagnose Target Statistics
|
||||||
|
*
|
||||||
|
* @author Mauricio Carneiro
|
||||||
|
* @since 4/23/13
|
||||||
|
*/
|
||||||
|
abstract class AbstractStatistics {
|
||||||
|
|
||||||
|
private long preComputedTotalCoverage = -1;
|
||||||
|
private Map<CallableStatus, Integer> statusTally = null;
|
||||||
|
protected ThresHolder thresholds;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Calculates the average "good" coverage of this sample. Good means "passes the base and
|
||||||
|
* mapping quality requirements.
|
||||||
|
*
|
||||||
|
* @return the average "good" coverage
|
||||||
|
*/
|
||||||
|
public double averageCoverage(final int size) {
|
||||||
|
if (preComputedTotalCoverage < 0)
|
||||||
|
preComputedTotalCoverage = calculateTotalCoverage(getElements());
|
||||||
|
return (double) preComputedTotalCoverage / size;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Calculates the total "good" coverage of this sample. Good means "passes the base and
|
||||||
|
* mapping quality requirements.
|
||||||
|
*
|
||||||
|
* @return the total "good" coverage across the interval for this sample
|
||||||
|
*/
|
||||||
|
public long getCoverage() {
|
||||||
|
if (preComputedTotalCoverage < 0)
|
||||||
|
preComputedTotalCoverage = calculateTotalCoverage(getElements());
|
||||||
|
return preComputedTotalCoverage;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This is how the extending class will calculate it's own total coverage
|
||||||
|
*
|
||||||
|
* @return the total coverage
|
||||||
|
*/
|
||||||
|
private long calculateTotalCoverage(Iterable<AbstractStatistics> elements) {
|
||||||
|
long cov = 0;
|
||||||
|
for (AbstractStatistics element : elements) {
|
||||||
|
cov += element.getCoverage();
|
||||||
|
}
|
||||||
|
return cov;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* What are the list of elements in your class? For example:
|
||||||
|
*
|
||||||
|
* IntervalStatistics => List<SampleStatistics>
|
||||||
|
* SampleStatistics => List<LocusStatistics>
|
||||||
|
*
|
||||||
|
* @return the corresponding list of elements of the extending class
|
||||||
|
*/
|
||||||
|
public abstract Iterable<AbstractStatistics> getElements();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Calculates the Callable statuses for the statistic as a whole (interval, sample or locus)
|
||||||
|
*
|
||||||
|
* @return the callable status(es) for the whole object
|
||||||
|
*/
|
||||||
|
public abstract Iterable<CallableStatus> callableStatuses();
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tally up all the callable status of all the loci in this sample.
|
||||||
|
*
|
||||||
|
* @return a map of callable status and counts
|
||||||
|
*/
|
||||||
|
public Map<CallableStatus, Integer> getStatusTally() {
|
||||||
|
if (statusTally == null) {
|
||||||
|
statusTally = new HashMap<CallableStatus, Integer>(CallableStatus.values().length);
|
||||||
|
for (AbstractStatistics stats : getElements()) {
|
||||||
|
for (CallableStatus status : stats.callableStatuses()) {
|
||||||
|
statusTally.put(status, !statusTally.containsKey(status) ? 1 : statusTally.get(status) + 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return statusTally;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<CallableStatus> queryStatus(List<Statistic> statList, AbstractStatistics stratification) {
|
||||||
|
List<CallableStatus> output = new LinkedList<CallableStatus>();
|
||||||
|
for (Statistic stat : statList) {
|
||||||
|
final CallableStatus status = stat.status(stratification);
|
||||||
|
if (status != null) {
|
||||||
|
output.add(status);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return output;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -259,14 +259,14 @@ public class DiagnoseTargets extends LocusWalker<Long, Long> {
|
||||||
vcb.filters(new LinkedHashSet<String>(statusToStrings(stats.callableStatuses(), true)));
|
vcb.filters(new LinkedHashSet<String>(statusToStrings(stats.callableStatuses(), true)));
|
||||||
|
|
||||||
attributes.put(VCFConstants.END_KEY, interval.getStop());
|
attributes.put(VCFConstants.END_KEY, interval.getStop());
|
||||||
attributes.put(AVG_INTERVAL_DP_KEY, stats.averageCoverage());
|
attributes.put(AVG_INTERVAL_DP_KEY, stats.averageCoverage(interval.size()));
|
||||||
|
|
||||||
vcb = vcb.attributes(attributes);
|
vcb = vcb.attributes(attributes);
|
||||||
for (String sample : samples) {
|
for (String sample : samples) {
|
||||||
final GenotypeBuilder gb = new GenotypeBuilder(sample);
|
final GenotypeBuilder gb = new GenotypeBuilder(sample);
|
||||||
|
|
||||||
SampleStatistics sampleStat = stats.getSampleStatistics(sample);
|
SampleStatistics sampleStat = stats.getSampleStatistics(sample);
|
||||||
gb.attribute(AVG_INTERVAL_DP_KEY, sampleStat.averageCoverage());
|
gb.attribute(AVG_INTERVAL_DP_KEY, sampleStat.averageCoverage(interval.size()));
|
||||||
|
|
||||||
gb.filters(statusToStrings(stats.getSampleStatistics(sample).callableStatuses(), false));
|
gb.filters(statusToStrings(stats.getSampleStatistics(sample).callableStatuses(), false));
|
||||||
|
|
||||||
|
|
@ -283,8 +283,8 @@ public class DiagnoseTargets extends LocusWalker<Long, Long> {
|
||||||
* @param statuses the set of statuses to be converted
|
* @param statuses the set of statuses to be converted
|
||||||
* @return a matching set of strings
|
* @return a matching set of strings
|
||||||
*/
|
*/
|
||||||
private List<String> statusToStrings(List<CallableStatus> statuses, final boolean isInfoField) {
|
private List<String> statusToStrings(Iterable<CallableStatus> statuses, final boolean isInfoField) {
|
||||||
List<String> output = new ArrayList<String>(statuses.size());
|
List<String> output = new LinkedList<String>();
|
||||||
|
|
||||||
for (CallableStatus status : statuses)
|
for (CallableStatus status : statuses)
|
||||||
if ( isInfoField || status != CallableStatus.PASS )
|
if ( isInfoField || status != CallableStatus.PASS )
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,5 @@ package org.broadinstitute.sting.gatk.walkers.diagnostics.diagnosetargets;
|
||||||
* Time: 11:30 PM
|
* Time: 11:30 PM
|
||||||
* To change this template use File | Settings | File Templates.
|
* To change this template use File | Settings | File Templates.
|
||||||
*/
|
*/
|
||||||
interface Interval {
|
interface Interval extends Statistic {
|
||||||
public void initialize(ThresHolder thresholds);
|
|
||||||
public CallableStatus status (IntervalStatistics intervalStatistics);
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -53,23 +53,21 @@ import org.broadinstitute.sting.utils.pileup.ReadBackedPileup;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
final class IntervalStatistics {
|
final class IntervalStatistics extends AbstractStatistics{
|
||||||
private final Map<String, SampleStatistics> samples;
|
private final Map<String, AbstractStatistics> samples;
|
||||||
private final GenomeLoc interval;
|
private final GenomeLoc interval;
|
||||||
private final ThresHolder thresholds;
|
private final ThresHolder thresholds;
|
||||||
|
|
||||||
private int preComputedTotalCoverage = -1;
|
|
||||||
|
|
||||||
public IntervalStatistics(Set<String> samples, GenomeLoc interval, ThresHolder thresholds) {
|
public IntervalStatistics(Set<String> samples, GenomeLoc interval, ThresHolder thresholds) {
|
||||||
this.interval = interval;
|
this.interval = interval;
|
||||||
this.thresholds = thresholds;
|
this.thresholds = thresholds;
|
||||||
this.samples = new HashMap<String, SampleStatistics>(samples.size());
|
this.samples = new HashMap<String, AbstractStatistics>(samples.size());
|
||||||
for (String sample : samples)
|
for (String sample : samples)
|
||||||
this.samples.put(sample, new SampleStatistics(interval, thresholds));
|
this.samples.put(sample, new SampleStatistics(interval, thresholds));
|
||||||
}
|
}
|
||||||
|
|
||||||
public SampleStatistics getSampleStatistics(String sample) {
|
public SampleStatistics getSampleStatistics(String sample) {
|
||||||
return samples.get(sample);
|
return (SampleStatistics) samples.get(sample);
|
||||||
}
|
}
|
||||||
|
|
||||||
public GenomeLoc getInterval() {
|
public GenomeLoc getInterval() {
|
||||||
|
|
@ -94,7 +92,7 @@ final class IntervalStatistics {
|
||||||
for (Map.Entry<String, ReadBackedPileup> entry : samplePileups.entrySet()) {
|
for (Map.Entry<String, ReadBackedPileup> entry : samplePileups.entrySet()) {
|
||||||
String sample = entry.getKey();
|
String sample = entry.getKey();
|
||||||
ReadBackedPileup samplePileup = entry.getValue();
|
ReadBackedPileup samplePileup = entry.getValue();
|
||||||
SampleStatistics sampleStatistics = samples.get(sample);
|
SampleStatistics sampleStatistics = (SampleStatistics) samples.get(sample);
|
||||||
|
|
||||||
if (sampleStatistics == null)
|
if (sampleStatistics == null)
|
||||||
throw new ReviewedStingException(String.format("Trying to add locus statistics to a sample (%s) that doesn't exist in the Interval.", sample));
|
throw new ReviewedStingException(String.format("Trying to add locus statistics to a sample (%s) that doesn't exist in the Interval.", sample));
|
||||||
|
|
@ -104,49 +102,30 @@ final class IntervalStatistics {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public double averageCoverage() {
|
/**
|
||||||
if (preComputedTotalCoverage < 0)
|
* {@inheritDoc}
|
||||||
calculateTotalCoverage();
|
*/
|
||||||
return (double) preComputedTotalCoverage / interval.size();
|
@Override
|
||||||
}
|
public Iterable<AbstractStatistics> getElements() {
|
||||||
|
return samples.values();
|
||||||
private void calculateTotalCoverage() {
|
|
||||||
preComputedTotalCoverage = 0;
|
|
||||||
for (SampleStatistics sample : samples.values())
|
|
||||||
preComputedTotalCoverage += sample.totalCoverage();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the Callable statuses for the interval as a whole
|
* {@inheritDoc}
|
||||||
*
|
|
||||||
* @return the callable status(es) for the whole interval
|
|
||||||
*/
|
*/
|
||||||
public List<CallableStatus> callableStatuses() {
|
@Override
|
||||||
|
public Iterable<CallableStatus> callableStatuses() {
|
||||||
final List<CallableStatus> output = new LinkedList<CallableStatus>();
|
final List<CallableStatus> output = new LinkedList<CallableStatus>();
|
||||||
|
|
||||||
// sum up all the callable status for each sample
|
|
||||||
final Map<CallableStatus, Integer> sampleStatusTally = new HashMap<CallableStatus, Integer>(CallableStatus.values().length);
|
|
||||||
for (SampleStatistics sampleStatistics : samples.values()) {
|
|
||||||
for (CallableStatus status : sampleStatistics.callableStatuses()) {
|
|
||||||
sampleStatusTally.put(status, !sampleStatusTally.containsKey(status) ? 1 : sampleStatusTally.get(status) + 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// check if any of the votes pass the threshold
|
// check if any of the votes pass the threshold
|
||||||
final int nSamples = getNSamples();
|
final int nSamples = getNSamples();
|
||||||
for (Map.Entry<CallableStatus, Integer> entry : sampleStatusTally.entrySet()) {
|
for (Map.Entry<CallableStatus, Integer> entry : getStatusTally().entrySet()) {
|
||||||
if ((double) entry.getValue() / nSamples > thresholds.votePercentageThreshold) {
|
if ((double) entry.getValue() / nSamples > thresholds.votePercentageThreshold) {
|
||||||
output.add(entry.getKey());
|
output.add(entry.getKey());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// add the interval specific statitics statuses
|
output.addAll(queryStatus(thresholds.intervalStatisticList, this));
|
||||||
for (Interval intervalStat : thresholds.intervalStatisticList) {
|
|
||||||
final CallableStatus status = intervalStat.status(this);
|
|
||||||
if (status != null) {
|
|
||||||
output.add(status);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -53,8 +53,6 @@ package org.broadinstitute.sting.gatk.walkers.diagnostics.diagnosetargets;
|
||||||
* Time: 11:29 PM
|
* Time: 11:29 PM
|
||||||
* To change this template use File | Settings | File Templates.
|
* To change this template use File | Settings | File Templates.
|
||||||
*/
|
*/
|
||||||
interface Locus {
|
interface Locus extends Statistic {
|
||||||
public void initialize(ThresHolder thresholds);
|
|
||||||
public CallableStatus status (LocusStatistics locusStatistics);
|
|
||||||
public CallableStatus sampleStatus (SampleStatistics sampleStatistics);
|
public CallableStatus sampleStatus (SampleStatistics sampleStatistics);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -61,7 +61,8 @@ final class LocusCoverageGap implements Locus {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CallableStatus status(LocusStatistics locusStatistics) {
|
public CallableStatus status(AbstractStatistics statistics) {
|
||||||
|
final LocusStatistics locusStatistics = (LocusStatistics) statistics;
|
||||||
return locusStatistics.getRawCoverage() == 0 ? CALL : null;
|
return locusStatistics.getRawCoverage() == 0 ? CALL : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,8 @@ final class LocusExcessiveCoverage implements Locus {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CallableStatus status(LocusStatistics locusStatistics) {
|
public CallableStatus status(AbstractStatistics statistics) {
|
||||||
|
final LocusStatistics locusStatistics = (LocusStatistics) statistics;
|
||||||
return locusStatistics.getCoverage() > excessiveCoverage ? CALL : null;
|
return locusStatistics.getCoverage() > excessiveCoverage ? CALL : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -63,8 +63,9 @@ final class LocusLowCoverage implements Locus {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CallableStatus status(LocusStatistics locusStatistics) {
|
public CallableStatus status(AbstractStatistics statistics) {
|
||||||
final int raw = locusStatistics.getRawCoverage();
|
final LocusStatistics locusStatistics = (LocusStatistics) statistics;
|
||||||
|
final long raw = locusStatistics.getRawCoverage();
|
||||||
return raw > 0 && raw < minCoverage ? CALL: null;
|
return raw > 0 && raw < minCoverage ? CALL: null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,8 @@ final class LocusPoorQuality implements Locus {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CallableStatus status(LocusStatistics locusStatistics) {
|
public CallableStatus status(AbstractStatistics statistics) {
|
||||||
|
final LocusStatistics locusStatistics = (LocusStatistics) statistics;
|
||||||
return locusStatistics.getCoverage() < minCoverage && locusStatistics.getRawCoverage() >= minCoverage ? CALL: null;
|
return locusStatistics.getCoverage() < minCoverage && locusStatistics.getRawCoverage() >= minCoverage ? CALL: null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -49,10 +49,10 @@ package org.broadinstitute.sting.gatk.walkers.diagnostics.diagnosetargets;
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
final class LocusStatistics {
|
final class LocusStatistics extends AbstractStatistics{
|
||||||
private int coverage;
|
private long coverage;
|
||||||
private int rawCoverage;
|
private long rawCoverage;
|
||||||
private final List<Locus> locusStatisticsList;
|
private final List<Statistic> locusStatisticsList;
|
||||||
|
|
||||||
public LocusStatistics(ThresHolder thresholds) {
|
public LocusStatistics(ThresHolder thresholds) {
|
||||||
this(0,0,thresholds);
|
this(0,0,thresholds);
|
||||||
|
|
@ -64,12 +64,13 @@ final class LocusStatistics {
|
||||||
this.locusStatisticsList = thresholds.locusStatisticList;
|
this.locusStatisticsList = thresholds.locusStatisticList;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getCoverage() {
|
@Override
|
||||||
return coverage;
|
public long getCoverage() {return coverage;}
|
||||||
}
|
public long getRawCoverage() {return rawCoverage;}
|
||||||
|
|
||||||
public int getRawCoverage() {
|
public void addLocus(final int coverage, final int rawCoverage) {
|
||||||
return rawCoverage;
|
this.coverage = coverage;
|
||||||
|
this.rawCoverage = rawCoverage;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -79,7 +80,7 @@ final class LocusStatistics {
|
||||||
*/
|
*/
|
||||||
public List<CallableStatus> callableStatuses() {
|
public List<CallableStatus> callableStatuses() {
|
||||||
List<CallableStatus> output = new LinkedList<CallableStatus>();
|
List<CallableStatus> output = new LinkedList<CallableStatus>();
|
||||||
for (Locus stats : locusStatisticsList) {
|
for (Statistic stats : locusStatisticsList) {
|
||||||
CallableStatus status = stats.status(this);
|
CallableStatus status = stats.status(this);
|
||||||
if (status != null) {
|
if (status != null) {
|
||||||
output.add(status);
|
output.add(status);
|
||||||
|
|
@ -88,8 +89,9 @@ final class LocusStatistics {
|
||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void set(final int coverage, final int rawCoverage) {
|
@Override
|
||||||
this.coverage = coverage;
|
public Iterable<AbstractStatistics> getElements() {
|
||||||
this.rawCoverage = rawCoverage;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,7 @@ import java.util.Map;
|
||||||
*/
|
*/
|
||||||
final class PluginUtils {
|
final class PluginUtils {
|
||||||
public static CallableStatus genericSampleStatus (final SampleStatistics sampleStatistics, final CallableStatus CALL, final double threshold) {
|
public static CallableStatus genericSampleStatus (final SampleStatistics sampleStatistics, final CallableStatus CALL, final double threshold) {
|
||||||
final Map<CallableStatus, Integer> totals = sampleStatistics.getLocusStatusTally();
|
final Map<CallableStatus, Integer> totals = sampleStatistics.getStatusTally();
|
||||||
final int size = sampleStatistics.getIntervalSize();
|
final int size = sampleStatistics.getIntervalSize();
|
||||||
final int statusCount = totals.containsKey(CALL) ? totals.get(CALL) : 0;
|
final int statusCount = totals.containsKey(CALL) ? totals.get(CALL) : 0;
|
||||||
return ( (double) statusCount / size) >= threshold ? CALL: null;
|
return ( (double) statusCount / size) >= threshold ? CALL: null;
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,5 @@ package org.broadinstitute.sting.gatk.walkers.diagnostics.diagnosetargets;
|
||||||
* Time: 11:30 PM
|
* Time: 11:30 PM
|
||||||
* To change this template use File | Settings | File Templates.
|
* To change this template use File | Settings | File Templates.
|
||||||
*/
|
*/
|
||||||
interface Sample {
|
interface Sample extends Statistic {
|
||||||
public void initialize(ThresHolder thresholds);
|
|
||||||
public CallableStatus status (SampleStatistics sampleStatistics);
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,8 @@ final class SampleBadMates implements Sample {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CallableStatus status(SampleStatistics sampleStatistics) {
|
public CallableStatus status(AbstractStatistics statistics) {
|
||||||
|
final SampleStatistics sampleStatistics = (SampleStatistics) statistics;
|
||||||
final int nReads = sampleStatistics.getnReads();
|
final int nReads = sampleStatistics.getnReads();
|
||||||
return nReads > 0 && (double) sampleStatistics.getnBadMates() / nReads > threshold ? CALL : null;
|
return nReads > 0 && (double) sampleStatistics.getnBadMates() / nReads > threshold ? CALL : null;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -53,16 +53,13 @@ package org.broadinstitute.sting.gatk.walkers.diagnostics.diagnosetargets;
|
||||||
*/
|
*/
|
||||||
final class SampleNoReads implements Sample {
|
final class SampleNoReads implements Sample {
|
||||||
private static final CallableStatus CALL = CallableStatus.NO_READS;
|
private static final CallableStatus CALL = CallableStatus.NO_READS;
|
||||||
|
@Override
|
||||||
private double votingThreshold;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void initialize(ThresHolder thresholds) {
|
public void initialize(ThresHolder thresholds) {
|
||||||
votingThreshold = thresholds.votePercentageThreshold;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CallableStatus status(SampleStatistics sampleStatistics) {
|
public CallableStatus status(AbstractStatistics statistics) {
|
||||||
|
final SampleStatistics sampleStatistics = (SampleStatistics) statistics;
|
||||||
return sampleStatistics.getnReads() == 0 ? CALL : null;
|
return sampleStatistics.getnReads() == 0 ? CALL : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -56,20 +56,18 @@ import java.util.*;
|
||||||
/**
|
/**
|
||||||
* The statistics calculator for a specific sample given the interval
|
* The statistics calculator for a specific sample given the interval
|
||||||
*/
|
*/
|
||||||
final class SampleStatistics {
|
final class SampleStatistics extends AbstractStatistics {
|
||||||
private final GenomeLoc interval;
|
private final GenomeLoc interval;
|
||||||
private final ArrayList<LocusStatistics> loci;
|
private final ArrayList<AbstractStatistics> loci;
|
||||||
private final ThresHolder thresholds;
|
private final ThresHolder thresholds;
|
||||||
|
|
||||||
// avoids re-calculating these sums over loci
|
|
||||||
private int preComputedTotalCoverage = -1;
|
|
||||||
private Map<CallableStatus, Integer> locusStatusTally = null;
|
private Map<CallableStatus, Integer> locusStatusTally = null;
|
||||||
private int nReads = -1;
|
private int nReads = -1;
|
||||||
private int nBadMates = -1;
|
private int nBadMates = -1;
|
||||||
|
|
||||||
public SampleStatistics(final GenomeLoc interval, final ThresHolder thresholds) {
|
public SampleStatistics(final GenomeLoc interval, final ThresHolder thresholds) {
|
||||||
this.interval = interval;
|
this.interval = interval;
|
||||||
this.loci = new ArrayList<LocusStatistics>(interval.size());
|
this.loci = new ArrayList<AbstractStatistics>(interval.size());
|
||||||
this.thresholds = thresholds;
|
this.thresholds = thresholds;
|
||||||
nReads = 0;
|
nReads = 0;
|
||||||
nBadMates = 0;
|
nBadMates = 0;
|
||||||
|
|
@ -77,69 +75,61 @@ final class SampleStatistics {
|
||||||
// Initialize every loci (this way we don't have to worry about non-existent loci in the object
|
// Initialize every loci (this way we don't have to worry about non-existent loci in the object
|
||||||
for (int i = 0; i < interval.size(); i++)
|
for (int i = 0; i < interval.size(); i++)
|
||||||
this.loci.add(new LocusStatistics(thresholds));
|
this.loci.add(new LocusStatistics(thresholds));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Calculates the total "good" coverage of this sample. Good means "passes the base and
|
* Simple Getters
|
||||||
* mapping quality requirements.
|
|
||||||
*
|
|
||||||
* @return the total "good" coverage across the interval for this sample
|
|
||||||
*/
|
*/
|
||||||
public long totalCoverage() {
|
public int getIntervalSize() {return interval.size();}
|
||||||
if (preComputedTotalCoverage < 0)
|
public int getnReads() {return nReads;}
|
||||||
calculateTotalCoverage();
|
public int getnBadMates() {return nBadMates;}
|
||||||
return preComputedTotalCoverage;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Calculates the average "good" coverage of this sample. Good means "passes the base and
|
* Adds a locus to the interval wide stats
|
||||||
* mapping quality requirements.
|
|
||||||
*
|
|
||||||
* @return the average "good" coverage
|
|
||||||
*/
|
|
||||||
public double averageCoverage() {
|
|
||||||
return (double) totalCoverage() / loci.size();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Tally up all the callable status of all the loci in this sample.
|
|
||||||
*
|
|
||||||
* @return a map of callable status and counts
|
|
||||||
*/
|
|
||||||
public Map<CallableStatus, Integer> getLocusStatusTally() {
|
|
||||||
if (locusStatusTally == null) {
|
|
||||||
locusStatusTally = new HashMap<CallableStatus, Integer>(CallableStatus.values().length);
|
|
||||||
|
|
||||||
// sum up all the callable statuses for each locus
|
|
||||||
for (int i = 0; i < interval.size(); i++) {
|
|
||||||
LocusStatistics locus = loci.get(i);
|
|
||||||
for (CallableStatus status : locus.callableStatuses()) {
|
|
||||||
locusStatusTally.put(status, !locusStatusTally.containsKey(status) ? 1 : locusStatusTally.get(status) + 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return locusStatusTally;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Calculates the callable statuses of the entire sample
|
|
||||||
*
|
*
|
||||||
* @return the callable statuses of the entire sample
|
* @param locus The locus given as a GenomeLoc
|
||||||
|
* @param pileup The pileup of that locus, this exclusively contains the sample
|
||||||
*/
|
*/
|
||||||
public List<CallableStatus> callableStatuses() {
|
public void addLocus(GenomeLoc locus, ReadBackedPileup pileup) {
|
||||||
|
if (!interval.containsP(locus))
|
||||||
|
throw new ReviewedStingException(String.format("Locus %s is not part of the Interval %s", locus, interval));
|
||||||
|
|
||||||
|
// a null pileup means there nothing to add
|
||||||
|
if (pileup != null) {
|
||||||
|
final int locusIndex = locus.getStart() - interval.getStart();
|
||||||
|
final int rawCoverage = pileup.depthOfCoverage();
|
||||||
|
final int coverage = pileup.getBaseAndMappingFilteredPileup(thresholds.minimumBaseQuality, thresholds.minimumMappingQuality).depthOfCoverage();
|
||||||
|
final LocusStatistics locusData = (LocusStatistics) loci.get(locusIndex);
|
||||||
|
locusData.addLocus(coverage, rawCoverage);
|
||||||
|
|
||||||
|
// process all the reads in this pileup (tallying number of reads and bad mates)
|
||||||
|
for (GATKSAMRecord read : pileup.getReads())
|
||||||
|
processRead(read);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Iterable<AbstractStatistics> getElements() {
|
||||||
|
return loci;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Iterable<CallableStatus> callableStatuses() {
|
||||||
final List<CallableStatus> output = new LinkedList<CallableStatus>();
|
final List<CallableStatus> output = new LinkedList<CallableStatus>();
|
||||||
|
|
||||||
// get the tally of all the locus callable statuses
|
// get the tally of all the locus callable statuses
|
||||||
for (Locus locusStat : thresholds.locusStatisticList) {
|
for (Statistic locusStat : thresholds.locusStatisticList) {
|
||||||
final CallableStatus status = locusStat.sampleStatus(this);
|
final CallableStatus status = ((Locus) locusStat).sampleStatus(this);
|
||||||
if (status != null) {
|
if (status != null) {
|
||||||
output.add(status);
|
output.add(status);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// get the sample specific statitics statuses
|
// get the sample specific statitics statuses
|
||||||
for (Sample sampleStat : thresholds.sampleStatisticList) {
|
for (Statistic sampleStat : thresholds.sampleStatisticList) {
|
||||||
final CallableStatus status = sampleStat.status(this);
|
final CallableStatus status = sampleStat.status(this);
|
||||||
if (status != null) {
|
if (status != null) {
|
||||||
output.add(status);
|
output.add(status);
|
||||||
|
|
@ -153,28 +143,6 @@ final class SampleStatistics {
|
||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Adds a locus to the interval wide stats
|
|
||||||
*
|
|
||||||
* @param locus The locus given as a GenomeLoc
|
|
||||||
* @param pileup The pileup of that locus, this exclusively contains the sample
|
|
||||||
*/
|
|
||||||
public void addLocus(GenomeLoc locus, ReadBackedPileup pileup) {
|
|
||||||
if (!interval.containsP(locus))
|
|
||||||
throw new ReviewedStingException(String.format("Locus %s is not part of the Interval %s", locus, interval));
|
|
||||||
|
|
||||||
// a null pileup means there nothing ot add
|
|
||||||
if (pileup != null) {
|
|
||||||
final int locusIndex = locus.getStart() - interval.getStart();
|
|
||||||
final int rawCoverage = pileup.depthOfCoverage();
|
|
||||||
final int coverage = pileup.getBaseAndMappingFilteredPileup(thresholds.minimumBaseQuality, thresholds.minimumMappingQuality).depthOfCoverage();
|
|
||||||
final LocusStatistics locusData = loci.get(locusIndex);
|
|
||||||
locusData.set(coverage, rawCoverage);
|
|
||||||
|
|
||||||
for (GATKSAMRecord read : pileup.getReads())
|
|
||||||
processRead(read);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Account for the read and check it for any statistics necessary. Reads are marked in the temporary
|
* Account for the read and check it for any statistics necessary. Reads are marked in the temporary
|
||||||
|
|
@ -190,22 +158,4 @@ final class SampleStatistics {
|
||||||
read.setTemporaryAttribute("seen", true);
|
read.setTemporaryAttribute("seen", true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void calculateTotalCoverage() {
|
|
||||||
preComputedTotalCoverage = 0;
|
|
||||||
for (LocusStatistics locus : loci)
|
|
||||||
preComputedTotalCoverage += locus.getCoverage();
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getIntervalSize() {
|
|
||||||
return interval.size();
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getnReads() {
|
|
||||||
return nReads;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getnBadMates() {
|
|
||||||
return nBadMates;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,57 @@
|
||||||
|
/*
|
||||||
|
* By downloading the PROGRAM you agree to the following terms of use:
|
||||||
|
*
|
||||||
|
* BROAD INSTITUTE - SOFTWARE LICENSE AGREEMENT - FOR ACADEMIC NON-COMMERCIAL RESEARCH PURPOSES ONLY
|
||||||
|
*
|
||||||
|
* This Agreement is made between the Broad Institute, Inc. with a principal address at 7 Cambridge Center, Cambridge, MA 02142 (BROAD) and the LICENSEE and is effective at the date the downloading is completed (EFFECTIVE DATE).
|
||||||
|
*
|
||||||
|
* WHEREAS, LICENSEE desires to license the PROGRAM, as defined hereinafter, and BROAD wishes to have this PROGRAM utilized in the public interest, subject only to the royalty-free, nonexclusive, nontransferable license rights of the United States Government pursuant to 48 CFR 52.227-14; and
|
||||||
|
* WHEREAS, LICENSEE desires to license the PROGRAM and BROAD desires to grant a license on the following terms and conditions.
|
||||||
|
* NOW, THEREFORE, in consideration of the promises and covenants made herein, the parties hereto agree as follows:
|
||||||
|
*
|
||||||
|
* 1. DEFINITIONS
|
||||||
|
* 1.1 PROGRAM shall mean copyright in the object code and source code known as GATK2 and related documentation, if any, as they exist on the EFFECTIVE DATE and can be downloaded from http://www.broadinstitute/GATK on the EFFECTIVE DATE.
|
||||||
|
*
|
||||||
|
* 2. LICENSE
|
||||||
|
* 2.1 Grant. Subject to the terms of this Agreement, BROAD hereby grants to LICENSEE, solely for academic non-commercial research purposes, a non-exclusive, non-transferable license to: (a) download, execute and display the PROGRAM and (b) create bug fixes and modify the PROGRAM.
|
||||||
|
* The LICENSEE may apply the PROGRAM in a pipeline to data owned by users other than the LICENSEE and provide these users the results of the PROGRAM provided LICENSEE does so for academic non-commercial purposes only. For clarification purposes, academic sponsored research is not a commercial use under the terms of this Agreement.
|
||||||
|
* 2.2 No Sublicensing or Additional Rights. LICENSEE shall not sublicense or distribute the PROGRAM, in whole or in part, without prior written permission from BROAD. LICENSEE shall ensure that all of its users agree to the terms of this Agreement. LICENSEE further agrees that it shall not put the PROGRAM on a network, server, or other similar technology that may be accessed by anyone other than the LICENSEE and its employees and users who have agreed to the terms of this agreement.
|
||||||
|
* 2.3 License Limitations. Nothing in this Agreement shall be construed to confer any rights upon LICENSEE by implication, estoppel, or otherwise to any computer software, trademark, intellectual property, or patent rights of BROAD, or of any other entity, except as expressly granted herein. LICENSEE agrees that the PROGRAM, in whole or part, shall not be used for any commercial purpose, including without limitation, as the basis of a commercial software or hardware product or to provide services. LICENSEE further agrees that the PROGRAM shall not be copied or otherwise adapted in order to circumvent the need for obtaining a license for use of the PROGRAM.
|
||||||
|
*
|
||||||
|
* 3. OWNERSHIP OF INTELLECTUAL PROPERTY
|
||||||
|
* LICENSEE acknowledges that title to the PROGRAM shall remain with BROAD. The PROGRAM is marked with the following BROAD copyright notice and notice of attribution to contributors. LICENSEE shall retain such notice on all copies. LICENSEE agrees to include appropriate attribution if any results obtained from use of the PROGRAM are included in any publication.
|
||||||
|
* Copyright 2012 Broad Institute, Inc.
|
||||||
|
* Notice of attribution: The GATK2 program was made available through the generosity of Medical and Population Genetics program at the Broad Institute, Inc.
|
||||||
|
* LICENSEE shall not use any trademark or trade name of BROAD, or any variation, adaptation, or abbreviation, of such marks or trade names, or any names of officers, faculty, students, employees, or agents of BROAD except as states above for attribution purposes.
|
||||||
|
*
|
||||||
|
* 4. INDEMNIFICATION
|
||||||
|
* LICENSEE shall indemnify, defend, and hold harmless BROAD, and their respective officers, faculty, students, employees, associated investigators and agents, and their respective successors, heirs and assigns, (Indemnitees), against any liability, damage, loss, or expense (including reasonable attorneys fees and expenses) incurred by or imposed upon any of the Indemnitees in connection with any claims, suits, actions, demands or judgments arising out of any theory of liability (including, without limitation, actions in the form of tort, warranty, or strict liability and regardless of whether such action has any factual basis) pursuant to any right or license granted under this Agreement.
|
||||||
|
*
|
||||||
|
* 5. NO REPRESENTATIONS OR WARRANTIES
|
||||||
|
* THE PROGRAM IS DELIVERED AS IS. BROAD MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE PROGRAM OR THE COPYRIGHT, EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, WHETHER OR NOT DISCOVERABLE. BROAD EXTENDS NO WARRANTIES OF ANY KIND AS TO PROGRAM CONFORMITY WITH WHATEVER USER MANUALS OR OTHER LITERATURE MAY BE ISSUED FROM TIME TO TIME.
|
||||||
|
* IN NO EVENT SHALL BROAD OR ITS RESPECTIVE DIRECTORS, OFFICERS, EMPLOYEES, AFFILIATED INVESTIGATORS AND AFFILIATES BE LIABLE FOR INCIDENTAL OR CONSEQUENTIAL DAMAGES OF ANY KIND, INCLUDING, WITHOUT LIMITATION, ECONOMIC DAMAGES OR INJURY TO PROPERTY AND LOST PROFITS, REGARDLESS OF WHETHER BROAD SHALL BE ADVISED, SHALL HAVE OTHER REASON TO KNOW, OR IN FACT SHALL KNOW OF THE POSSIBILITY OF THE FOREGOING.
|
||||||
|
*
|
||||||
|
* 6. ASSIGNMENT
|
||||||
|
* This Agreement is personal to LICENSEE and any rights or obligations assigned by LICENSEE without the prior written consent of BROAD shall be null and void.
|
||||||
|
*
|
||||||
|
* 7. MISCELLANEOUS
|
||||||
|
* 7.1 Export Control. LICENSEE gives assurance that it will comply with all United States export control laws and regulations controlling the export of the PROGRAM, including, without limitation, all Export Administration Regulations of the United States Department of Commerce. Among other things, these laws and regulations prohibit, or require a license for, the export of certain types of software to specified countries.
|
||||||
|
* 7.2 Termination. LICENSEE shall have the right to terminate this Agreement for any reason upon prior written notice to BROAD. If LICENSEE breaches any provision hereunder, and fails to cure such breach within thirty (30) days, BROAD may terminate this Agreement immediately. Upon termination, LICENSEE shall provide BROAD with written assurance that the original and all copies of the PROGRAM have been destroyed, except that, upon prior written authorization from BROAD, LICENSEE may retain a copy for archive purposes.
|
||||||
|
* 7.3 Survival. The following provisions shall survive the expiration or termination of this Agreement: Articles 1, 3, 4, 5 and Sections 2.2, 2.3, 7.3, and 7.4.
|
||||||
|
* 7.4 Notice. Any notices under this Agreement shall be in writing, shall specifically refer to this Agreement, and shall be sent by hand, recognized national overnight courier, confirmed facsimile transmission, confirmed electronic mail, or registered or certified mail, postage prepaid, return receipt requested. All notices under this Agreement shall be deemed effective upon receipt.
|
||||||
|
* 7.5 Amendment and Waiver; Entire Agreement. This Agreement may be amended, supplemented, or otherwise modified only by means of a written instrument signed by all parties. Any waiver of any rights or failure to act in a specific instance shall relate only to such instance and shall not be construed as an agreement to waive any rights or fail to act in any other instance, whether or not similar. This Agreement constitutes the entire agreement among the parties with respect to its subject matter and supersedes prior agreements or understandings between the parties relating to its subject matter.
|
||||||
|
* 7.6 Binding Effect; Headings. This Agreement shall be binding upon and inure to the benefit of the parties and their respective permitted successors and assigns. All headings are for convenience only and shall not affect the meaning of any provision of this Agreement.
|
||||||
|
* 7.7 Governing Law. This Agreement shall be construed, governed, interpreted and applied in accordance with the internal laws of the Commonwealth of Massachusetts, U.S.A., without regard to conflict of laws principles.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package org.broadinstitute.sting.gatk.walkers.diagnostics.diagnosetargets;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author Mauricio Carneiro
|
||||||
|
* @since 4/23/13
|
||||||
|
*/
|
||||||
|
interface Statistic {
|
||||||
|
public void initialize(ThresHolder thresholds);
|
||||||
|
public CallableStatus status (AbstractStatistics statistic);
|
||||||
|
}
|
||||||
|
|
@ -114,9 +114,9 @@ final class ThresHolder {
|
||||||
@Argument(fullName = "quality_status_threshold", shortName = "stQ", doc = "The proportion of the loci needed for calling POOR_QUALITY", required = false)
|
@Argument(fullName = "quality_status_threshold", shortName = "stQ", doc = "The proportion of the loci needed for calling POOR_QUALITY", required = false)
|
||||||
public double qualityStatusThreshold = 0.50;
|
public double qualityStatusThreshold = 0.50;
|
||||||
|
|
||||||
public final List<Locus> locusStatisticList = new LinkedList<Locus>();
|
public final List<Statistic> locusStatisticList = new LinkedList<Statistic>();
|
||||||
public final List<Sample> sampleStatisticList = new LinkedList<Sample>();
|
public final List<Statistic> sampleStatisticList = new LinkedList<Statistic>();
|
||||||
public final List<Interval> intervalStatisticList = new LinkedList<Interval>();
|
public final List<Statistic> intervalStatisticList = new LinkedList<Statistic>();
|
||||||
|
|
||||||
public ThresHolder() {}
|
public ThresHolder() {}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue