Cleanup formatting of VCF floats

-- Final integrationtest update before commit (and fixing new formatting changes)
This commit is contained in:
Mark DePristo 2012-06-13 21:57:47 -04:00
parent 8b01969762
commit fbc45e14d3
2 changed files with 5 additions and 3 deletions

View File

@ -452,8 +452,8 @@ class VCFWriter extends IndexingVariantContextWriter {
* @return
*/
public static final String formatVCFDouble(final double d) {
String format = "%.2f";
if ( d < 0.1 ) {
String format;
if ( d < 1 ) {
if ( d < 0.01 ) {
if ( Math.abs(d) >= 1e-20 )
format = "%.3e";
@ -464,6 +464,8 @@ class VCFWriter extends IndexingVariantContextWriter {
} else {
format = "%.3f";
}
} else {
format = "%.2f";
}
return String.format(format, d);

View File

@ -110,7 +110,7 @@ public class CombineVariantsIntegrationTest extends WalkerTest {
" -priority NA19240_BGI,NA19240_ILLUMINA,NA19240_WUGSC,denovoInfo" +
" -genotypeMergeOptions UNIQUIFY -L 1"),
1,
Arrays.asList("90fa9f9b73fd10291e8067ecf7757b8d"));
Arrays.asList("59cbe0d9a2aa562b59bd546e20b9abad"));
executeTest("threeWayWithRefs", spec);
}