From eb55061fd079d79ebfbe2f6091d31ba3dca5763b Mon Sep 17 00:00:00 2001
From: Guillermo del Angel
Date: Tue, 24 Jul 2012 12:16:15 -0400
Subject: [PATCH] a) Document BEAGLE codec, b) Bug fix: inbreeding coefficient
shouldn't be computed for non-diploid organisms in current implementaiton
---
.../walkers/annotator/InbreedingCoeff.java | 3 ++
.../utils/codecs/beagle/BeagleCodec.java | 30 ++++++++++++++-----
2 files changed, 26 insertions(+), 7 deletions(-)
diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/InbreedingCoeff.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/InbreedingCoeff.java
index fa3a7459b..715895526 100755
--- a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/InbreedingCoeff.java
+++ b/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/InbreedingCoeff.java
@@ -68,6 +68,9 @@ public class InbreedingCoeff extends InfoFieldAnnotation implements StandardAnno
if ( g.isNoCall() || !g.hasLikelihoods() )
continue;
+ if (g.getPloidy() != 2) // only work for diploid samples
+ continue;
+
N++;
final double[] normalizedLikelihoods = MathUtils.normalizeFromLog10( g.getLikelihoods().getAsVector() );
refCount += normalizedLikelihoods[idxAA];
diff --git a/public/java/src/org/broadinstitute/sting/utils/codecs/beagle/BeagleCodec.java b/public/java/src/org/broadinstitute/sting/utils/codecs/beagle/BeagleCodec.java
index 3f72359fa..656b95e7a 100755
--- a/public/java/src/org/broadinstitute/sting/utils/codecs/beagle/BeagleCodec.java
+++ b/public/java/src/org/broadinstitute/sting/utils/codecs/beagle/BeagleCodec.java
@@ -38,25 +38,41 @@ import java.util.*;
import java.util.regex.Pattern;
/**
- * TODO GUILLERMO DEL ANGEL
+ * Codec for Beagle imputation engine
*
*
- * Codec Description
+ * Reads in tabular files with site markers and genotype posteriors, genotypes and phasing that Beagle produced
*
*
*
- * See also: @see VCF specification
+ * See also: @see BEAGLE home page
*
*
*
- * File format example
+ * File format example for phased genotypes file
*
- * line 1
- * line 2
- * line 3
+ * dummy header
+ * 20:60251 T T T T T T
+ * 20:60321 G G G G G G
+ * 20:60467 G G G G G G
*
*
+ * File format example for genotype posteriors
+ *
+ * marker alleleA alleleB NA07056 NA07056 NA07056
+ * 20:60251 T C 0.9962 0.0038 0 0.99245 0.00755 0 0.99245 0.00755 0
+ * 20:60321 G T 0.98747 0.01253 0 0.99922 0.00078 0 0.99368 0.00632 0
+ * 20:60467 G C 0.97475 0.02525 0 0.98718 0.01282 0 0.98718 0.01282 0
+ *
+ *
+ * File format example for r2 file
+ *
+ * 20:60251 0.747
+ * 20:60321 0.763
+ * 20:60467 0.524
+ *
+ *
* @author Mark DePristo
* @since 2010
*/