From 25c30b12bb260adf8f5330dbc7559097de58cc98 Mon Sep 17 00:00:00 2001 From: kcibul Date: Fri, 3 Jul 2009 15:10:19 +0000 Subject: [PATCH] added MAF-style output git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@1163 348d0f76-0448-11de-a6fe-93d51630548a --- .../walkers/cancer/SomaticMutationWalker.java | 49 +++++++++++++------ 1 file changed, 33 insertions(+), 16 deletions(-) diff --git a/java/src/org/broadinstitute/sting/playground/gatk/walkers/cancer/SomaticMutationWalker.java b/java/src/org/broadinstitute/sting/playground/gatk/walkers/cancer/SomaticMutationWalker.java index 046da3d3a..1ef437a77 100644 --- a/java/src/org/broadinstitute/sting/playground/gatk/walkers/cancer/SomaticMutationWalker.java +++ b/java/src/org/broadinstitute/sting/playground/gatk/walkers/cancer/SomaticMutationWalker.java @@ -50,6 +50,9 @@ public class SomaticMutationWalker extends LocusWalker { // @Argument(fullName = "output_failures", required = false, doc="produce output for failed sites") public boolean OUTPUT_FAILURES = true; + @Argument(fullName = "output_format", shortName = "s3", required = true, doc="Format of output: bed or maf") + public String OUTPUT_FORMAT; + public void initialize() { } @@ -260,23 +263,37 @@ public class SomaticMutationWalker extends LocusWalker { // if we're still here... we've got a somatic mutation! Output the results // and stop looking for mutants! - String msg = - (failedMidpointCheck?"__FAILED-MPCHECK":"") + - "TScore:" + tumorLod + - "__TRefSum: " + tumorReadPile.qualitySums.getQualitySum(upRef) + - "__TAltSum: " + tumorReadPile.qualitySums.getQualitySum(altAllele) + - "__NScore:" + normalLod + - "__NRefSum: " + normalReadPile.qualitySums.getQualitySum(upRef) + - "__NAltSum: " + normalReadPile.qualitySums.getQualitySum(altAllele) + - "__maxSkewLod_" + failureReason.second + "_" + - "__MIDP: " + midp.get(altAllele); + if ("maf".equalsIgnoreCase(OUTPUT_FORMAT)) { + out.println( + "36\t" + //build + context.getContig() + "\t" + + context.getPosition() + "\t" + + context.getPosition() + "\t" + + upRef + "\t" + + upRef + "\t" + + altAllele + "\t" + + tumorSampleName + "\t" + + normalSampleName); + } else { - out.println( - context.getContig() + "\t" + - context.getPosition() + "\t" + - context.getPosition() + "\t" - + msg.replace(' ','_') - ); + String msg = + (failedMidpointCheck?"__FAILED-MPCHECK":"") + + "TScore:" + tumorLod + + "__TRefSum: " + tumorReadPile.qualitySums.getQualitySum(upRef) + + "__TAltSum: " + tumorReadPile.qualitySums.getQualitySum(altAllele) + + "__NScore:" + normalLod + + "__NRefSum: " + normalReadPile.qualitySums.getQualitySum(upRef) + + "__NAltSum: " + normalReadPile.qualitySums.getQualitySum(altAllele) + + "__maxSkewLod_" + failureReason.second + "_" + + "__MIDP: " + midp.get(altAllele); + + out.println( + context.getContig() + "\t" + + context.getPosition() + "\t" + + context.getPosition() + "\t" + + msg.replace(' ','_') + ); + }