From 7732f98e56b432177abd75fe35e36da645269a56 Mon Sep 17 00:00:00 2001 From: rpoplin Date: Fri, 22 Jan 2010 20:09:16 +0000 Subject: [PATCH] Fix for Solid reads that have '.' in their color space field. The recalibrator will just set them to be illumina reads and won't apply color space correction. git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@2661 348d0f76-0448-11de-a6fe-93d51630548a --- .../gatk/walkers/recalibration/RecalDataManager.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/java/src/org/broadinstitute/sting/gatk/walkers/recalibration/RecalDataManager.java b/java/src/org/broadinstitute/sting/gatk/walkers/recalibration/RecalDataManager.java index 114b2672b..1ccf40a13 100644 --- a/java/src/org/broadinstitute/sting/gatk/walkers/recalibration/RecalDataManager.java +++ b/java/src/org/broadinstitute/sting/gatk/walkers/recalibration/RecalDataManager.java @@ -259,12 +259,16 @@ public class RecalDataManager { if( attr != null ) { char[] colorSpace; if( attr instanceof String ) { + if( ((String)attr).contains(".") ) { // empty color space, abort + read.getReadGroup().setPlatform("illumina"); + return; + } colorSpace = ((String)attr).toCharArray(); } else { throw new StingException(String.format("Value encoded by %s in %s isn't a string!", RecalDataManager.COLOR_SPACE_ATTRIBUTE_TAG, read.getReadName())); } - // Loop over the read and calculate first the infered bases from the color and then check if it is consistent with the read + // Loop over the read and calculate first the inferred bases from the color and then check if it is consistent with the read byte[] readBases = read.getReadBases(); if( read.getReadNegativeStrandFlag() ) { readBases = BaseUtils.simpleReverseComplement( read.getReadBases() ); @@ -304,6 +308,10 @@ public class RecalDataManager { if( attr != null ) { char[] colorSpace; if( attr instanceof String ) { + if( ((String)attr).contains(".") ) { // empty color space, abort + read.getReadGroup().setPlatform("illumina"); + return originalQualScores; + } colorSpace = ((String)attr).toCharArray(); } else { throw new StingException(String.format("Value encoded by %s in %s isn't a string!", RecalDataManager.COLOR_SPACE_ATTRIBUTE_TAG, read.getReadName()));