Skip to content

Commit

Permalink
Parse Floats from GtcToVcf in VcfToAdpc (#1436)
Browse files Browse the repository at this point in the history
* remove comma from floats from GtcToVcf

* Add test for NORMX and NORMY over 1000
  • Loading branch information
tlangs authored Dec 9, 2019
1 parent 0c82cd4 commit a3021a7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 10 deletions.
9 changes: 1 addition & 8 deletions src/main/java/picard/arrays/GtcToVcf.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@
import java.io.FileInputStream;
import java.io.IOException;
import java.nio.file.Path;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
Expand Down Expand Up @@ -166,14 +165,8 @@ public class GtcToVcf extends CommandLineProgram {

private static ReferenceSequenceFile refSeq;

private static final DecimalFormat df = new DecimalFormat();

private static final String DOT = ".";

static {
df.setMaximumFractionDigits(3);
}

@Override
protected boolean requiresReference() {
return true;
Expand Down Expand Up @@ -480,7 +473,7 @@ public static String formatFloatForVcf(final float value) {
if (Float.isNaN(value)) {
return DOT;
}
return df.format(value);
return Float.toString(value);
}

/**
Expand Down
1 change: 0 additions & 1 deletion src/main/java/picard/arrays/VcfToAdpc.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
import picard.cmdline.StandardOptionDefinitions;

import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

Expand Down
3 changes: 2 additions & 1 deletion testdata/picard/arrays/illumina/Test.gtc_records.csv
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
139,3304,3,0.9317507,0.008933085,1.1312464,1.1401795,0.99497294,1.0,-0.02116632
655,1941,0,0.09023222,0.14054315,0.67860323,0.8191464,0.86998993,0.7306291,0.36733368
1645,278,1,0.60272825,0.42509562,0.07603522,0.5011308,0.11267817,0.0,-0.34964624
2243,1889,2,0.92726856,0.5817963,0.6338157,1.2156119,0.5272261,0.5384257,-0.103277266
2243,1889,2,0.92726856,0.5817963,0.6338157,1.2156119,0.5272261,0.5384257,-0.103277266
141,2005,2,0.9317507,1290.3258096018144,1612.9033,1.1401795,0.99497294,1.0,-0.02116632

0 comments on commit a3021a7

Please sign in to comment.