diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/TechnologyComposition.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/TechnologyComposition.java index e7c3bbaad..f9b9eb3de 100755 --- a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/TechnologyComposition.java +++ b/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/TechnologyComposition.java @@ -20,11 +20,11 @@ import java.util.List; import java.util.Map; /** - * Counts of bases from SLX, 454, and SOLiD at this site + * Counts of bases from Illumina, 454, and SOLiD at this site */ @Hidden public class TechnologyComposition extends InfoFieldAnnotation implements ExperimentalAnnotation { - private String nSLX = "NumSLX"; + private String nIllumina = "NumIllumina"; private String n454 ="Num454"; private String nSolid = "NumSOLiD"; private String nOther = "NumOther"; @@ -46,7 +46,7 @@ public class TechnologyComposition extends InfoFieldAnnotation implements Experi reads454++; else if (ReadUtils.isSOLiDRead(p.getRead())) readsSolid++; - else if (ReadUtils.isSLXRead(p.getRead())) + else if (ReadUtils.isIlluminaRead(p.getRead())) readsIllumina++; else readsOther++; @@ -55,16 +55,16 @@ public class TechnologyComposition extends InfoFieldAnnotation implements Experi } Map map = new HashMap(); - map.put(nSLX, String.format("%d", readsIllumina)); + map.put(nIllumina, String.format("%d", readsIllumina)); map.put(n454, String.format("%d", reads454)); map.put(nSolid, String.format("%d", readsSolid)); map.put(nOther, String.format("%d", readsOther)); return map; } - public List getKeyNames() { return Arrays.asList(nSLX,n454,nSolid,nOther); } + public List getKeyNames() { return Arrays.asList(nIllumina,n454,nSolid,nOther); } - public List getDescriptions() { return Arrays.asList(new VCFInfoHeaderLine(nSLX, 1, VCFHeaderLineType.Integer, "Number of SLX reads"), + public List getDescriptions() { return Arrays.asList(new VCFInfoHeaderLine(nIllumina, 1, VCFHeaderLineType.Integer, "Number of Illumina reads"), new VCFInfoHeaderLine(n454, 1, VCFHeaderLineType.Integer, "Number of 454 reads"), new VCFInfoHeaderLine(nSolid, 1, VCFHeaderLineType.Integer, "Number of SOLiD reads"), new VCFInfoHeaderLine(nOther, 1, VCFHeaderLineType.Integer, "Number of Other technology reads")); } diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/indels/IndelRealigner.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/indels/IndelRealigner.java index 8f939fc49..addfc5fab 100755 --- a/public/java/src/org/broadinstitute/sting/gatk/walkers/indels/IndelRealigner.java +++ b/public/java/src/org/broadinstitute/sting/gatk/walkers/indels/IndelRealigner.java @@ -103,7 +103,7 @@ import java.util.*; * -T IndelRealigner \ * -targetIntervals intervalListFromRTC.intervals \ * -o realignedBam.bam \ - * [--known /path/to/indels.vcf] \ + * [-known /path/to/indels.vcf] \ * [-compress 0] (this argument recommended to speed up the process *if* this is only a temporary file; otherwise, use the default value) * * @@ -532,8 +532,9 @@ public class IndelRealigner extends ReadWalker { read.getMappingQuality() == 0 || read.getAlignmentStart() == SAMRecord.NO_ALIGNMENT_START || ConstrainedMateFixingManager.iSizeTooBigToMove(read, MAX_ISIZE_FOR_MOVEMENT) || - ReadUtils.is454Read(read); - // TODO -- it would be nice if we could use indels from 454 reads as alternate consenses + ReadUtils.is454Read(read) || + ReadUtils.isIonRead(read); + // TODO -- it would be nice if we could use indels from 454/Ion reads as alternate consenses } private void cleanAndCallMap(ReferenceContext ref, GATKSAMRecord read, ReadMetaDataTracker metaDataTracker, GenomeLoc readLoc) { diff --git a/public/java/src/org/broadinstitute/sting/utils/NGSPlatform.java b/public/java/src/org/broadinstitute/sting/utils/NGSPlatform.java index 597dc4803..504704e55 100644 --- a/public/java/src/org/broadinstitute/sting/utils/NGSPlatform.java +++ b/public/java/src/org/broadinstitute/sting/utils/NGSPlatform.java @@ -81,6 +81,7 @@ public enum NGSPlatform { * @return an NGSPlatform object matching the PL field of the header, of UNKNOWN if there was no match */ public static final NGSPlatform fromReadGroup(SAMReadGroupRecord rg) { + if ( rg == null ) return UNKNOWN; return fromReadGroupPL(rg.getPlatform()); } diff --git a/public/java/src/org/broadinstitute/sting/utils/sam/ReadUtils.java b/public/java/src/org/broadinstitute/sting/utils/sam/ReadUtils.java index 820a9b731..78ce81a7c 100755 --- a/public/java/src/org/broadinstitute/sting/utils/sam/ReadUtils.java +++ b/public/java/src/org/broadinstitute/sting/utils/sam/ReadUtils.java @@ -31,6 +31,7 @@ import net.sf.samtools.*; import org.broadinstitute.sting.gatk.GenomeAnalysisEngine; import org.broadinstitute.sting.utils.GenomeLoc; import org.broadinstitute.sting.utils.MathUtils; +import org.broadinstitute.sting.utils.NGSPlatform; import org.broadinstitute.sting.utils.collections.Pair; import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; @@ -211,43 +212,55 @@ public class ReadUtils { } /** - * is the read a 454 read ? + * is the read a 454 read? * * @param read the read to test * @return checks the read group tag PL for the default 454 tag */ public static boolean is454Read(SAMRecord read) { - return isPlatformRead(read, "454"); + return NGSPlatform.fromRead(read) == NGSPlatform.LS454; } /** - * is the read a SOLiD read ? + * is the read an IonTorrent read? + * + * @param read the read to test + * @return checks the read group tag PL for the default ion tag + */ + public static boolean isIonRead(SAMRecord read) { + return NGSPlatform.fromRead(read) == NGSPlatform.ION_TORRENT; + } + + /** + * is the read a SOLiD read? * * @param read the read to test * @return checks the read group tag PL for the default SOLiD tag */ public static boolean isSOLiDRead(SAMRecord read) { - return isPlatformRead(read, "SOLID"); + return NGSPlatform.fromRead(read) == NGSPlatform.SOLID; } /** - * is the read a SLX read ? + * is the read a SLX read? * * @param read the read to test * @return checks the read group tag PL for the default SLX tag */ - public static boolean isSLXRead(SAMRecord read) { - return isPlatformRead(read, "ILLUMINA"); + public static boolean isIlluminaRead(SAMRecord read) { + return NGSPlatform.fromRead(read) == NGSPlatform.ILLUMINA; } /** - * checks if the read has a platform tag in the readgroup equal to 'name' ? + * checks if the read has a platform tag in the readgroup equal to 'name'. + * Assumes that 'name' is upper-cased. * * @param read the read to test - * @param name the platform name to test + * @param name the upper-cased platform name to test * @return whether or not name == PL tag in the read group of read */ public static boolean isPlatformRead(SAMRecord read, String name) { + SAMReadGroupRecord readGroup = read.getReadGroup(); if (readGroup != null) { Object readPlatformAttr = readGroup.getAttribute("PL");