From 15ce3757874a3642fb6dc64aadfcc469125399fc Mon Sep 17 00:00:00 2001 From: kshakir Date: Fri, 25 Feb 2011 20:50:03 +0000 Subject: [PATCH] While generating YAML now warning and skipping TSV rows that don't have all values. Fixed log message typo in PipelineTest. git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@5320 348d0f76-0448-11de-a6fe-93d51630548a --- .../sting/queue/pipeline/PipelineTest.scala | 2 +- shell/firehose/pipelineTsvToYaml.sh | 51 +++++++++++-------- 2 files changed, 32 insertions(+), 21 deletions(-) diff --git a/scala/test/org/broadinstitute/sting/queue/pipeline/PipelineTest.scala b/scala/test/org/broadinstitute/sting/queue/pipeline/PipelineTest.scala index 1a96136ee..7e6ca18c2 100644 --- a/scala/test/org/broadinstitute/sting/queue/pipeline/PipelineTest.scala +++ b/scala/test/org/broadinstitute/sting/queue/pipeline/PipelineTest.scala @@ -257,7 +257,7 @@ object PipelineTest extends BaseTest with Logging { Assert.fail("Test %s expected exception %s but none was thrown".format(name, expectedException.toString)) } else { if (CommandLineProgram.result != 0) - throw new RuntimeException("Error running the GATK with arguments: " + args) + throw new RuntimeException("Error running Queue with arguments: " + args) } } diff --git a/shell/firehose/pipelineTsvToYaml.sh b/shell/firehose/pipelineTsvToYaml.sh index 214fd5d74..55fad225b 100755 --- a/shell/firehose/pipelineTsvToYaml.sh +++ b/shell/firehose/pipelineTsvToYaml.sh @@ -82,32 +82,32 @@ awk ' bamFile = columnFields[key] if (referenceFile == "") { - print "Column header reference_file missing from " tsvFile > "/dev/stderr" + print "ERROR: Column header reference_file missing from " tsvFile > "/dev/stderr" exitWithError = 1 } if (intervalList == "") { - print "Column header interval_list missing from " tsvFile > "/dev/stderr" + print "ERROR: Column header interval_list missing from " tsvFile > "/dev/stderr" exitWithError = 1 } if (sampleId == "") { - print "Column header sample_id missing from " tsvFile > "/dev/stderr" + print "ERROR: Column header sample_id missing from " tsvFile > "/dev/stderr" exitWithError = 1 } if (squidProject == "") { - print "Column header squid_project missing from " tsvFile > "/dev/stderr" + print "ERROR: Column header squid_project missing from " tsvFile > "/dev/stderr" exitWithError = 1 } if (collaboratorId == "") { - print "Column header collaborator_id missing from " tsvFile > "/dev/stderr" + print "ERROR: Column header collaborator_id missing from " tsvFile > "/dev/stderr" exitWithError = 1 } if (bamFile == "") { - print "Column header *bam_file* missing from " tsvFile > "/dev/stderr" + print "ERROR: Column header *bam_file* missing from " tsvFile > "/dev/stderr" exitWithError = 1 } @@ -115,7 +115,6 @@ awk ' exit 1 } - refseqDir = "/humgen/gsa-hpprojects/GATK/data/Annotations/refseq/" dbsnpDir = "/humgen/gsa-hpprojects/GATK/data/" @@ -131,22 +130,34 @@ awk ' printf "{" } else { - if (NR == 2) { - # Based on the reference of the first sample, specify the dbsnps and refseq tables. + missingValue = 0 + if ($referenceFile == "") missingValue = 1 + if ($intervalList == "") missingValue = 1 + if ($sampleId == "") missingValue = 1 + if ($squidProject == "") missingValue = 1 + if ($collaboratorId == "") missingValue = 1 + if ($bamFile == "") missingValue = 1 - referencePartCount = split($referenceFile, referenceParts, "/") - referenceName = referenceParts[referencePartCount] - - genotypeDbsnp = genotypeDbsnps[referenceName] - evalDbsnp = evalDbsnps[referenceName] - refseq = refseqs[referenceName] - - printf '"$PROJECT_YAML_TEMPLATE"' - printf "\n samples: [" + if (missingValue) { + print "WARNING: Skipping row which does not have all values: " $0 > "/dev/stderr" } else { - printf "," + if (NR == 2) { + # Based on the reference of the first sample, specify the dbsnps and refseq tables. + + referencePartCount = split($referenceFile, referenceParts, "/") + referenceName = referenceParts[referencePartCount] + + genotypeDbsnp = genotypeDbsnps[referenceName] + evalDbsnp = evalDbsnps[referenceName] + refseq = refseqs[referenceName] + + printf '"$PROJECT_YAML_TEMPLATE"' + printf "\n samples: [" + } else { + printf "," + } + printf '"$SAMPLE_YAML_TEMPLATE"' } - printf '"$SAMPLE_YAML_TEMPLATE"' } } END {