From de1c282e62fc9c71b57802f0b24054e984876c08 Mon Sep 17 00:00:00 2001 From: hanna Date: Fri, 8 May 2009 15:28:19 +0000 Subject: [PATCH] Reference-ordered data relies on bugs in the old command-line argument system to work. Update the ROD system to from -B track1 type1 file1 track2 type2 file2 to -B track1,type1,file1 -B track2,type2,file2. git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@640 348d0f76-0448-11de-a6fe-93d51630548a --- .../gatk/refdata/ReferenceOrderedData.java | 21 ++++++++++--------- python/ValidateGATK.py | 2 +- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/java/src/org/broadinstitute/sting/gatk/refdata/ReferenceOrderedData.java b/java/src/org/broadinstitute/sting/gatk/refdata/ReferenceOrderedData.java index 593d8545b..b629e6911 100644 --- a/java/src/org/broadinstitute/sting/gatk/refdata/ReferenceOrderedData.java +++ b/java/src/org/broadinstitute/sting/gatk/refdata/ReferenceOrderedData.java @@ -58,7 +58,7 @@ public class ReferenceOrderedData implements /** * Parse the ROD bindings. These are of the form of a single list of strings, each triplet of the - * form . After this function, the List of RODs contains new RODs bound to each of + * form ,,. After this function, the List of RODs contains new RODs bound to each of * name, of type, ready to read from the file. This function does check for the strings to be well formed * and such. * @@ -68,15 +68,16 @@ public class ReferenceOrderedData implements */ public static void parseBindings(Logger logger, ArrayList bindings, List > rods) { - logger.info("Processing ROD bindings: " + bindings.size() + " -> " + Utils.join(" : ", bindings)); - if ( bindings.size() % 3 != 0 ) - Utils.scareUser(String.format("Invalid ROD specification: requires triplets of but got %s", Utils.join(" ", bindings))); - // Loop over triplets - for ( int i = 0; i < bindings.size(); i += 3) { - final String name = bindings.get(i); - final String typeName = bindings.get(i+1); - final String fileName = bindings.get(i+2); + for( String binding: bindings ) { + String[] bindingTokens = binding.split(","); + logger.info("Processing ROD bindings: " + bindings.size() + " -> " + Utils.join(" : ", bindingTokens)); + if( bindingTokens.length != 3 ) + Utils.scareUser(String.format("Invalid ROD specification: requires triplets of ,, but got %s", Utils.join(",", bindings))); + + final String name = bindingTokens[0]; + final String typeName = bindingTokens[1]; + final String fileName = bindingTokens[2]; ReferenceOrderedData rod = parse1Binding(logger, name, typeName, fileName); @@ -85,7 +86,7 @@ public class ReferenceOrderedData implements if ( rod2.getName().equals(rod.getName()) ) Utils.scareUser(String.format("Found duplicate rod bindings", rod.getName())); - rods.add(rod); + rods.add(rod); } } diff --git a/python/ValidateGATK.py b/python/ValidateGATK.py index 952cb74ea..114fa6f85 100755 --- a/python/ValidateGATK.py +++ b/python/ValidateGATK.py @@ -195,7 +195,7 @@ def main(): if isIntervalFile(region): cmd += " --intervals_file " + region - cmd += " -B pileup SAMPileup " + pileup + cmd += " -B pileup,SAMPileup," + pileup print cmd farm_commands.cmd(cmd, OPTIONS.farmQueue, outputFile=validationOutput, just_print_commands=OPTIONS.justPrint)