Integration tests actually run on real data now.

<tries to hide sheepish grin>


git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@2061 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
ebanks 2009-11-17 21:04:14 +00:00
parent 5e126875ea
commit 4d9c826766
2 changed files with 53 additions and 18 deletions

View File

@ -155,7 +155,10 @@ public class VariantAnnotator extends RodWalker<Integer, Integer> {
VariationRod variant = (VariationRod)rods.getRecords().get(0);
// if the reference base is not ambiguous, the variant is a SNP, and it's the appropriate type, we can annotate
if ( BaseUtils.simpleBaseToBaseIndex(ref.getBase()) != -1 && variant.isSNP() && variant instanceof VariantBackedByGenotype ) {
if ( BaseUtils.simpleBaseToBaseIndex(ref.getBase()) != -1 &&
variant.isBiallelic() &&
variant.isSNP() &&
variant instanceof VariantBackedByGenotype ) {
final List<org.broadinstitute.sting.utils.genotype.Genotype> genotypes = ((VariantBackedByGenotype)variant).getGenotypes();
if ( genotypes != null )
annotations = getAnnotations(ref, context, genotypes, requestedAnnotations);

View File

@ -7,38 +7,70 @@ import java.util.Arrays;
public class VariantAnnotatorIntegrationTest extends WalkerTest {
public static String baseTestString() {
return "-T VariantAnnotator -R /broad/1KG/reference/human_b36_both.fasta -I /humgen/gsa-scr1/GATK_Data/Validation_Data/NA12878.1kg.p2.chr1_10mb_11_mb.SLX.bam -L 1:10,000,000-10,010,000 -vcf %s";
return "-T VariantAnnotator -R /broad/1KG/reference/human_b36_both.fasta -vcf %s";
}
@Test
public void testNoAnnots1() {
public void testHasAnnotsNotAsking1() {
WalkerTestSpec spec = new WalkerTestSpec(
baseTestString() + " -B variant,VCF,/humgen/gsa-scr1/GATK_Data/Validation_Data/vcfexample2.vcf ", 1,
Arrays.asList("4e231f16c202d88ca3adb17168af0e0f"));
//executeTest("testNoAnnots1", spec);
baseTestString() + " -B variant,VCF,/humgen/gsa-scr1/GATK_Data/Validation_Data/vcfexample2.vcf -I /humgen/gsa-scr1/GATK_Data/Validation_Data/low_coverage_CEU.chr1.10k-11k.bam -L 1:10,020,000-10,021,000", 1,
Arrays.asList("4d7e6670ec71e3b7065ca7e25855189d"));
executeTest("test file has annotations, not asking for annotations, #1", spec);
}
@Test
public void testNoAnnots2() {
public void testHasAnnotsNotAsking2() {
WalkerTestSpec spec = new WalkerTestSpec(
baseTestString() + " -B variant,VCF,/humgen/gsa-scr1/GATK_Data/Validation_Data/vcfexample3.vcf ", 1,
Arrays.asList("ef0c59e47a2afcbecf2bcef6aa01e7e7"));
//executeTest("testNoAnnots2", spec);
baseTestString() + " -B variant,VCF,/humgen/gsa-scr1/GATK_Data/Validation_Data/vcfexample3.vcf -I /humgen/gsa-scr1/GATK_Data/Validation_Data/NA12878.1kg.p2.chr1_10mb_11_mb.SLX.bam -L 1:10,000,000-10,050,000", 1,
Arrays.asList("227f38b2f322780187eacd0c98ace3e6"));
executeTest("test file has annotations, not asking for annotations, #2", spec);
}
@Test
public void testAllAnnots1() {
public void testHasAnnotsAsking1() {
WalkerTestSpec spec = new WalkerTestSpec(
baseTestString() + " -all -B variant,VCF,/humgen/gsa-scr1/GATK_Data/Validation_Data/vcfexample2.vcf ", 1,
Arrays.asList("ced92b5ac9e2692c4d8acce1235317b6"));
//executeTest("testAllAnnots1", spec);
baseTestString() + " -all -B variant,VCF,/humgen/gsa-scr1/GATK_Data/Validation_Data/vcfexample2.vcf -I /humgen/gsa-scr1/GATK_Data/Validation_Data/low_coverage_CEU.chr1.10k-11k.bam -L 1:10,020,000-10,021,000", 1,
Arrays.asList("94103b529e013748696be3e5dd0d90ee"));
executeTest("test file has annotations, asking for annotations, #1", spec);
}
@Test
public void testAllAnnots2() {
public void testHasAnnotsAsking2() {
WalkerTestSpec spec = new WalkerTestSpec(
baseTestString() + " -all -B variant,VCF,/humgen/gsa-scr1/GATK_Data/Validation_Data/vcfexample3.vcf ", 1,
Arrays.asList("573a6c02f659b2c4cf014f84bd0b9c8a"));
//executeTest("testAllAnnots2", spec);
baseTestString() + " -all -B variant,VCF,/humgen/gsa-scr1/GATK_Data/Validation_Data/vcfexample3.vcf -I /humgen/gsa-scr1/GATK_Data/Validation_Data/NA12878.1kg.p2.chr1_10mb_11_mb.SLX.bam -L 1:10,000,000-10,050,000", 1,
Arrays.asList("227f38b2f322780187eacd0c98ace3e6"));
executeTest("test file has annotations, asking for annotations, #2", spec);
}
@Test
public void testNoAnnotsNotAsking1() {
WalkerTestSpec spec = new WalkerTestSpec(
baseTestString() + " -B variant,VCF,/humgen/gsa-scr1/GATK_Data/Validation_Data/vcfexample2empty.vcf -I /humgen/gsa-scr1/GATK_Data/Validation_Data/low_coverage_CEU.chr1.10k-11k.bam -L 1:10,020,000-10,021,000", 1,
Arrays.asList("386ab9b98b708a840a1ae915624777d5"));
executeTest("test file doesn't have annotations, not asking for annotations, #1", spec);
}
@Test
public void testNoAnnotsNotAsking2() {
WalkerTestSpec spec = new WalkerTestSpec(
baseTestString() + " -B variant,VCF,/humgen/gsa-scr1/GATK_Data/Validation_Data/vcfexample3empty.vcf -I /humgen/gsa-scr1/GATK_Data/Validation_Data/NA12878.1kg.p2.chr1_10mb_11_mb.SLX.bam -L 1:10,000,000-10,050,000", 1,
Arrays.asList("da51f18d189fb0fd804822c81b786e0f"));
executeTest("test file doesn't have annotations, not asking for annotations, #2", spec);
}
@Test
public void testNoAnnotsAsking1() {
WalkerTestSpec spec = new WalkerTestSpec(
baseTestString() + " -all -B variant,VCF,/humgen/gsa-scr1/GATK_Data/Validation_Data/vcfexample2empty.vcf -I /humgen/gsa-scr1/GATK_Data/Validation_Data/low_coverage_CEU.chr1.10k-11k.bam -L 1:10,020,000-10,021,000", 1,
Arrays.asList("cf2f60758269759f7be79ad18b12771b"));
executeTest("test file doesn't have annotations, asking for annotations, #1", spec);
}
@Test
public void testNoAnnotsAsking2() {
WalkerTestSpec spec = new WalkerTestSpec(
baseTestString() + " -all -B variant,VCF,/humgen/gsa-scr1/GATK_Data/Validation_Data/vcfexample3empty.vcf -I /humgen/gsa-scr1/GATK_Data/Validation_Data/NA12878.1kg.p2.chr1_10mb_11_mb.SLX.bam -L 1:10,000,000-10,050,000", 1,
Arrays.asList("1ed34e09afbc25e034597a97c7861077"));
executeTest("test file doesn't have annotations, asking for annotations, #2", spec);
}
}