- Read in arguments for the header based on reflection

- Hook up Variation and Genotype in SSG



git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@2300 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
ebanks 2009-12-09 21:35:33 +00:00
parent 8825211fdb
commit f7c44ad019
3 changed files with 23 additions and 28 deletions

View File

@ -72,7 +72,6 @@ public class PointEstimateGenotypeCalculationModel extends EMGenotypeCalculation
// we can now create the genotype call object // we can now create the genotype call object
GenotypeCall call = GenotypeWriterFactory.createSupportedGenotypeCall(OUTPUT_FORMAT, ref, context.getLocation()); GenotypeCall call = GenotypeWriterFactory.createSupportedGenotypeCall(OUTPUT_FORMAT, ref, context.getLocation());
call.setVariation(null);
if ( call instanceof ReadBacked ) { if ( call instanceof ReadBacked ) {
((ReadBacked)call).setPileup(discoveryGL.first); ((ReadBacked)call).setPileup(discoveryGL.first);
@ -97,7 +96,10 @@ public class PointEstimateGenotypeCalculationModel extends EMGenotypeCalculation
if ( dbsnp != null ) if ( dbsnp != null )
((IDBacked)locusdata).setID(dbsnp.getRS_ID()); ((IDBacked)locusdata).setID(dbsnp.getRS_ID());
} }
locusdata.setGenotypeCalls(Arrays.asList((Genotype)call));
} }
call.setVariation(locusdata);
return new Pair<VariationCall, List<Genotype>>(locusdata, Arrays.asList((Genotype)call)); return new Pair<VariationCall, List<Genotype>>(locusdata, Arrays.asList((Genotype)call));
} }

View File

@ -33,15 +33,14 @@ import org.broadinstitute.sting.gatk.walkers.LocusWalker;
import org.broadinstitute.sting.gatk.walkers.annotator.VariantAnnotator; import org.broadinstitute.sting.gatk.walkers.annotator.VariantAnnotator;
import org.broadinstitute.sting.gatk.walkers.Reference; import org.broadinstitute.sting.gatk.walkers.Reference;
import org.broadinstitute.sting.gatk.walkers.Window; import org.broadinstitute.sting.gatk.walkers.Window;
import org.broadinstitute.sting.utils.BaseUtils; import org.broadinstitute.sting.utils.*;
import org.broadinstitute.sting.utils.Pair; import org.broadinstitute.sting.utils.cmdLine.*;
import org.broadinstitute.sting.utils.cmdLine.Argument;
import org.broadinstitute.sting.utils.cmdLine.ArgumentCollection;
import org.broadinstitute.sting.utils.genotype.*; import org.broadinstitute.sting.utils.genotype.*;
import org.broadinstitute.sting.utils.genotype.vcf.VCFGenotypeRecord; import org.broadinstitute.sting.utils.genotype.vcf.VCFGenotypeRecord;
import java.io.File; import java.io.File;
import java.util.*; import java.util.*;
import java.lang.reflect.Field;
@Reference(window=@Window(start=-20,stop=20)) @Reference(window=@Window(start=-20,stop=20))
@ -173,24 +172,18 @@ public class UnifiedGenotyper extends LocusWalker<Pair<VariationCall, List<Genot
if ( !UAC.NO_SLOD ) if ( !UAC.NO_SLOD )
headerInfo.add("INFO=SB,1,Float,\"Strand Bias\""); headerInfo.add("INFO=SB,1,Float,\"Strand Bias\"");
// FORMAT fields if not in POOLED mode
if ( UAC.genotypeModel != GenotypeCalculationModel.Model.POOLED ) if ( UAC.genotypeModel != GenotypeCalculationModel.Model.POOLED )
headerInfo.addAll(VCFGenotypeRecord.getSupportedHeaderStrings()); headerInfo.addAll(VCFGenotypeRecord.getSupportedHeaderStrings());
// TODO -- clean this up // all of the arguments from the argument collection
headerInfo.add("UG_genotype_model=" + UAC.genotypeModel); Field[] fields = UAC.getClass().getFields();
headerInfo.add("UG_base_model=" + UAC.baseModel); for ( Field field: fields ) {
headerInfo.add("UG_heterozygosity=" + UAC.heterozygosity); ArgumentTypeDescriptor atd = ArgumentTypeDescriptor.create(field.getType());
headerInfo.add("UG_genotype_mode=" + UAC.GENOTYPE); List<ArgumentDefinition> adList = atd.createArgumentDefinitions(new ArgumentSource(field.getType(), field));
headerInfo.add("UG_all_bases_mode=" + UAC.ALL_BASES); for ( ArgumentDefinition ad : adList )
headerInfo.add("UG_min_confidence=" + UAC.CONFIDENCE_THRESHOLD); headerInfo.add("UG_" + ad.fullName + "=" + JVMUtils.getFieldValue(field, UAC));
headerInfo.add("UG_max_deletion_fraction=" + UAC.MAX_DELETION_FRACTION); }
headerInfo.add("UG_max_coverage=" + UAC.MAX_READS_IN_PILEUP);
if ( UAC.POOLSIZE > 0 )
headerInfo.add("UG_poolSize=" + UAC.POOLSIZE);
if ( UAC.ASSUME_SINGLE_SAMPLE != null )
headerInfo.add("UG_single_sample=" + UAC.ASSUME_SINGLE_SAMPLE);
if ( UAC.defaultPlatform != null )
headerInfo.add("UG_default_platform=" + UAC.defaultPlatform);
return headerInfo; return headerInfo;
} }

View File

@ -47,7 +47,7 @@ public class UnifiedGenotyperIntegrationTest extends WalkerTest {
public void testMultiSamplePilot1PointEM() { public void testMultiSamplePilot1PointEM() {
WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec( WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec(
"-T UnifiedGenotyper -R /broad/1KG/reference/human_b36_both.fasta -I /humgen/gsa-scr1/GATK_Data/Validation_Data/low_coverage_CEU.chr1.10k-11k.bam -varout %s -L 1:10,023,400-10,024,000 -bm empirical -gm EM_POINT_ESTIMATE -confidence 30", 1, "-T UnifiedGenotyper -R /broad/1KG/reference/human_b36_both.fasta -I /humgen/gsa-scr1/GATK_Data/Validation_Data/low_coverage_CEU.chr1.10k-11k.bam -varout %s -L 1:10,023,400-10,024,000 -bm empirical -gm EM_POINT_ESTIMATE -confidence 30", 1,
Arrays.asList("c7aec953aac01101f0556db166178590")); Arrays.asList("12d07018d9604b86b854e0c9132b0608"));
executeTest("testMultiSamplePilot1 - Point Estimate EM", spec); executeTest("testMultiSamplePilot1 - Point Estimate EM", spec);
} }
@ -55,7 +55,7 @@ public class UnifiedGenotyperIntegrationTest extends WalkerTest {
public void testMultiSamplePilot2PointEM() { public void testMultiSamplePilot2PointEM() {
WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec( WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec(
"-T UnifiedGenotyper -R /broad/1KG/reference/human_b36_both.fasta -I /humgen/gsa-scr1/GATK_Data/Validation_Data/pilot2_daughters.chr20.10k-11k.bam -varout %s -L 20:10,000,000-10,010,000 -bm empirical -gm EM_POINT_ESTIMATE -confidence 30", 1, "-T UnifiedGenotyper -R /broad/1KG/reference/human_b36_both.fasta -I /humgen/gsa-scr1/GATK_Data/Validation_Data/pilot2_daughters.chr20.10k-11k.bam -varout %s -L 20:10,000,000-10,010,000 -bm empirical -gm EM_POINT_ESTIMATE -confidence 30", 1,
Arrays.asList("e03b5ac5821dc0e0da3cc8a1f686ec6b")); Arrays.asList("65a808f077447f89e001e1cce8433acc"));
executeTest("testMultiSamplePilot2 - Point Estimate EM", spec); executeTest("testMultiSamplePilot2 - Point Estimate EM", spec);
} }
@ -68,7 +68,7 @@ public class UnifiedGenotyperIntegrationTest extends WalkerTest {
public void testPooled1() { public void testPooled1() {
WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec( WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec(
"-T UnifiedGenotyper -R /broad/1KG/reference/human_b36_both.fasta -I /humgen/gsa-scr1/GATK_Data/Validation_Data/low_coverage_CEU.chr1.10k-11k.bam -varout %s -L 1:10,023,000-10,024,000 -bm empirical -gm POOLED -ps 60 -confidence 30", 1, "-T UnifiedGenotyper -R /broad/1KG/reference/human_b36_both.fasta -I /humgen/gsa-scr1/GATK_Data/Validation_Data/low_coverage_CEU.chr1.10k-11k.bam -varout %s -L 1:10,023,000-10,024,000 -bm empirical -gm POOLED -ps 60 -confidence 30", 1,
Arrays.asList("d7579207d2521f36648b2b43be805bc4")); Arrays.asList("4890ce37667379a0b60892cb0b9d8e09"));
executeTest("testPooled1", spec); executeTest("testPooled1", spec);
} }
@ -81,7 +81,7 @@ public class UnifiedGenotyperIntegrationTest extends WalkerTest {
public void testMultiSamplePilot1Joint() { public void testMultiSamplePilot1Joint() {
WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec( WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec(
"-T UnifiedGenotyper -R /broad/1KG/reference/human_b36_both.fasta -I /humgen/gsa-scr1/GATK_Data/Validation_Data/low_coverage_CEU.chr1.10k-11k.bam -varout %s -L 1:10,022,000-10,025,000 -bm empirical -gm JOINT_ESTIMATE -confidence 30", 1, "-T UnifiedGenotyper -R /broad/1KG/reference/human_b36_both.fasta -I /humgen/gsa-scr1/GATK_Data/Validation_Data/low_coverage_CEU.chr1.10k-11k.bam -varout %s -L 1:10,022,000-10,025,000 -bm empirical -gm JOINT_ESTIMATE -confidence 30", 1,
Arrays.asList("d1076029884939017817061cfd06d8ff")); Arrays.asList("fd5291c7115a558a7a6309ab417d2d57"));
executeTest("testMultiSamplePilot1 - Joint Estimate", spec); executeTest("testMultiSamplePilot1 - Joint Estimate", spec);
} }
@ -89,7 +89,7 @@ public class UnifiedGenotyperIntegrationTest extends WalkerTest {
public void testMultiSamplePilot2Joint() { public void testMultiSamplePilot2Joint() {
WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec( WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec(
"-T UnifiedGenotyper -R /broad/1KG/reference/human_b36_both.fasta -I /humgen/gsa-scr1/GATK_Data/Validation_Data/pilot2_daughters.chr20.10k-11k.bam -varout %s -L 20:10,000,000-10,050,000 -bm empirical -gm JOINT_ESTIMATE -confidence 30", 1, "-T UnifiedGenotyper -R /broad/1KG/reference/human_b36_both.fasta -I /humgen/gsa-scr1/GATK_Data/Validation_Data/pilot2_daughters.chr20.10k-11k.bam -varout %s -L 20:10,000,000-10,050,000 -bm empirical -gm JOINT_ESTIMATE -confidence 30", 1,
Arrays.asList("58422eb06214282fc6e9efbf52937e1e")); Arrays.asList("58ddc9426a25d0c3604af8da4eaa8294"));
executeTest("testMultiSamplePilot2 - Joint Estimate", spec); executeTest("testMultiSamplePilot2 - Joint Estimate", spec);
} }
@ -97,7 +97,7 @@ public class UnifiedGenotyperIntegrationTest extends WalkerTest {
public void testSingleSamplePilot2Joint() { public void testSingleSamplePilot2Joint() {
WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec( WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec(
"-T UnifiedGenotyper -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 -varout %s -L 1:10,000,000-10,100,000 -bm empirical -gm JOINT_ESTIMATE -confidence 30", 1, "-T UnifiedGenotyper -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 -varout %s -L 1:10,000,000-10,100,000 -bm empirical -gm JOINT_ESTIMATE -confidence 30", 1,
Arrays.asList("27fadaf914ad7fbc83d4f8367f43bc40")); Arrays.asList("52e7030fe0968cd1a9b95154d8056b3f"));
executeTest("testSingleSamplePilot2 - Joint Estimate", spec); executeTest("testSingleSamplePilot2 - Joint Estimate", spec);
} }
@ -105,7 +105,7 @@ public class UnifiedGenotyperIntegrationTest extends WalkerTest {
public void testGenotypeModeJoint() { public void testGenotypeModeJoint() {
WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec( WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec(
"-T UnifiedGenotyper -genotype -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 -varout %s -L 1:10,000,000-10,001,000 -bm empirical -gm JOINT_ESTIMATE -confidence 70", 1, "-T UnifiedGenotyper -genotype -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 -varout %s -L 1:10,000,000-10,001,000 -bm empirical -gm JOINT_ESTIMATE -confidence 70", 1,
Arrays.asList("6971e0bfa524c0e006b3c3ccef52520a")); Arrays.asList("1ac9c9c8be0eb6adee7c67fac7c19c0d"));
executeTest("testGenotypeMode - Joint Estimate", spec); executeTest("testGenotypeMode - Joint Estimate", spec);
} }
@ -113,7 +113,7 @@ public class UnifiedGenotyperIntegrationTest extends WalkerTest {
public void testAllBasesModeJoint() { public void testAllBasesModeJoint() {
WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec( WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec(
"-T UnifiedGenotyper -all_bases -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 -varout %s -L 1:10,000,000-10,001,000 -bm empirical -gm JOINT_ESTIMATE -confidence 70", 1, "-T UnifiedGenotyper -all_bases -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 -varout %s -L 1:10,000,000-10,001,000 -bm empirical -gm JOINT_ESTIMATE -confidence 70", 1,
Arrays.asList("9f54482c1594bdd1e28b4cf2e51f944f")); Arrays.asList("37177e194a602749d31e5ecbf80ad309"));
executeTest("testAllBasesMode - Joint Estimate", spec); executeTest("testAllBasesMode - Joint Estimate", spec);
} }