From 99ddd8ab1528bd5422fa7590dca7f092b7a2a16d Mon Sep 17 00:00:00 2001 From: aaron Date: Tue, 14 Jul 2009 17:58:04 +0000 Subject: [PATCH] bug fix for transitioning between chromosomes in GLF output git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@1237 348d0f76-0448-11de-a6fe-93d51630548a --- .../sting/utils/genotype/glf/GLFWriter.java | 29 ++++--------------- 1 file changed, 5 insertions(+), 24 deletions(-) diff --git a/java/src/org/broadinstitute/sting/utils/genotype/glf/GLFWriter.java b/java/src/org/broadinstitute/sting/utils/genotype/glf/GLFWriter.java index b988929b5..5da2ed0e8 100755 --- a/java/src/org/broadinstitute/sting/utils/genotype/glf/GLFWriter.java +++ b/java/src/org/broadinstitute/sting/utils/genotype/glf/GLFWriter.java @@ -156,6 +156,8 @@ public class GLFWriter implements GenotypeWriter { /** * add a GLF record to the output file * + * @param contigName the contig name + * @param contigLength the contig length * @param rec the GLF record to write. */ public void addGLFRecord(String contigName, int contigLength, GLFRecord rec) { @@ -183,8 +185,8 @@ public class GLFWriter implements GenotypeWriter { /** * check to see if we've jumped to a new contig * - * @param sequenceName - * @param seqLength + * @param sequenceName the name for the sequence + * @param seqLength the sequence length */ private void checkSequence(String sequenceName, int seqLength) { if ((referenceSequenceName == null) || (!referenceSequenceName.equals(sequenceName))) { @@ -193,6 +195,7 @@ public class GLFWriter implements GenotypeWriter { } referenceSequenceName = sequenceName; referenceSequenceLength = seqLength; + lastPos = 1; addSequence(); } } @@ -220,28 +223,6 @@ public class GLFWriter implements GenotypeWriter { outputBinaryCodec.close(); } - /** - * normalize the values to the range of a byte (0 - 255) - * - * @param values the floating point values to normalize - * - * @return a byte array containing the normalized values - */ - private byte[] normalizeToByte(double[] values) { - byte ret[] = new byte[values.length]; - double min = Double.MAX_VALUE; - double max = Double.MIN_VALUE; - for (double d : values) { - min = (d < min) ? d : min; - max = (d > max) ? d : max; - } - double scale = max / 255.0; - for (int x = 0; x < values.length; x++) { - ret[x] = (byte) ((values[x] - min) / scale); - } - return ret; - } - /** * get the reference sequence *