Some minor changes and test:
- DepthOfCoverage is now by reference (so locus-by-locus output correctly reports zero-coverage bases)
- VariantsToVCF now lets you bind variants with any string except intervals and dbsnp (not just NA######)
- A PileupWalker integration test on a particularly nasty FHS site
- Two second-base annotation related integration tests on that same site
+ outputs were all hand-validated in matlab; within a certain tolerance for the annotations
git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@2197 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
parent
084337087e
commit
21a9a717e4
|
|
@ -23,7 +23,8 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.broadinstitute.sting.gatk.walkers;
|
package org.broadinstitute.sting.gatk.walkers;
|
||||||
|
import org.broadinstitute.sting.gatk.walkers.DataSource;
|
||||||
|
import org.broadinstitute.sting.gatk.walkers.By;
|
||||||
import org.broadinstitute.sting.gatk.contexts.AlignmentContext;
|
import org.broadinstitute.sting.gatk.contexts.AlignmentContext;
|
||||||
import org.broadinstitute.sting.gatk.contexts.ReferenceContext;
|
import org.broadinstitute.sting.gatk.contexts.ReferenceContext;
|
||||||
import org.broadinstitute.sting.gatk.refdata.RefMetaDataTracker;
|
import org.broadinstitute.sting.gatk.refdata.RefMetaDataTracker;
|
||||||
|
|
@ -39,6 +40,7 @@ import java.util.ArrayList;
|
||||||
/**
|
/**
|
||||||
* Display the depth of coverage at a given locus.
|
* Display the depth of coverage at a given locus.
|
||||||
*/
|
*/
|
||||||
|
@By(DataSource.REFERENCE)
|
||||||
public class DepthOfCoverageWalker extends LocusWalker<Integer, Pair<Long, Long>> {
|
public class DepthOfCoverageWalker extends LocusWalker<Integer, Pair<Long, Long>> {
|
||||||
enum printType {
|
enum printType {
|
||||||
NONE,
|
NONE,
|
||||||
|
|
@ -131,4 +133,4 @@ public class DepthOfCoverageWalker extends LocusWalker<Integer, Pair<Long, Long>
|
||||||
out.printf("Average depth of coverage is: %.2f in %d total coverage over %d sites\n",
|
out.printf("Average depth of coverage is: %.2f in %d total coverage over %d sites\n",
|
||||||
((double)result.getFirst() / (double)result.getSecond()), result.getFirst(), result.getSecond());
|
((double)result.getFirst() / (double)result.getSecond()), result.getFirst(), result.getSecond());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -39,8 +39,10 @@ public class VariantsToVCF extends RefWalker<Integer, Integer> {
|
||||||
String[] rodPieces = rodName.split(",");
|
String[] rodPieces = rodName.split(",");
|
||||||
String sampleName = rodPieces[0];
|
String sampleName = rodPieces[0];
|
||||||
|
|
||||||
if (sampleName.startsWith("NA"))
|
if (! ( sampleName.equals("dbSNP") || sampleName.equals("interval") ) ) {
|
||||||
sampleNames.put(sampleName.toUpperCase(), sampleName.toUpperCase());
|
sampleNames.put(sampleName, sampleName);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
vcfheader = getHeader(args, sampleNames.keySet());
|
vcfheader = getHeader(args, sampleNames.keySet());
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,26 @@
|
||||||
|
package org.broadinstitute.sting.gatk.walkers;
|
||||||
|
|
||||||
|
import org.broadinstitute.sting.WalkerTest;
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by IntelliJ IDEA.
|
||||||
|
* User: chartl
|
||||||
|
* Date: Dec 1, 2009
|
||||||
|
* Time: 9:03:34 AM
|
||||||
|
* To change this template use File | Settings | File Templates.
|
||||||
|
*/
|
||||||
|
public class PileupWalkerIntegrationTest extends WalkerTest {
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testGnarleyFHSPileup() {
|
||||||
|
String gatk_args = "-T Pileup -I /humgen/gsa-scr1/GATK_Data/Validation_Data/FHS_Pileup_Test.bam "
|
||||||
|
+ "-R /seq/references/Homo_sapiens_assembly18/v0/Homo_sapiens_assembly18.fasta"
|
||||||
|
+ " -L chr15:46,347,148 -o %s";
|
||||||
|
String expected_md5 = "98040c47b623bb133cd296ce12768d49";
|
||||||
|
WalkerTestSpec spec = new WalkerTestSpec(gatk_args, 1, Arrays.asList(expected_md5));
|
||||||
|
executeTest("Testing the standard (no-indel) pileup on three merged FHS pools with 27 deletions in 969 bases", spec);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -55,4 +55,26 @@ public class SecondBaseSkewIntegrationTest extends WalkerTest {
|
||||||
executeTest("Testing on bam file without 2bb annotations ",spec);
|
executeTest("Testing on bam file without 2bb annotations ",spec);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testOnIndels() {
|
||||||
|
String test_args = "-T VariantAnnotator -I /humgen/gsa-scr1/GATK_Data/Validation_Data/FHS_Pileup_Test.bam"
|
||||||
|
+ " -R /seq/references/Homo_sapiens_assembly18/v0/Homo_sapiens_assembly18.fasta -A SecondBaseSkew"
|
||||||
|
+ " -sample variant -B variant,VCF,/humgen/gsa-scr1/GATK_Data/Validation_Data/FHS_pileup_test_chr15.vcf"
|
||||||
|
+ " -vcf %s -L chr15:46347148";
|
||||||
|
String expected_md5 = "fe7f6d2b48ecf2c1340b5de98a9d5614";
|
||||||
|
WalkerTestSpec spec = new WalkerTestSpec(test_args,1,Arrays.asList(expected_md5));
|
||||||
|
executeTest("Testing on locus with many indels", spec);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testPrimaryBaseSecondaryBaseOnIndels() {
|
||||||
|
String test_args = "-T VariantAnnotator -I /humgen/gsa-scr1/GATK_Data/Validation_Data/FHS_Pileup_Test.bam"
|
||||||
|
+ " -R /seq/references/Homo_sapiens_assembly18/v0/Homo_sapiens_assembly18.fasta -A PrimaryBaseSecondaryBaseSymmetry"
|
||||||
|
+ " -sample variant -B variant,VCF,/humgen/gsa-scr1/GATK_Data/Validation_Data/FHS_pileup_test_chr15.vcf"
|
||||||
|
+ " -vcf %s -L chr15:46347148";
|
||||||
|
String expected_md5 = "9b587be7a270c6df7e0affcfc61a861a";
|
||||||
|
WalkerTestSpec spec = new WalkerTestSpec(test_args,1,Arrays.asList(expected_md5));
|
||||||
|
executeTest("Testing PrimaryBaseSecondaryBaseSymmetry on locus with many indels", spec);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue