From eed32df30decae199a253fd32b03e5439b287a99 Mon Sep 17 00:00:00 2001 From: Guillermo del Angel Date: Thu, 21 Jun 2012 21:19:55 -0400 Subject: [PATCH] a) Sanity check in PoolCaller: if user didn't specify correct -glm or -pnrm models then error out with useful message, b) Have VariantsToTable deal with case where sample namess have spaces: technically they're allowed (or at least not explicitly forbidden) but they'll produce R-incompatible tables. TBD which other tools have issues, or whether there's a generic fix for this --- .../genotyper/GenotypeLikelihoodsCalculationModel.java | 3 ++- .../sting/gatk/walkers/variantutils/VariantsToTable.java | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/GenotypeLikelihoodsCalculationModel.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/GenotypeLikelihoodsCalculationModel.java index ecb4a5b90..80b58cfa6 100755 --- a/public/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/GenotypeLikelihoodsCalculationModel.java +++ b/public/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/GenotypeLikelihoodsCalculationModel.java @@ -56,9 +56,10 @@ public abstract class GenotypeLikelihoodsCalculationModel implements Cloneable { public enum Model { SNP, INDEL, + BOTH, POOLSNP, POOLINDEL, - BOTH + POOLBOTH } public enum GENOTYPING_MODE { diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/VariantsToTable.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/VariantsToTable.java index 5d86a0c5e..996ac75e7 100755 --- a/public/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/VariantsToTable.java +++ b/public/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/VariantsToTable.java @@ -232,7 +232,8 @@ public class VariantsToTable extends RodWalker { firstEntry = false; else sb.append("\t"); - sb.append(sample); + // spaces in sample names are legal but wreak havoc in R data frames + sb.append(sample.replace(" ","_")); sb.append("."); sb.append(gf); } @@ -247,7 +248,7 @@ public class VariantsToTable extends RodWalker { } for ( final String sample : samples ) { for ( final String gf : genotypeFieldsToTake ) { - out.println(String.format("%d\t%s\t%s\t%s", nRecords, sample, gf, record.get(index++))); + out.println(String.format("%d\t%s\t%s\t%s", nRecords, sample.replace(" ","_"), gf, record.get(index++))); } } }