From 9bd6489f8e6b247c802c1b73fdd9b5f969439573 Mon Sep 17 00:00:00 2001 From: ebanks Date: Wed, 27 May 2009 17:32:15 +0000 Subject: [PATCH] Output indels in the format appropriate for low-coverage indel submission git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@832 348d0f76-0448-11de-a6fe-93d51630548a --- .../gatk/walkers/indels/IntervalCleanerWalker.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/java/src/org/broadinstitute/sting/playground/gatk/walkers/indels/IntervalCleanerWalker.java b/java/src/org/broadinstitute/sting/playground/gatk/walkers/indels/IntervalCleanerWalker.java index 7a6c75009..2d5016aef 100755 --- a/java/src/org/broadinstitute/sting/playground/gatk/walkers/indels/IntervalCleanerWalker.java +++ b/java/src/org/broadinstitute/sting/playground/gatk/walkers/indels/IntervalCleanerWalker.java @@ -270,12 +270,18 @@ public class IntervalCleanerWalker extends LocusWindowWalker if ( bestConsensus != null && ((double)(totalMismatchSum - bestConsensus.mismatchSum))/10.0 >= LOD_THRESHOLD ) { logger.debug("CLEAN: " + bestConsensus.str ); if ( indelOutput != null && bestConsensus.cigar.numCigarElements() > 1 ) { + // NOTE: indels are printed out in the format specified for the low-coverage pilot1 + // indel calls (tab-delimited): chr position size type sequence StringBuffer str = new StringBuffer(); str.append(reads.get(0).getReferenceName()); - int position = bestConsensus.positionOnReference + bestConsensus.cigar.getCigarElement(0).getLength() - 1; - str.append(":" + (leftmostIndex + position)); + int position = bestConsensus.positionOnReference + bestConsensus.cigar.getCigarElement(0).getLength(); + str.append("\t" + (leftmostIndex + position - 1)); CigarElement ce = bestConsensus.cigar.getCigarElement(1); - str.append("\t" + ce.getLength() + ce.getOperator()); + str.append("\t" + ce.getLength() + "\t" + ce.getOperator() + "\t"); + if ( ce.getOperator() == CigarOperator.D ) + str.append(reference.substring(position, position+ce.getLength())); + else + str.append(bestConsensus.str.substring(position, position+ce.getLength())); str.append("\t" + (((double)(totalMismatchSum - bestConsensus.mismatchSum))/10.0) + "\n"); try { indelOutput.write(str.toString());