Moving VE2 to core; calling it "VariantEval" (one more checkin coming)
git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@3179 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
parent
ac6f6363ce
commit
e702bea99f
|
|
@ -1,4 +1,4 @@
|
|||
package org.broadinstitute.sting.oneoffprojects.walkers.varianteval2;
|
||||
package org.broadinstitute.sting.gatk.walkers.varianteval;
|
||||
|
||||
import org.broadinstitute.sting.gatk.refdata.RefMetaDataTracker;
|
||||
import org.broadinstitute.sting.gatk.contexts.AlignmentContext;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.broadinstitute.sting.oneoffprojects.walkers.varianteval2;
|
||||
package org.broadinstitute.sting.gatk.walkers.varianteval;
|
||||
|
||||
import org.broadinstitute.sting.gatk.contexts.AlignmentContext;
|
||||
import org.broadinstitute.sting.gatk.contexts.ReferenceContext;
|
||||
|
|
@ -21,25 +21,25 @@ import org.broadinstitute.sting.playground.utils.report.tags.DataPoint;
|
|||
public class DbSNPPercentage extends VariantEvaluator {
|
||||
|
||||
@DataPoint(name = "DbSNP count", description = "number of DPSNP sites")
|
||||
private long nDBSNPs = 0;
|
||||
long nDBSNPs = 0;
|
||||
|
||||
@DataPoint(name = "total count", description = "number of total snp sites")
|
||||
private long nEvalSNPs = 0;
|
||||
long nEvalSNPs = 0;
|
||||
|
||||
@DataPoint(name = "novel snps", description = "number of total snp sites")
|
||||
private long novelSites = 0;
|
||||
long novelSites = 0;
|
||||
|
||||
@DataPoint(name = "snps at comp", description = "number of SNP sites at comp sites")
|
||||
private long nSNPsAtComp = 0;
|
||||
long nSNPsAtComp = 0;
|
||||
|
||||
@DataPoint(name = "% snps at comp", description = "percentage of SNP sites at comp sites")
|
||||
private double compRate = 0.0;
|
||||
double compRate = 0.0;
|
||||
|
||||
@DataPoint(name = "concordant", description = "number of concordant sites")
|
||||
private long nConcordant = 0;
|
||||
long nConcordant = 0;
|
||||
|
||||
@DataPoint(name = "% concordant", description = "the concordance rate")
|
||||
private double concordantRate = 0.0;
|
||||
double concordantRate = 0.0;
|
||||
|
||||
public DbSNPPercentage(VariantEval2Walker parent) {
|
||||
// don't do anything
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.broadinstitute.sting.oneoffprojects.walkers.varianteval2;
|
||||
package org.broadinstitute.sting.gatk.walkers.varianteval;
|
||||
|
||||
import org.broadinstitute.sting.gatk.contexts.*;
|
||||
import org.broadinstitute.sting.gatk.refdata.*;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.broadinstitute.sting.oneoffprojects.walkers.varianteval2;
|
||||
package org.broadinstitute.sting.gatk.walkers.varianteval;
|
||||
|
||||
import org.broadinstitute.sting.gatk.refdata.RefMetaDataTracker;
|
||||
import org.broadinstitute.sting.gatk.contexts.AlignmentContext;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.broadinstitute.sting.oneoffprojects.walkers.varianteval2;
|
||||
package org.broadinstitute.sting.gatk.walkers.varianteval;
|
||||
|
||||
import org.broadinstitute.sting.gatk.refdata.RefMetaDataTracker;
|
||||
import org.broadinstitute.sting.gatk.contexts.AlignmentContext;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.broadinstitute.sting.oneoffprojects.walkers.varianteval2;
|
||||
package org.broadinstitute.sting.gatk.walkers.varianteval;
|
||||
|
||||
import org.broadinstitute.sting.gatk.contexts.AlignmentContext;
|
||||
import org.broadinstitute.sting.gatk.contexts.ReferenceContext;
|
||||
|
|
@ -7,9 +7,6 @@ import org.broadinstitute.sting.gatk.contexts.variantcontext.VariantContext;
|
|||
import org.broadinstitute.sting.playground.utils.report.tags.Analysis;
|
||||
import org.broadinstitute.sting.playground.utils.report.tags.DataPoint;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* The Broad Institute
|
||||
* SOFTWARE COPYRIGHT NOTICE AGREEMENT
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.broadinstitute.sting.oneoffprojects.walkers.varianteval2;
|
||||
package org.broadinstitute.sting.gatk.walkers.varianteval;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.broadinstitute.sting.gatk.contexts.AlignmentContext;
|
||||
|
|
@ -1,12 +1,10 @@
|
|||
package org.broadinstitute.sting.oneoffprojects.walkers.varianteval2;
|
||||
package org.broadinstitute.sting.gatk.walkers.varianteval;
|
||||
|
||||
import org.broadinstitute.sting.gatk.refdata.RefMetaDataTracker;
|
||||
import org.broadinstitute.sting.gatk.contexts.ReferenceContext;
|
||||
import org.broadinstitute.sting.gatk.contexts.AlignmentContext;
|
||||
import org.broadinstitute.sting.gatk.contexts.variantcontext.VariantContext;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* The Broad Institute
|
||||
* SOFTWARE COPYRIGHT NOTICE AGREEMENT
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.broadinstitute.sting.oneoffprojects.walkers.varianteval2;
|
||||
package org.broadinstitute.sting.gatk.walkers.varianteval;
|
||||
|
||||
import org.broadinstitute.sting.gatk.contexts.AlignmentContext;
|
||||
import org.broadinstitute.sting.gatk.contexts.ReferenceContext;
|
||||
|
|
@ -10,7 +10,7 @@ import org.broadinstitute.sting.gatk.walkers.DataSource;
|
|||
import org.broadinstitute.sting.gatk.walkers.RMD;
|
||||
import org.broadinstitute.sting.gatk.walkers.Requires;
|
||||
import org.broadinstitute.sting.gatk.walkers.RodWalker;
|
||||
import org.broadinstitute.sting.oneoffprojects.walkers.varianteval2.MendelianViolationEvaluator;
|
||||
import org.broadinstitute.sting.gatk.walkers.varianteval.MendelianViolationEvaluator;
|
||||
import org.broadinstitute.sting.utils.cmdLine.Argument;
|
||||
import org.broadinstitute.sting.utils.genotype.vcf.VCFWriter;
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ import org.broadinstitute.sting.gatk.walkers.DataSource;
|
|||
import org.broadinstitute.sting.gatk.walkers.RMD;
|
||||
import org.broadinstitute.sting.utils.*;
|
||||
import org.broadinstitute.sting.utils.cmdLine.Argument;
|
||||
import org.broadinstitute.sting.oneoffprojects.walkers.varianteval2.MendelianViolationEvaluator;
|
||||
import org.broadinstitute.sting.gatk.walkers.varianteval.MendelianViolationEvaluator;
|
||||
|
||||
import java.util.EnumSet;
|
||||
import java.util.Arrays;
|
||||
|
|
|
|||
|
|
@ -1,22 +1,17 @@
|
|||
package org.broadinstitute.sting.playground.gatk.walkers;
|
||||
|
||||
import net.sf.samtools.SAMRecord;
|
||||
import org.broadinstitute.sting.gatk.contexts.AlignmentContext;
|
||||
import org.broadinstitute.sting.gatk.contexts.ReferenceContext;
|
||||
import org.broadinstitute.sting.gatk.contexts.variantcontext.Genotype;
|
||||
import org.broadinstitute.sting.gatk.contexts.variantcontext.VariantContext;
|
||||
import org.broadinstitute.sting.gatk.contexts.variantcontext.Allele;
|
||||
import org.broadinstitute.sting.gatk.contexts.variantcontext.MutableVariantContext;
|
||||
import org.broadinstitute.sting.gatk.filters.ZeroMappingQualityReadFilter;
|
||||
import org.broadinstitute.sting.gatk.refdata.RefMetaDataTracker;
|
||||
import org.broadinstitute.sting.gatk.refdata.VariationRod;
|
||||
import org.broadinstitute.sting.gatk.refdata.VariantContextAdaptors;
|
||||
import org.broadinstitute.sting.gatk.walkers.*;
|
||||
import org.broadinstitute.sting.gatk.walkers.genotyper.UnifiedGenotyper;
|
||||
import org.broadinstitute.sting.gatk.walkers.genotyper.VariantCallContext;
|
||||
import org.broadinstitute.sting.gatk.walkers.genotyper.UnifiedGenotyperEngine;
|
||||
import org.broadinstitute.sting.gatk.walkers.genotyper.UnifiedArgumentCollection;
|
||||
import org.broadinstitute.sting.gatk.GenomeAnalysisEngine;
|
||||
import org.broadinstitute.sting.utils.cmdLine.Argument;
|
||||
import org.broadinstitute.sting.utils.cmdLine.ArgumentCollection;
|
||||
import org.broadinstitute.sting.utils.StingException;
|
||||
|
|
@ -24,9 +19,7 @@ import org.broadinstitute.sting.utils.QualityUtils;
|
|||
import org.broadinstitute.sting.utils.MathUtils;
|
||||
import org.broadinstitute.sting.utils.genotype.vcf.VCFGenotypeRecord;
|
||||
import org.broadinstitute.sting.utils.genotype.vcf.VCFWriter;
|
||||
import org.broadinstitute.sting.utils.genotype.GenotypeWriter;
|
||||
import org.broadinstitute.sting.utils.genotype.GenotypeWriterFactory;
|
||||
import org.broadinstitute.sting.oneoffprojects.walkers.varianteval2.MendelianViolationEvaluator;
|
||||
import org.broadinstitute.sting.gatk.walkers.varianteval.MendelianViolationEvaluator;
|
||||
|
||||
import java.util.*;
|
||||
import java.io.File;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
package org.broadinstitute.sting.oneoffprojects.walkers.varianteval2;
|
||||
package org.broadinstitute.sting.gatk.walkers.varianteval;
|
||||
|
||||
import org.broadinstitute.sting.WalkerTest;
|
||||
import org.junit.Test;
|
||||
|
|
@ -1,104 +0,0 @@
|
|||
package org.broadinstitute.sting.playground.gatk.walkers;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.Assert;
|
||||
import org.broadinstitute.sting.utils.genotype.Genotype;
|
||||
import org.broadinstitute.sting.utils.genotype.BasicGenotype;
|
||||
import org.broadinstitute.sting.utils.GenomeLoc;
|
||||
import org.broadinstitute.sting.utils.Pair;
|
||||
import org.broadinstitute.sting.gatk.walkers.varianteval.ConcordanceTruthTable;
|
||||
import org.broadinstitute.sting.BaseTest;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* Created by IntelliJ IDEA.
|
||||
* User: chartl
|
||||
* Date: Nov 19, 2009
|
||||
* Time: 9:40:51 AM
|
||||
* To change this template use File | Settings | File Templates.
|
||||
*/
|
||||
public class ConcordanceTruthTableUnitTest extends BaseTest {
|
||||
|
||||
@Test
|
||||
public void testAlleleFrequencyCalculation() {
|
||||
|
||||
ConcordanceTruthTable ctt = new ConcordanceTruthTable(3);
|
||||
// this will test the count of non-reference alleles at a T/G polymorphic site
|
||||
Genotype ref1 = new BasicGenotype(null,"GG","G",30);
|
||||
Genotype ref2 = new BasicGenotype(null,"GG","G",30);
|
||||
Genotype ref3 = new BasicGenotype(null,"GG","G",30);
|
||||
Genotype het1 = new BasicGenotype(null,"GT","G",32);
|
||||
Genotype het2 = new BasicGenotype(null,"GT","G",28);
|
||||
Genotype hom1 = new BasicGenotype(null,"TT","G",40);
|
||||
Genotype hom2 = new BasicGenotype(null,"TT","G",27);
|
||||
|
||||
List<Pair<Genotype,Genotype>> oneHom = new ArrayList<Pair<Genotype,Genotype>>(4);
|
||||
oneHom.add(new Pair<Genotype,Genotype>(ref1,null));
|
||||
oneHom.add(new Pair<Genotype,Genotype>(null,null));
|
||||
oneHom.add(new Pair<Genotype,Genotype>(ref2,null));
|
||||
oneHom.add(new Pair<Genotype,Genotype>(ref3,null));
|
||||
oneHom.add(new Pair<Genotype,Genotype>(hom2,null));
|
||||
|
||||
List<Pair<Genotype,Genotype>> oneHet = new ArrayList<Pair<Genotype,Genotype>>(4);
|
||||
oneHet.add(new Pair<Genotype,Genotype>(ref1,null));
|
||||
oneHet.add(new Pair<Genotype,Genotype>(ref2,null));
|
||||
oneHet.add(new Pair<Genotype,Genotype>(ref3,null));
|
||||
oneHet.add(new Pair<Genotype,Genotype>(null,null));
|
||||
oneHet.add(new Pair<Genotype,Genotype>(het1,null));
|
||||
|
||||
List<Pair<Genotype,Genotype>> twoHetOneHom = new ArrayList<Pair<Genotype,Genotype>>(5);
|
||||
twoHetOneHom.add(new Pair<Genotype,Genotype>(ref1,null));
|
||||
twoHetOneHom.add(new Pair<Genotype,Genotype>(ref2,null));
|
||||
twoHetOneHom.add(new Pair<Genotype,Genotype>(ref3,null));
|
||||
twoHetOneHom.add(new Pair<Genotype,Genotype>(het1,null));
|
||||
twoHetOneHom.add(new Pair<Genotype,Genotype>(het2,null));
|
||||
twoHetOneHom.add(new Pair<Genotype,Genotype>(hom1,null));
|
||||
|
||||
List<Pair<Genotype,Genotype>> twoHetTwoHom = new ArrayList<Pair<Genotype,Genotype>>(7);
|
||||
twoHetTwoHom.add(new Pair<Genotype,Genotype>(ref1,null));
|
||||
twoHetTwoHom.add(new Pair<Genotype,Genotype>(ref2,null));
|
||||
twoHetTwoHom.add(new Pair<Genotype,Genotype>(null,null));
|
||||
twoHetTwoHom.add(new Pair<Genotype,Genotype>(ref3,null));
|
||||
twoHetTwoHom.add(new Pair<Genotype,Genotype>(het1,null));
|
||||
twoHetTwoHom.add(new Pair<Genotype,Genotype>(het2,null));
|
||||
twoHetTwoHom.add(new Pair<Genotype,Genotype>(hom1,null));
|
||||
twoHetTwoHom.add(new Pair<Genotype,Genotype>(hom2,null));
|
||||
|
||||
List<Pair<Genotype,Genotype>> hetHomNoRef = new ArrayList<Pair<Genotype,Genotype>>(2);
|
||||
hetHomNoRef.add(new Pair<Genotype,Genotype>(het2,null));
|
||||
hetHomNoRef.add(new Pair<Genotype,Genotype>(hom2,null));
|
||||
|
||||
List<Pair<Genotype,Genotype>> homNoRef = new ArrayList<Pair<Genotype,Genotype>>(1);
|
||||
homNoRef.add(new Pair<Genotype,Genotype>(hom1,null));
|
||||
|
||||
Pair<Integer,Pair<Integer,Integer>> countShouldBeOne = ctt.getPooledAlleleFrequency(oneHet,'G');
|
||||
Pair<Integer,Pair<Integer,Integer>> countShouldBeTwo = ctt.getPooledAlleleFrequency(oneHom,'G');
|
||||
Pair<Integer,Pair<Integer,Integer>> countShouldBeFour = ctt.getPooledAlleleFrequency(twoHetOneHom,'G');
|
||||
Pair<Integer,Pair<Integer,Integer>> countShouldBeSix = ctt.getPooledAlleleFrequency(twoHetTwoHom,'G');
|
||||
Pair<Integer,Pair<Integer,Integer>> countShouldBeThree = ctt.getPooledAlleleFrequency(hetHomNoRef,'G');
|
||||
Pair<Integer,Pair<Integer,Integer>> countShouldBeTwoHereToo = ctt.getPooledAlleleFrequency(homNoRef, 'G');
|
||||
|
||||
int expecChips = 4+4+6+7+2+1;
|
||||
int numChips = countShouldBeOne.getSecond().getSecond() + countShouldBeTwo.getSecond().getSecond() +
|
||||
countShouldBeFour.getSecond().getSecond() + countShouldBeSix.getSecond().getSecond() +
|
||||
countShouldBeThree.getSecond().getSecond() + countShouldBeTwoHereToo.getSecond().getSecond();
|
||||
|
||||
|
||||
logger.warn("Testing single het");
|
||||
Assert.assertTrue(countShouldBeOne.getSecond().getFirst() == 1);
|
||||
logger.warn("Testing single hom");
|
||||
Assert.assertTrue(countShouldBeTwo.getSecond().getFirst() == 2);
|
||||
logger.warn("Testing two hets + hom");
|
||||
Assert.assertTrue(countShouldBeFour.getSecond().getFirst() == 4);
|
||||
logger.warn("Testing two hets + two homs");
|
||||
Assert.assertTrue(countShouldBeSix.getSecond().getFirst() == 6);
|
||||
logger.warn("Testing het + hom without ref");
|
||||
Assert.assertTrue(countShouldBeThree.getSecond().getFirst() == 3);
|
||||
logger.warn("Testing hom without ref");
|
||||
Assert.assertTrue(countShouldBeTwoHereToo.getSecond().getFirst() == 2);
|
||||
logger.warn("Testing chip count sum");
|
||||
Assert.assertTrue( expecChips == numChips);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue