Fixing the AC annotation to be in line with the VCF spec
git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@2593 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
parent
f2e539c52f
commit
b911b7df82
|
|
@ -9,7 +9,6 @@ import org.broadinstitute.sting.gatk.refdata.rodDbSNP;
|
|||
import org.broadinstitute.sting.gatk.contexts.*;
|
||||
|
||||
import java.util.*;
|
||||
import java.io.PrintWriter;
|
||||
|
||||
public abstract class JointEstimateGenotypeCalculationModel extends GenotypeCalculationModel {
|
||||
|
||||
|
|
|
|||
|
|
@ -194,7 +194,7 @@ public class UnifiedGenotyper extends LocusWalker<Pair<VariationCall, List<Genot
|
|||
// FORMAT fields if not in POOLED mode
|
||||
if ( UAC.genotypeModel != GenotypeCalculationModel.Model.POOLED ) {
|
||||
headerInfo.addAll(VCFGenotypeRecord.getSupportedHeaderStrings());
|
||||
headerInfo.add(new VCFInfoHeaderLine(VCFRecord.ALLELE_COUNT_KEY, 2, VCFInfoHeaderLine.INFO_TYPE.Integer, "Allele count in genotypes, for each ALT allele, in the same order as listed"));
|
||||
headerInfo.add(new VCFInfoHeaderLine(VCFRecord.ALLELE_COUNT_KEY, 1, VCFInfoHeaderLine.INFO_TYPE.Integer, "Allele count in genotypes, for each ALT allele, in the same order as listed"));
|
||||
headerInfo.add(new VCFInfoHeaderLine(VCFRecord.ALLELE_NUMBER_KEY, 1, VCFInfoHeaderLine.INFO_TYPE.Integer, "Total number of alleles in called genotypes"));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -138,16 +138,17 @@ public class VCFGenotypeWriterAdapter implements VCFGenotypeWriter {
|
|||
if ( totalAlleles > 0 ) {
|
||||
infoFields.put(VCFRecord.ALLELE_NUMBER_KEY, String.format("%d", totalAlleles));
|
||||
|
||||
// the allele counts are a bit trickier - we need to count up the alternate counts to get the ref count
|
||||
// count up the alternate counts
|
||||
List<Integer> altAlleleCounts = params.getAlleleCounts();
|
||||
int totalAltAlleles = 0;
|
||||
StringBuffer sb = new StringBuffer();
|
||||
for ( int alleleCount : altAlleleCounts ) {
|
||||
sb.append(",");
|
||||
sb.append(alleleCount);
|
||||
totalAltAlleles += alleleCount;
|
||||
if ( altAlleleCounts.size() > 0 ) {
|
||||
StringBuffer sb = new StringBuffer();
|
||||
sb.append(altAlleleCounts.get(0));
|
||||
for (int i = 1; i < altAlleleCounts.size(); i++ ) {
|
||||
sb.append(",");
|
||||
sb.append(altAlleleCounts.get(i));
|
||||
}
|
||||
infoFields.put(VCFRecord.ALLELE_COUNT_KEY, sb.toString());
|
||||
}
|
||||
infoFields.put(VCFRecord.ALLELE_COUNT_KEY, String.format("%d%s", (totalAlleles - totalAltAlleles), sb.toString()));
|
||||
}
|
||||
|
||||
// q-score
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ public class UnifiedGenotyperIntegrationTest extends WalkerTest {
|
|||
public void testMultiSamplePilot1PointEM() {
|
||||
WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec(
|
||||
"-T UnifiedGenotyper -R " + oneKGLocation + "reference/human_b36_both.fasta -I " + validationDataLocation + "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("ee02dbbbbe957ccf0ee79dcdfd7abff6"));
|
||||
Arrays.asList("f033627f849ca8148fe4168c8172eb32"));
|
||||
executeTest("testMultiSamplePilot1 - Point Estimate EM", spec);
|
||||
}
|
||||
|
||||
|
|
@ -30,7 +30,7 @@ public class UnifiedGenotyperIntegrationTest extends WalkerTest {
|
|||
public void testMultiSamplePilot2PointEM() {
|
||||
WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec(
|
||||
"-T UnifiedGenotyper -R " + oneKGLocation + "reference/human_b36_both.fasta -I " + validationDataLocation + "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("b200b56b0f6363105b23417f459ec4dc"));
|
||||
Arrays.asList("2d181aa420f200fb19a0b5f40855dfd7"));
|
||||
executeTest("testMultiSamplePilot2 - Point Estimate EM", spec);
|
||||
}
|
||||
|
||||
|
|
@ -56,7 +56,7 @@ public class UnifiedGenotyperIntegrationTest extends WalkerTest {
|
|||
public void testMultiSamplePilot1Joint() {
|
||||
WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec(
|
||||
"-T UnifiedGenotyper -R " + oneKGLocation + "reference/human_b36_both.fasta -I " + validationDataLocation + "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("eee834f4242d72fffb09cd248bd8ed86"));
|
||||
Arrays.asList("b8b937e5d44114c265cfa86dbb5e45c8"));
|
||||
executeTest("testMultiSamplePilot1 - Joint Estimate", spec);
|
||||
}
|
||||
|
||||
|
|
@ -64,7 +64,7 @@ public class UnifiedGenotyperIntegrationTest extends WalkerTest {
|
|||
public void testMultiSamplePilot2Joint() {
|
||||
WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec(
|
||||
"-T UnifiedGenotyper -R " + oneKGLocation + "reference/human_b36_both.fasta -I " + validationDataLocation + "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("ee5c07b4e57966bf173dea100f1e89e0"));
|
||||
Arrays.asList("499a589c9da3a6adcccc4561b84dfde1"));
|
||||
executeTest("testMultiSamplePilot2 - Joint Estimate", spec);
|
||||
}
|
||||
|
||||
|
|
@ -72,7 +72,7 @@ public class UnifiedGenotyperIntegrationTest extends WalkerTest {
|
|||
public void testSingleSamplePilot2Joint() {
|
||||
WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec(
|
||||
"-T UnifiedGenotyper -R " + oneKGLocation + "reference/human_b36_both.fasta -I " + validationDataLocation + "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("15d2e6040933704547a39a531869f36d"));
|
||||
Arrays.asList("1dc507fbe54e289f18d9738398426050"));
|
||||
executeTest("testSingleSamplePilot2 - Joint Estimate", spec);
|
||||
}
|
||||
|
||||
|
|
@ -85,7 +85,7 @@ public class UnifiedGenotyperIntegrationTest extends WalkerTest {
|
|||
public void testParallelization() {
|
||||
WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec(
|
||||
"-T UnifiedGenotyper -R " + oneKGLocation + "reference/human_b36_both.fasta -I " + validationDataLocation + "NA12878.1kg.p2.chr1_10mb_11_mb.SLX.bam -varout %s -L 1:10,000,000-10,400,000 -bm empirical -gm JOINT_ESTIMATE -confidence 30 -nt 4", 1,
|
||||
Arrays.asList("463c5c9cf9a10f8b737184c10c199783"));
|
||||
Arrays.asList("6ae7741b72024781aa2969c785ede392"));
|
||||
executeTest("test parallelization", spec);
|
||||
}
|
||||
|
||||
|
|
@ -98,11 +98,11 @@ public class UnifiedGenotyperIntegrationTest extends WalkerTest {
|
|||
@Test
|
||||
public void testParameter() {
|
||||
HashMap<String, String> e = new HashMap<String, String>();
|
||||
e.put( "-genotype", "b69545bb707edbb033307aab0aecd85a" );
|
||||
e.put( "-all_bases", "7a2a691e8eda96e28c0868c87bba9402" );
|
||||
e.put( "--min_base_quality_score 26", "015509aca82954b89d7dc83134f2103e" );
|
||||
e.put( "--min_mapping_quality_score 26", "227bff531007ea610577be5b2696c8e4" );
|
||||
e.put( "--max_mismatches_in_40bp_window 5", "7b294de04436a2362c5536fa8af83da4" );
|
||||
e.put( "-genotype", "094c15be4f9b7c348a12f4bc27efb6e3" );
|
||||
e.put( "-all_bases", "0097049976ba72dc70476670f1ab2ec6" );
|
||||
e.put( "--min_base_quality_score 26", "fa88be0dc1f6807829f15df82d3cf393" );
|
||||
e.put( "--min_mapping_quality_score 26", "225f47a2f73cd4ca16606e0fcc09ba51" );
|
||||
e.put( "--max_mismatches_in_40bp_window 5", "d8192dc36ebc205aaaaae7734a6144b5" );
|
||||
|
||||
for ( Map.Entry<String, String> entry : e.entrySet() ) {
|
||||
WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec(
|
||||
|
|
@ -116,7 +116,7 @@ public class UnifiedGenotyperIntegrationTest extends WalkerTest {
|
|||
public void testConfidence() {
|
||||
WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec(
|
||||
"-T UnifiedGenotyper -R " + oneKGLocation + "reference/human_b36_both.fasta -I " + validationDataLocation + "NA12878.1kg.p2.chr1_10mb_11_mb.SLX.bam -varout %s -L 1:10,000,000-10,010,000 -bm empirical -gm JOINT_ESTIMATE -confidence 10 ", 1,
|
||||
Arrays.asList("c2e4ebd66901d6160dc38cdaa29b89f3"));
|
||||
Arrays.asList("63b37207255069ca47a6ffd77bf562f0"));
|
||||
executeTest("testConfidence", spec);
|
||||
}
|
||||
|
||||
|
|
@ -207,7 +207,7 @@ public class UnifiedGenotyperIntegrationTest extends WalkerTest {
|
|||
|
||||
// --------------------------------------------------------------------------------------------------------------
|
||||
//
|
||||
// testing verbose and beagle output
|
||||
// testing beagle output
|
||||
//
|
||||
// --------------------------------------------------------------------------------------------------------------
|
||||
@Test
|
||||
|
|
|
|||
Loading…
Reference in New Issue