From 8ca5bba738990ba3de94c45e1810d78f37a90799 Mon Sep 17 00:00:00 2001 From: ebanks Date: Wed, 13 Jan 2010 15:40:27 +0000 Subject: [PATCH] We emit genotype data in the VCF record if the format string instructs us to (regardless of whether or not genotypes are provided - this was the wrong test). SequenomToVCF now correctly has no-calls when probes fail. Re-enabled SequenomToVCF integration test. git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@2572 348d0f76-0448-11de-a6fe-93d51630548a --- .../sting/utils/genotype/vcf/VCFGenotypeWriterAdapter.java | 3 ++- .../broadinstitute/sting/utils/genotype/vcf/VCFRecord.java | 2 +- .../walkers/variantstovcf/SequenomToVCFIntegrationTest.java | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/java/src/org/broadinstitute/sting/utils/genotype/vcf/VCFGenotypeWriterAdapter.java b/java/src/org/broadinstitute/sting/utils/genotype/vcf/VCFGenotypeWriterAdapter.java index 5b67715da..2dc0fb46f 100644 --- a/java/src/org/broadinstitute/sting/utils/genotype/vcf/VCFGenotypeWriterAdapter.java +++ b/java/src/org/broadinstitute/sting/utils/genotype/vcf/VCFGenotypeWriterAdapter.java @@ -94,7 +94,8 @@ public class VCFGenotypeWriterAdapter implements VCFGenotypeWriter { throw new IllegalArgumentException("Only VCFVariationCall objects should be passed in to the VCF writers"); VCFParameters params = new VCFParameters(); - params.addFormatItem(VCFGenotypeRecord.GENOTYPE_KEY); + if ( genotypes.size() > 0 ) + params.addFormatItem(VCFGenotypeRecord.GENOTYPE_KEY); // get the location and reference if ( genotypes.size() == 0 ) { diff --git a/java/src/org/broadinstitute/sting/utils/genotype/vcf/VCFRecord.java b/java/src/org/broadinstitute/sting/utils/genotype/vcf/VCFRecord.java index db8f258db..e24245fd5 100644 --- a/java/src/org/broadinstitute/sting/utils/genotype/vcf/VCFRecord.java +++ b/java/src/org/broadinstitute/sting/utils/genotype/vcf/VCFRecord.java @@ -567,7 +567,7 @@ public class VCFRecord implements Variation, VariantBackedByGenotype { builder.append(FIELD_SEPERATOR); builder.append(createInfoString()); - if ( hasGenotypeData() ) { + if ( mGenotypeFormatString != null && mGenotypeFormatString.length() > 0 ) { try { addGenotypeData(builder, header); } catch (Exception e) { diff --git a/java/test/org/broadinstitute/sting/playground/gatk/walkers/variantstovcf/SequenomToVCFIntegrationTest.java b/java/test/org/broadinstitute/sting/playground/gatk/walkers/variantstovcf/SequenomToVCFIntegrationTest.java index 63bb55f10..33a8fa373 100644 --- a/java/test/org/broadinstitute/sting/playground/gatk/walkers/variantstovcf/SequenomToVCFIntegrationTest.java +++ b/java/test/org/broadinstitute/sting/playground/gatk/walkers/variantstovcf/SequenomToVCFIntegrationTest.java @@ -17,11 +17,11 @@ import java.util.List; public class SequenomToVCFIntegrationTest extends WalkerTest { @Test public void testSequenomToVCFWithoutSmartHardy() { - String testMD5 = "ed121c7a27270ddefeded21b06fcb96d"; + String testMD5 = "c6c2055d304674c2f7014c50f5cc160e"; String testPedFile = "/humgen/gsa-hpprojects/GATK/data/Validation_Data/Sequenom_Test_File.txt"; String testArgs = "-R "+oneKGLocation+"reference/human_b36_both.fasta -L 1:1000000-2000000 "+ "-T SequenomToVCF -b36contig -ns 10 -sPed "+testPedFile+" -vcf %s"; WalkerTest.WalkerTestSpec spec = new WalkerTestSpec(testArgs,1, Arrays.asList(testMD5)); - //List result = executeTest("TestSequenomToVCFNoSmartHardy",spec).getFirst(); + List result = executeTest("TestSequenomToVCFNoSmartHardy",spec).getFirst(); } }