diff --git a/java/src/net/sf/picard/reference/FastaSequenceIndexBuilder.java b/java/src/net/sf/picard/reference/FastaSequenceIndexBuilder.java index 0244434b4..45b190537 100644 --- a/java/src/net/sf/picard/reference/FastaSequenceIndexBuilder.java +++ b/java/src/net/sf/picard/reference/FastaSequenceIndexBuilder.java @@ -26,7 +26,7 @@ package net.sf.picard.reference; import org.broadinstitute.sting.gatk.datasources.simpleDataSources.ReferenceDataSourceProgressListener; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import static net.sf.picard.reference.FastaSequenceIndexBuilder.Status.*; @@ -215,7 +215,7 @@ public class FastaSequenceIndexBuilder { throw new UserException.CouldNotReadInputFile(fastaFile, String.format("Could not read fasta file"), e); } catch (Exception e) { - throw new GATKException(e.getMessage(), e); + throw new ReviewedStingException(e.getMessage(), e); } } diff --git a/java/src/org/broadinstitute/sting/alignment/Alignment.java b/java/src/org/broadinstitute/sting/alignment/Alignment.java index 98a8ed9c1..a70be0006 100644 --- a/java/src/org/broadinstitute/sting/alignment/Alignment.java +++ b/java/src/org/broadinstitute/sting/alignment/Alignment.java @@ -1,7 +1,7 @@ package org.broadinstitute.sting.alignment; import net.sf.samtools.*; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import org.broadinstitute.sting.utils.BaseUtils; import org.broadinstitute.sting.utils.Utils; @@ -189,7 +189,7 @@ public class Alignment { read = (SAMRecord)unmappedRead.clone(); } catch(CloneNotSupportedException ex) { - throw new GATKException("Unable to create aligned read from template."); + throw new ReviewedStingException("Unable to create aligned read from template."); } if(newSAMHeader != null) diff --git a/java/src/org/broadinstitute/sting/alignment/AlignmentValidationWalker.java b/java/src/org/broadinstitute/sting/alignment/AlignmentValidationWalker.java index f6a40ec9d..16e713bf6 100644 --- a/java/src/org/broadinstitute/sting/alignment/AlignmentValidationWalker.java +++ b/java/src/org/broadinstitute/sting/alignment/AlignmentValidationWalker.java @@ -29,7 +29,7 @@ import org.broadinstitute.sting.gatk.refdata.ReadMetaDataTracker; import org.broadinstitute.sting.gatk.walkers.ReadWalker; import org.broadinstitute.sting.gatk.contexts.ReferenceContext; import org.broadinstitute.sting.utils.BaseUtils; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import org.broadinstitute.sting.commandline.Argument; import org.broadinstitute.sting.alignment.bwa.c.BWACAligner; import org.broadinstitute.sting.alignment.bwa.BWAConfiguration; @@ -120,7 +120,7 @@ public class AlignmentValidationWalker extends ReadWalker { logger.error(String.format(" Mapping quality: %s%n", alignmentsByScore[i].getMappingQuality())); } } - throw new GATKException(String.format("Read %s mismatches!", read.getReadName())); + throw new ReviewedStingException(String.format("Read %s mismatches!", read.getReadName())); } return 1; diff --git a/java/src/org/broadinstitute/sting/alignment/bwa/BWTFiles.java b/java/src/org/broadinstitute/sting/alignment/bwa/BWTFiles.java index 0dacfb460..cd7800900 100644 --- a/java/src/org/broadinstitute/sting/alignment/bwa/BWTFiles.java +++ b/java/src/org/broadinstitute/sting/alignment/bwa/BWTFiles.java @@ -1,6 +1,6 @@ package org.broadinstitute.sting.alignment.bwa; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import org.broadinstitute.sting.utils.Utils; import org.broadinstitute.sting.alignment.reference.packing.PackUtils; import org.broadinstitute.sting.alignment.reference.bwt.BWT; @@ -75,7 +75,7 @@ public class BWTFiles { */ public BWTFiles(String prefix) { if(prefix == null) - throw new GATKException("Prefix must not be null."); + throw new ReviewedStingException("Prefix must not be null."); annFile = new File(prefix + ".ann"); ambFile = new File(prefix + ".amb"); pacFile = new File(prefix + ".pac"); @@ -134,7 +134,7 @@ public class BWTFiles { success &= reverseSAFile.delete(); if(!success) - throw new GATKException("Unable to clean up autogenerated representation"); + throw new ReviewedStingException("Unable to clean up autogenerated representation"); } } @@ -182,7 +182,7 @@ public class BWTFiles { writeEncodedReferenceSequence(reverseReferenceSequence,rpacFile,rbwtFile,rsaFile); } catch(IOException ex) { - throw new GATKException("Unable to write autogenerated reference sequence to temporary files"); + throw new ReviewedStingException("Unable to write autogenerated reference sequence to temporary files"); } // Make sure that, at the very least, all temporary files are deleted on exit. @@ -228,13 +228,13 @@ public class BWTFiles { * Convert the given reference sequence into a form suitable for building into * on-the-fly sequences. * @param referenceSequence The reference sequence to normalize. - * @throws GATKException if normalized sequence cannot be generated. + * @throws org.broadinstitute.sting.utils.exceptions.ReviewedStingException if normalized sequence cannot be generated. */ private static void normalizeReferenceSequence(byte[] referenceSequence) { StringUtil.toUpperCase(referenceSequence); for(byte base: referenceSequence) { if(base != 'A' && base != 'C' && base != 'G' && base != 'T') - throw new GATKException(String.format("Base type %c is not supported when building references on-the-fly",(char)base)); + throw new ReviewedStingException(String.format("Base type %c is not supported when building references on-the-fly",(char)base)); } } } diff --git a/java/src/org/broadinstitute/sting/alignment/bwa/c/BWACAligner.java b/java/src/org/broadinstitute/sting/alignment/bwa/c/BWACAligner.java index 8c9fba53e..322dd01b6 100644 --- a/java/src/org/broadinstitute/sting/alignment/bwa/c/BWACAligner.java +++ b/java/src/org/broadinstitute/sting/alignment/bwa/c/BWACAligner.java @@ -2,7 +2,7 @@ package org.broadinstitute.sting.alignment.bwa.c; import net.sf.samtools.SAMRecord; import net.sf.samtools.SAMFileHeader; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import org.broadinstitute.sting.alignment.Alignment; import org.broadinstitute.sting.alignment.bwa.BWAConfiguration; import org.broadinstitute.sting.alignment.bwa.BWTFiles; @@ -29,15 +29,15 @@ public class BWACAligner extends BWAAligner { public BWACAligner(BWTFiles bwtFiles, BWAConfiguration configuration) { super(bwtFiles,configuration); if(thunkPointer != 0) - throw new GATKException("BWA/C attempting to reinitialize."); + throw new ReviewedStingException("BWA/C attempting to reinitialize."); - if(!bwtFiles.annFile.exists()) throw new GATKException("ANN file is missing; please rerun 'bwa aln' to regenerate it."); - if(!bwtFiles.ambFile.exists()) throw new GATKException("AMB file is missing; please rerun 'bwa aln' to regenerate it."); - if(!bwtFiles.pacFile.exists()) throw new GATKException("PAC file is missing; please rerun 'bwa aln' to regenerate it."); - if(!bwtFiles.forwardBWTFile.exists()) throw new GATKException("Forward BWT file is missing; please rerun 'bwa aln' to regenerate it."); - if(!bwtFiles.forwardSAFile.exists()) throw new GATKException("Forward SA file is missing; please rerun 'bwa aln' to regenerate it."); - if(!bwtFiles.reverseBWTFile.exists()) throw new GATKException("Reverse BWT file is missing; please rerun 'bwa aln' to regenerate it."); - if(!bwtFiles.reverseSAFile.exists()) throw new GATKException("Reverse SA file is missing; please rerun 'bwa aln' to regenerate it."); + if(!bwtFiles.annFile.exists()) throw new ReviewedStingException("ANN file is missing; please rerun 'bwa aln' to regenerate it."); + if(!bwtFiles.ambFile.exists()) throw new ReviewedStingException("AMB file is missing; please rerun 'bwa aln' to regenerate it."); + if(!bwtFiles.pacFile.exists()) throw new ReviewedStingException("PAC file is missing; please rerun 'bwa aln' to regenerate it."); + if(!bwtFiles.forwardBWTFile.exists()) throw new ReviewedStingException("Forward BWT file is missing; please rerun 'bwa aln' to regenerate it."); + if(!bwtFiles.forwardSAFile.exists()) throw new ReviewedStingException("Forward SA file is missing; please rerun 'bwa aln' to regenerate it."); + if(!bwtFiles.reverseBWTFile.exists()) throw new ReviewedStingException("Reverse BWT file is missing; please rerun 'bwa aln' to regenerate it."); + if(!bwtFiles.reverseSAFile.exists()) throw new ReviewedStingException("Reverse SA file is missing; please rerun 'bwa aln' to regenerate it."); thunkPointer = create(bwtFiles,configuration); } @@ -60,7 +60,7 @@ public class BWACAligner extends BWAAligner { @Override public void updateConfiguration(BWAConfiguration configuration) { if(thunkPointer != 0) - throw new GATKException("BWA/C: attempting to update configuration of uninitialized aligner."); + throw new ReviewedStingException("BWA/C: attempting to update configuration of uninitialized aligner."); updateConfiguration(thunkPointer,configuration); } @@ -70,7 +70,7 @@ public class BWACAligner extends BWAAligner { @Override public void close() { if(thunkPointer == 0) - throw new GATKException("BWA/C close attempted, but BWA/C is not properly initialized."); + throw new ReviewedStingException("BWA/C close attempted, but BWA/C is not properly initialized."); destroy(thunkPointer); } @@ -82,7 +82,7 @@ public class BWACAligner extends BWAAligner { @Override public Alignment getBestAlignment(final byte[] bases) { if(thunkPointer == 0) - throw new GATKException("BWA/C getBestAlignment attempted, but BWA/C is not properly initialized."); + throw new ReviewedStingException("BWA/C getBestAlignment attempted, but BWA/C is not properly initialized."); return getBestAlignment(thunkPointer,bases); } @@ -193,7 +193,7 @@ public class BWACAligner extends BWAAligner { */ public BWAPath[] getPaths(byte[] bases) { if(thunkPointer == 0) - throw new GATKException("BWA/C getPaths attempted, but BWA/C is not properly initialized."); + throw new ReviewedStingException("BWA/C getPaths attempted, but BWA/C is not properly initialized."); return getPaths(thunkPointer,bases); } @@ -226,7 +226,7 @@ public class BWACAligner extends BWAAligner { */ protected Alignment[] convertPathsToAlignments(byte[] bases, BWAPath[] paths) { if(thunkPointer == 0) - throw new GATKException("BWA/C convertPathsToAlignments attempted, but BWA/C is not properly initialized."); + throw new ReviewedStingException("BWA/C convertPathsToAlignments attempted, but BWA/C is not properly initialized."); return convertPathsToAlignments(thunkPointer,bases,paths); } diff --git a/java/src/org/broadinstitute/sting/alignment/bwa/java/AlignerTestHarness.java b/java/src/org/broadinstitute/sting/alignment/bwa/java/AlignerTestHarness.java index 633d281a6..ae6e22221 100644 --- a/java/src/org/broadinstitute/sting/alignment/bwa/java/AlignerTestHarness.java +++ b/java/src/org/broadinstitute/sting/alignment/bwa/java/AlignerTestHarness.java @@ -2,7 +2,7 @@ package org.broadinstitute.sting.alignment.bwa.java; import org.broadinstitute.sting.alignment.Aligner; import org.broadinstitute.sting.alignment.Alignment; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import org.broadinstitute.sting.utils.BaseUtils; import java.io.File; @@ -61,7 +61,7 @@ public class AlignerTestHarness { alignmentCleaned = (SAMRecord)read.clone(); } catch( CloneNotSupportedException ex ) { - throw new GATKException("SAMRecord clone not supported", ex); + throw new ReviewedStingException("SAMRecord clone not supported", ex); } if( alignmentCleaned.getReadNegativeStrandFlag() ) diff --git a/java/src/org/broadinstitute/sting/alignment/bwa/java/AlignmentMatchSequence.java b/java/src/org/broadinstitute/sting/alignment/bwa/java/AlignmentMatchSequence.java index 503b406a6..879ecb5fb 100644 --- a/java/src/org/broadinstitute/sting/alignment/bwa/java/AlignmentMatchSequence.java +++ b/java/src/org/broadinstitute/sting/alignment/bwa/java/AlignmentMatchSequence.java @@ -1,6 +1,6 @@ package org.broadinstitute.sting.alignment.bwa.java; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import java.util.Deque; import java.util.ArrayDeque; @@ -32,7 +32,7 @@ public class AlignmentMatchSequence implements Cloneable { copy = (AlignmentMatchSequence)super.clone(); } catch( CloneNotSupportedException ex ) { - throw new GATKException("Unable to clone AlignmentMatchSequence."); + throw new ReviewedStingException("Unable to clone AlignmentMatchSequence."); } copy.entries = new ArrayDeque(); @@ -52,7 +52,7 @@ public class AlignmentMatchSequence implements Cloneable { case MATCH_MISMATCH: operator = CigarOperator.MATCH_OR_MISMATCH; break; case INSERTION: operator = CigarOperator.INSERTION; break; case DELETION: operator = CigarOperator.DELETION; break; - default: throw new GATKException("convertToCigar: cannot process state: " + entry.getAlignmentState()); + default: throw new ReviewedStingException("convertToCigar: cannot process state: " + entry.getAlignmentState()); } cigar.add( new CigarElement(entry.count,operator) ); } @@ -128,7 +128,7 @@ public class AlignmentMatchSequence implements Cloneable { return (AlignmentMatchSequenceEntry)super.clone(); } catch( CloneNotSupportedException ex ) { - throw new GATKException("Unable to clone AlignmentMatchSequenceEntry."); + throw new ReviewedStingException("Unable to clone AlignmentMatchSequenceEntry."); } } diff --git a/java/src/org/broadinstitute/sting/alignment/bwa/java/BWAAlignment.java b/java/src/org/broadinstitute/sting/alignment/bwa/java/BWAAlignment.java index e86ea858e..c59546bbb 100644 --- a/java/src/org/broadinstitute/sting/alignment/bwa/java/BWAAlignment.java +++ b/java/src/org/broadinstitute/sting/alignment/bwa/java/BWAAlignment.java @@ -1,7 +1,7 @@ package org.broadinstitute.sting.alignment.bwa.java; import org.broadinstitute.sting.alignment.Alignment; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import net.sf.samtools.Cigar; /** @@ -148,7 +148,7 @@ public class BWAAlignment extends Alignment implements Cloneable { newAlignment = (BWAAlignment)super.clone(); } catch( CloneNotSupportedException ex ) { - throw new GATKException("Unable to clone BWAAlignment."); + throw new ReviewedStingException("Unable to clone BWAAlignment."); } newAlignment.creationNumber = numCreated++; newAlignment.alignmentMatchSequence = alignmentMatchSequence.clone(); diff --git a/java/src/org/broadinstitute/sting/alignment/reference/bwt/BWT.java b/java/src/org/broadinstitute/sting/alignment/reference/bwt/BWT.java index 96ec794ce..7f8c48253 100644 --- a/java/src/org/broadinstitute/sting/alignment/reference/bwt/BWT.java +++ b/java/src/org/broadinstitute/sting/alignment/reference/bwt/BWT.java @@ -1,7 +1,7 @@ package org.broadinstitute.sting.alignment.reference.bwt; import org.broadinstitute.sting.alignment.reference.packing.PackUtils; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; /** * Represents the Burrows-Wheeler Transform of a reference sequence. @@ -124,7 +124,7 @@ public class BWT { */ protected byte getBase(long index) { if(index == inverseSA0) - throw new GATKException(String.format("Base at index %d does not have a text representation",index)); + throw new ReviewedStingException(String.format("Base at index %d does not have a text representation",index)); SequenceBlock block = getSequenceBlock(index); int position = getSequencePosition(index); diff --git a/java/src/org/broadinstitute/sting/alignment/reference/bwt/BWTReader.java b/java/src/org/broadinstitute/sting/alignment/reference/bwt/BWTReader.java index b4e095433..64a595419 100644 --- a/java/src/org/broadinstitute/sting/alignment/reference/bwt/BWTReader.java +++ b/java/src/org/broadinstitute/sting/alignment/reference/bwt/BWTReader.java @@ -1,6 +1,6 @@ package org.broadinstitute.sting.alignment.reference.bwt; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import org.broadinstitute.sting.alignment.reference.packing.UnsignedIntPackedInputStream; import org.broadinstitute.sting.alignment.reference.packing.BasePackedInputStream; import org.broadinstitute.sting.alignment.reference.packing.PackUtils; @@ -28,7 +28,7 @@ public class BWTReader { this.inputStream = new FileInputStream(inputFile); } catch( FileNotFoundException ex ) { - throw new GATKException("Unable to open input file", ex); + throw new ReviewedStingException("Unable to open input file", ex); } } @@ -66,7 +66,7 @@ public class BWTReader { } } catch( IOException ex ) { - throw new GATKException("Unable to read BWT from input stream.", ex); + throw new ReviewedStingException("Unable to read BWT from input stream.", ex); } return new BWT(inverseSA0, new Counts(count,true), sequenceBlocks); @@ -80,7 +80,7 @@ public class BWTReader { inputStream.close(); } catch( IOException ex ) { - throw new GATKException("Unable to close input file", ex); + throw new ReviewedStingException("Unable to close input file", ex); } } } diff --git a/java/src/org/broadinstitute/sting/alignment/reference/bwt/BWTWriter.java b/java/src/org/broadinstitute/sting/alignment/reference/bwt/BWTWriter.java index f8f7782ac..b3867ebfe 100644 --- a/java/src/org/broadinstitute/sting/alignment/reference/bwt/BWTWriter.java +++ b/java/src/org/broadinstitute/sting/alignment/reference/bwt/BWTWriter.java @@ -1,6 +1,6 @@ package org.broadinstitute.sting.alignment.reference.bwt; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import org.broadinstitute.sting.alignment.reference.packing.UnsignedIntPackedOutputStream; import org.broadinstitute.sting.alignment.reference.packing.BasePackedOutputStream; @@ -28,7 +28,7 @@ public class BWTWriter { this.outputStream = new BufferedOutputStream(new FileOutputStream(outputFile)); } catch( FileNotFoundException ex ) { - throw new GATKException("Unable to open output file", ex); + throw new ReviewedStingException("Unable to open output file", ex); } } @@ -53,7 +53,7 @@ public class BWTWriter { intPackedOutputStream.write(bwt.counts.toArray(false)); } catch( IOException ex ) { - throw new GATKException("Unable to read BWT from input stream.", ex); + throw new ReviewedStingException("Unable to read BWT from input stream.", ex); } } @@ -65,7 +65,7 @@ public class BWTWriter { outputStream.close(); } catch( IOException ex ) { - throw new GATKException("Unable to close input file", ex); + throw new ReviewedStingException("Unable to close input file", ex); } } } diff --git a/java/src/org/broadinstitute/sting/alignment/reference/bwt/Bases.java b/java/src/org/broadinstitute/sting/alignment/reference/bwt/Bases.java index 1a1e5e3ca..bc0a5b63d 100644 --- a/java/src/org/broadinstitute/sting/alignment/reference/bwt/Bases.java +++ b/java/src/org/broadinstitute/sting/alignment/reference/bwt/Bases.java @@ -1,6 +1,6 @@ package org.broadinstitute.sting.alignment.reference.bwt; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import java.util.*; @@ -87,7 +87,7 @@ public class Bases implements Iterable if( entry.getValue().equals(ascii) ) return entry.getKey(); } - throw new GATKException(String.format("Base %c is an invalid base to pack", (char)ascii)); + throw new ReviewedStingException(String.format("Base %c is an invalid base to pack", (char)ascii)); } /** diff --git a/java/src/org/broadinstitute/sting/alignment/reference/bwt/Counts.java b/java/src/org/broadinstitute/sting/alignment/reference/bwt/Counts.java index fc06f4136..268b11ac4 100644 --- a/java/src/org/broadinstitute/sting/alignment/reference/bwt/Counts.java +++ b/java/src/org/broadinstitute/sting/alignment/reference/bwt/Counts.java @@ -1,6 +1,6 @@ package org.broadinstitute.sting.alignment.reference.bwt; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import java.util.HashMap; import java.util.Map; @@ -96,7 +96,7 @@ public class Counts implements Cloneable { other = (Counts)super.clone(); } catch(CloneNotSupportedException ex) { - throw new GATKException("Unable to clone counts object", ex); + throw new ReviewedStingException("Unable to clone counts object", ex); } other.counts = new HashMap(counts); other.cumulativeCounts = new HashMap(cumulativeCounts); diff --git a/java/src/org/broadinstitute/sting/alignment/reference/bwt/CreateBWTFromReference.java b/java/src/org/broadinstitute/sting/alignment/reference/bwt/CreateBWTFromReference.java index a78e8633b..92bb713f0 100755 --- a/java/src/org/broadinstitute/sting/alignment/reference/bwt/CreateBWTFromReference.java +++ b/java/src/org/broadinstitute/sting/alignment/reference/bwt/CreateBWTFromReference.java @@ -31,7 +31,7 @@ import net.sf.picard.reference.ReferenceSequence; import java.io.*; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import org.broadinstitute.sting.alignment.reference.packing.PackUtils; /** @@ -182,7 +182,7 @@ public class CreateBWTFromReference { for( int i = 0; i < bwt.length(); i++ ) { if( bwtSequence[i] != existingBWTSequence[i] ) - throw new GATKException("BWT mismatch at " + i); + throw new ReviewedStingException("BWT mismatch at " + i); } File existingSAFile = new File(inputFileName+".sa"); @@ -193,7 +193,7 @@ public class CreateBWTFromReference { if( i % 10000 == 0 ) System.out.printf("Validating suffix array entry %d%n", i); if( suffixArray.get(i) != existingSuffixArray.get(i) ) - throw new GATKException(String.format("Suffix array mismatch at %d; SA is %d; should be %d",i,existingSuffixArray.get(i),suffixArray.get(i))); + throw new ReviewedStingException(String.format("Suffix array mismatch at %d; SA is %d; should be %d",i,existingSuffixArray.get(i),suffixArray.get(i))); } } diff --git a/java/src/org/broadinstitute/sting/alignment/reference/bwt/SuffixArray.java b/java/src/org/broadinstitute/sting/alignment/reference/bwt/SuffixArray.java index 48868895d..dba3633d1 100644 --- a/java/src/org/broadinstitute/sting/alignment/reference/bwt/SuffixArray.java +++ b/java/src/org/broadinstitute/sting/alignment/reference/bwt/SuffixArray.java @@ -1,6 +1,6 @@ package org.broadinstitute.sting.alignment.reference.bwt; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import java.util.Comparator; import java.util.TreeSet; @@ -53,7 +53,7 @@ public class SuffixArray { this.bwt = bwt; if(sequenceInterval != 1 && bwt == null) - throw new GATKException("A BWT must be provided if the sequence interval is not 1"); + throw new ReviewedStingException("A BWT must be provided if the sequence interval is not 1"); } /** @@ -118,7 +118,7 @@ public class SuffixArray { inverseSA0 = i; } if(inverseSA0 < 0) - throw new GATKException("Unable to find first inverse SA entry in generated suffix array."); + throw new ReviewedStingException("Unable to find first inverse SA entry in generated suffix array."); return new SuffixArray(inverseSA0,occurrences,suffixArray); } diff --git a/java/src/org/broadinstitute/sting/alignment/reference/bwt/SuffixArrayReader.java b/java/src/org/broadinstitute/sting/alignment/reference/bwt/SuffixArrayReader.java index 4fb983a5b..c10984145 100644 --- a/java/src/org/broadinstitute/sting/alignment/reference/bwt/SuffixArrayReader.java +++ b/java/src/org/broadinstitute/sting/alignment/reference/bwt/SuffixArrayReader.java @@ -1,6 +1,6 @@ package org.broadinstitute.sting.alignment.reference.bwt; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import org.broadinstitute.sting.alignment.reference.packing.UnsignedIntPackedInputStream; import org.broadinstitute.sting.alignment.reference.packing.PackUtils; @@ -35,7 +35,7 @@ public class SuffixArrayReader { this.bwt = bwt; } catch( FileNotFoundException ex ) { - throw new GATKException("Unable to open input file", ex); + throw new ReviewedStingException("Unable to open input file", ex); } } @@ -61,7 +61,7 @@ public class SuffixArrayReader { uintPackedInputStream.read(suffixArray); } catch( IOException ex ) { - throw new GATKException("Unable to read BWT from input stream.", ex); + throw new ReviewedStingException("Unable to read BWT from input stream.", ex); } return new SuffixArray(inverseSA0, new Counts(occurrences,true), suffixArray, suffixArrayInterval, bwt); @@ -76,7 +76,7 @@ public class SuffixArrayReader { inputStream.close(); } catch( IOException ex ) { - throw new GATKException("Unable to close input file", ex); + throw new ReviewedStingException("Unable to close input file", ex); } } } diff --git a/java/src/org/broadinstitute/sting/alignment/reference/bwt/SuffixArrayWriter.java b/java/src/org/broadinstitute/sting/alignment/reference/bwt/SuffixArrayWriter.java index febb87f8f..972fc2a15 100644 --- a/java/src/org/broadinstitute/sting/alignment/reference/bwt/SuffixArrayWriter.java +++ b/java/src/org/broadinstitute/sting/alignment/reference/bwt/SuffixArrayWriter.java @@ -1,6 +1,6 @@ package org.broadinstitute.sting.alignment.reference.bwt; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import org.broadinstitute.sting.alignment.reference.packing.UnsignedIntPackedOutputStream; import java.io.*; @@ -27,7 +27,7 @@ public class SuffixArrayWriter { this.outputStream = new BufferedOutputStream(new FileOutputStream(outputFile)); } catch( FileNotFoundException ex ) { - throw new GATKException("Unable to open input file", ex); + throw new ReviewedStingException("Unable to open input file", ex); } } @@ -48,7 +48,7 @@ public class SuffixArrayWriter { uintPackedOutputStream.write(suffixArray.sequence,1,suffixArray.sequence.length-1); } catch( IOException ex ) { - throw new GATKException("Unable to read BWT from input stream.", ex); + throw new ReviewedStingException("Unable to read BWT from input stream.", ex); } } @@ -61,7 +61,7 @@ public class SuffixArrayWriter { outputStream.close(); } catch( IOException ex ) { - throw new GATKException("Unable to close input file", ex); + throw new ReviewedStingException("Unable to close input file", ex); } } } diff --git a/java/src/org/broadinstitute/sting/alignment/reference/packing/BasePackedInputStream.java b/java/src/org/broadinstitute/sting/alignment/reference/packing/BasePackedInputStream.java index c3291774e..6681e37ec 100644 --- a/java/src/org/broadinstitute/sting/alignment/reference/packing/BasePackedInputStream.java +++ b/java/src/org/broadinstitute/sting/alignment/reference/packing/BasePackedInputStream.java @@ -1,6 +1,6 @@ package org.broadinstitute.sting.alignment.reference.packing; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import java.io.*; import java.nio.ByteOrder; @@ -51,7 +51,7 @@ public class BasePackedInputStream { public BasePackedInputStream( Class type, FileInputStream inputStream, ByteOrder byteOrder ) { if( type != Integer.class ) - throw new GATKException("Only bases packed into 32-bit words are currently supported by this input stream. Type specified: " + type.getName()); + throw new ReviewedStingException("Only bases packed into 32-bit words are currently supported by this input stream. Type specified: " + type.getName()); this.type = type; this.targetInputStream = inputStream; this.targetInputChannel = inputStream.getChannel(); diff --git a/java/src/org/broadinstitute/sting/alignment/reference/packing/BasePackedOutputStream.java b/java/src/org/broadinstitute/sting/alignment/reference/packing/BasePackedOutputStream.java index cfdb10949..c62f40e51 100644 --- a/java/src/org/broadinstitute/sting/alignment/reference/packing/BasePackedOutputStream.java +++ b/java/src/org/broadinstitute/sting/alignment/reference/packing/BasePackedOutputStream.java @@ -1,6 +1,6 @@ package org.broadinstitute.sting.alignment.reference.packing; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import java.io.*; import java.nio.ByteBuffer; @@ -134,7 +134,7 @@ public class BasePackedOutputStream { else if( type == Byte.class ) buffer.put((byte)packedBases); else - throw new GATKException("Cannot pack bases into type " + type.getName()); + throw new ReviewedStingException("Cannot pack bases into type " + type.getName()); targetOutputStream.write(buffer.array()); } } diff --git a/java/src/org/broadinstitute/sting/alignment/reference/packing/PackUtils.java b/java/src/org/broadinstitute/sting/alignment/reference/packing/PackUtils.java index 3ab0b7589..beed21b49 100644 --- a/java/src/org/broadinstitute/sting/alignment/reference/packing/PackUtils.java +++ b/java/src/org/broadinstitute/sting/alignment/reference/packing/PackUtils.java @@ -1,6 +1,6 @@ package org.broadinstitute.sting.alignment.reference.packing; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import java.io.File; import java.io.IOException; @@ -58,14 +58,14 @@ public class PackUtils { long typeSize = type.getField("MAX_VALUE").getLong(null) - type.getField("MIN_VALUE").getLong(null)+1; long intTypeSize = (long)Integer.MAX_VALUE - (long)Integer.MIN_VALUE + 1; if( typeSize > intTypeSize ) - throw new GATKException("Cannot determine number of bits available in type: " + type.getName()); + throw new ReviewedStingException("Cannot determine number of bits available in type: " + type.getName()); return (int)(Math.log(typeSize)/Math.log(2)); } catch( NoSuchFieldException ex ) { - throw new GATKException("Cannot determine number of bits available in type: " + type.getName(),ex); + throw new ReviewedStingException("Cannot determine number of bits available in type: " + type.getName(),ex); } catch( IllegalAccessException ex ) { - throw new GATKException("Cannot determine number of bits available in type: " + type.getName(),ex); + throw new ReviewedStingException("Cannot determine number of bits available in type: " + type.getName(),ex); } } @@ -85,7 +85,7 @@ public class PackUtils { case 'T': return 3; default: - throw new GATKException("Unknown base type: " + base); + throw new ReviewedStingException("Unknown base type: " + base); } } @@ -105,7 +105,7 @@ public class PackUtils { case 3: return 'T'; default: - throw new GATKException("Unknown pack type: " + pack); + throw new ReviewedStingException("Unknown pack type: " + pack); } } diff --git a/java/src/org/broadinstitute/sting/commandline/ArgumentDefinitionGroup.java b/java/src/org/broadinstitute/sting/commandline/ArgumentDefinitionGroup.java index 6ae6bc053..c36a8e04f 100644 --- a/java/src/org/broadinstitute/sting/commandline/ArgumentDefinitionGroup.java +++ b/java/src/org/broadinstitute/sting/commandline/ArgumentDefinitionGroup.java @@ -25,7 +25,7 @@ package org.broadinstitute.sting.commandline; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import java.util.List; import java.util.Collections; @@ -69,7 +69,7 @@ public class ArgumentDefinitionGroup implements Iterable { */ public ArgumentDefinitionGroup merge( ArgumentDefinitionGroup other ) { if( !groupNameMatches(other) ) - throw new GATKException("Unable to merge two argument groups with differing names."); + throw new ReviewedStingException("Unable to merge two argument groups with differing names."); // Create a merged definition group. List mergedDefinitions = new ArrayList(); diff --git a/java/src/org/broadinstitute/sting/commandline/ArgumentDefinitions.java b/java/src/org/broadinstitute/sting/commandline/ArgumentDefinitions.java index 88503eacd..39e698ca3 100755 --- a/java/src/org/broadinstitute/sting/commandline/ArgumentDefinitions.java +++ b/java/src/org/broadinstitute/sting/commandline/ArgumentDefinitions.java @@ -25,7 +25,7 @@ package org.broadinstitute.sting.commandline; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import java.util.Set; import java.util.HashSet; @@ -56,9 +56,9 @@ public class ArgumentDefinitions implements Iterable { if( definition.fullName.length() == 0 ) throw new IllegalArgumentException( "Argument cannot have 0-length fullname." ); if( hasArgumentDefinition( definition.fullName, FullNameDefinitionMatcher ) ) - throw new GATKException("Duplicate definition of argument with full name: " + definition.fullName); + throw new ReviewedStingException("Duplicate definition of argument with full name: " + definition.fullName); if( definition.shortName != null && hasArgumentDefinition( definition.shortName, ShortNameDefinitionMatcher ) ) - throw new GATKException("Duplicate definition of argument with short name: " + definition.shortName); + throw new ReviewedStingException("Duplicate definition of argument with short name: " + definition.shortName); argumentDefinitions.add( definition ); } diff --git a/java/src/org/broadinstitute/sting/commandline/ArgumentIOType.java b/java/src/org/broadinstitute/sting/commandline/ArgumentIOType.java index 9b21def56..fe33ab382 100644 --- a/java/src/org/broadinstitute/sting/commandline/ArgumentIOType.java +++ b/java/src/org/broadinstitute/sting/commandline/ArgumentIOType.java @@ -24,7 +24,7 @@ package org.broadinstitute.sting.commandline; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import java.lang.annotation.Annotation; @@ -46,6 +46,6 @@ public enum ArgumentIOType { for (ArgumentIOType ioType: ArgumentIOType.values()) if (ioType.annotationClass.isAssignableFrom(annotation.getClass())) return ioType; - throw new GATKException("Unknown annotation type: " + annotation); + throw new ReviewedStingException("Unknown annotation type: " + annotation); } } diff --git a/java/src/org/broadinstitute/sting/commandline/ArgumentSource.java b/java/src/org/broadinstitute/sting/commandline/ArgumentSource.java index fedbe815c..937c9549a 100644 --- a/java/src/org/broadinstitute/sting/commandline/ArgumentSource.java +++ b/java/src/org/broadinstitute/sting/commandline/ArgumentSource.java @@ -25,7 +25,7 @@ package org.broadinstitute.sting.commandline; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import java.lang.reflect.Field; import java.util.Arrays; @@ -208,7 +208,7 @@ public class ArgumentSource { */ public MultiplexArgumentTypeDescriptor createDependentTypeDescriptor(Object containingObject) { if(!isDependent()) - throw new GATKException("Field " + field.getName() + " is independent; no dependent type descriptor can be derived."); + throw new ReviewedStingException("Field " + field.getName() + " is independent; no dependent type descriptor can be derived."); return ((MultiplexArgumentTypeDescriptor)typeDescriptor).createCustomTypeDescriptor(this,containingObject); } diff --git a/java/src/org/broadinstitute/sting/commandline/ArgumentTypeDescriptor.java b/java/src/org/broadinstitute/sting/commandline/ArgumentTypeDescriptor.java index 8eea131e1..a7090f299 100644 --- a/java/src/org/broadinstitute/sting/commandline/ArgumentTypeDescriptor.java +++ b/java/src/org/broadinstitute/sting/commandline/ArgumentTypeDescriptor.java @@ -25,7 +25,7 @@ package org.broadinstitute.sting.commandline; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import org.broadinstitute.sting.utils.classloader.JVMUtils; import org.broadinstitute.sting.gatk.walkers.Multiplex; import org.broadinstitute.sting.gatk.walkers.Multiplexer; @@ -83,7 +83,7 @@ public abstract class ArgumentTypeDescriptor { if( descriptor.supports(type) ) return descriptor; } - throw new GATKException("Can't process command-line arguments of type: " + type.getName()); + throw new ReviewedStingException("Can't process command-line arguments of type: " + type.getName()); } /** @@ -265,7 +265,7 @@ public abstract class ArgumentTypeDescriptor { for (Class annotation: ARGUMENT_ANNOTATIONS) if (source.field.isAnnotationPresent(annotation)) return source.field.getAnnotation(annotation); - throw new GATKException("ArgumentAnnotation is not present for the argument field: " + source.field.getName()); + throw new ReviewedStingException("ArgumentAnnotation is not present for the argument field: " + source.field.getName()); } /** @@ -333,7 +333,7 @@ class SimpleArgumentTypeDescriptor extends ArgumentTypeDescriptor { for (Object val : vals) { if (String.valueOf(val).equalsIgnoreCase(value)) return val; try { if (type.getField(val.toString()).isAnnotationPresent(EnumerationArgumentDefault.class)) defaultEnumeration = val; } - catch (NoSuchFieldException e) { throw new GATKException("parsing " + type.toString() + "doesn't contain the field " + val.toString()); } + catch (NoSuchFieldException e) { throw new ReviewedStingException("parsing " + type.toString() + "doesn't contain the field " + val.toString()); } } // if their argument has no value (null), and there's a default, return that default for the enum value if (defaultEnumeration != null && value == null) @@ -349,7 +349,7 @@ class SimpleArgumentTypeDescriptor extends ArgumentTypeDescriptor { result = ctor.newInstance(value); } } catch (InvocationTargetException e) { - throw new GATKException("constructFromString:InvocationTargetException: Failed conversion - this is most likely caused by using an incorrect data type (e.g. a double when an int is required)"); + throw new ReviewedStingException("constructFromString:InvocationTargetException: Failed conversion - this is most likely caused by using an incorrect data type (e.g. a double when an int is required)"); } catch (Exception e) { throw new DynamicClassResolutionException(String.class, e); } @@ -416,11 +416,11 @@ class CompoundArgumentTypeDescriptor extends ArgumentTypeDescriptor { } catch (InstantiationException e) { logger.fatal("ArgumentParser: InstantiationException: cannot convert field " + source.field.getName()); - throw new GATKException("constructFromString:InstantiationException: Failed conversion " + e.getMessage()); + throw new ReviewedStingException("constructFromString:InstantiationException: Failed conversion " + e.getMessage()); } catch (IllegalAccessException e) { logger.fatal("ArgumentParser: IllegalAccessException: cannot convert field " + source.field.getName()); - throw new GATKException("constructFromString:IllegalAccessException: Failed conversion " + e.getMessage()); + throw new ReviewedStingException("constructFromString:IllegalAccessException: Failed conversion " + e.getMessage()); } for( ArgumentMatch match: matches ) { @@ -452,7 +452,7 @@ class CompoundArgumentTypeDescriptor extends ArgumentTypeDescriptor { } } else - throw new GATKException("Unsupported compound argument type: " + type); + throw new ReviewedStingException("Unsupported compound argument type: " + type); // WARNING: Side effect! parsingEngine.addTags(result,tags); @@ -520,7 +520,7 @@ class MultiplexArgumentTypeDescriptor extends ArgumentTypeDescriptor { @Override public Object createTypeDefault(ArgumentSource source,Class type) { if(multiplexer == null || multiplexedIds == null) - throw new GATKException("No multiplexed ids available"); + throw new ReviewedStingException("No multiplexed ids available"); Map multiplexedMapping = new HashMap(); Class componentType = getCollectionComponentType(source.field); @@ -539,7 +539,7 @@ class MultiplexArgumentTypeDescriptor extends ArgumentTypeDescriptor { @Override public Object parse(ParsingEngine parsingEngine, ArgumentSource source, Class type, ArgumentMatches matches) { if(multiplexedIds == null) - throw new GATKException("Cannot directly parse a MultiplexArgumentTypeDescriptor; must create a derivative type descriptor first."); + throw new ReviewedStingException("Cannot directly parse a MultiplexArgumentTypeDescriptor; must create a derivative type descriptor first."); Map multiplexedMapping = new HashMap(); @@ -570,14 +570,14 @@ class MultiplexArgumentTypeDescriptor extends ArgumentTypeDescriptor { if(!source.field.getName().equals(sourceField)) continue; if(source.field.isAnnotationPresent(Multiplex.class)) - throw new GATKException("Command-line arguments can only depend on independent fields"); + throw new ReviewedStingException("Command-line arguments can only depend on independent fields"); sourceTypes[currentField] = source.field.getType(); sourceValues[currentField] = JVMUtils.getFieldValue(source.field,containingObject); currentField++; fieldFound = true; } if(!fieldFound) - throw new GATKException(String.format("Unable to find source field %s, referred to by dependent field %s",sourceField,dependentArgument.field.getName())); + throw new ReviewedStingException(String.format("Unable to find source field %s, referred to by dependent field %s",sourceField,dependentArgument.field.getName())); } Class multiplexerType = dependentArgument.field.getAnnotation(Multiplex.class).value(); @@ -587,7 +587,7 @@ class MultiplexArgumentTypeDescriptor extends ArgumentTypeDescriptor { multiplexerConstructor.setAccessible(true); } catch(NoSuchMethodException ex) { - throw new GATKException(String.format("Unable to find constructor for class %s with parameters %s",multiplexerType.getName(),Arrays.deepToString(sourceFields)),ex); + throw new ReviewedStingException(String.format("Unable to find constructor for class %s with parameters %s",multiplexerType.getName(),Arrays.deepToString(sourceFields)),ex); } Multiplexer multiplexer = null; @@ -595,13 +595,13 @@ class MultiplexArgumentTypeDescriptor extends ArgumentTypeDescriptor { multiplexer = multiplexerConstructor.newInstance(sourceValues); } catch(IllegalAccessException ex) { - throw new GATKException(String.format("Constructor for class %s with parameters %s is inaccessible",multiplexerType.getName(),Arrays.deepToString(sourceFields)),ex); + throw new ReviewedStingException(String.format("Constructor for class %s with parameters %s is inaccessible",multiplexerType.getName(),Arrays.deepToString(sourceFields)),ex); } catch(InstantiationException ex) { - throw new GATKException(String.format("Can't create class %s with parameters %s",multiplexerType.getName(),Arrays.deepToString(sourceFields)),ex); + throw new ReviewedStingException(String.format("Can't create class %s with parameters %s",multiplexerType.getName(),Arrays.deepToString(sourceFields)),ex); } catch(InvocationTargetException ex) { - throw new GATKException(String.format("Can't invoke constructor of class %s with parameters %s",multiplexerType.getName(),Arrays.deepToString(sourceFields)),ex); + throw new ReviewedStingException(String.format("Can't invoke constructor of class %s with parameters %s",multiplexerType.getName(),Arrays.deepToString(sourceFields)),ex); } return new MultiplexArgumentTypeDescriptor(multiplexer,multiplexer.multiplex()); diff --git a/java/src/org/broadinstitute/sting/commandline/CommandLineUtils.java b/java/src/org/broadinstitute/sting/commandline/CommandLineUtils.java index 0fdeda438..9048cd200 100644 --- a/java/src/org/broadinstitute/sting/commandline/CommandLineUtils.java +++ b/java/src/org/broadinstitute/sting/commandline/CommandLineUtils.java @@ -25,7 +25,7 @@ package org.broadinstitute.sting.commandline; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import org.broadinstitute.sting.gatk.GenomeAnalysisEngine; import org.broadinstitute.sting.gatk.walkers.Walker; @@ -123,7 +123,7 @@ public class CommandLineUtils { try { return annotation.getClass().getMethod(method).invoke(annotation); } catch (Exception e) { - throw new GATKException("Unable to access method " + method + " on annotation " + annotation.getClass(), e); + throw new ReviewedStingException("Unable to access method " + method + " on annotation " + annotation.getClass(), e); } } } diff --git a/java/src/org/broadinstitute/sting/commandline/ParsingEngine.java b/java/src/org/broadinstitute/sting/commandline/ParsingEngine.java index 9b8e6ad23..261197ec8 100755 --- a/java/src/org/broadinstitute/sting/commandline/ParsingEngine.java +++ b/java/src/org/broadinstitute/sting/commandline/ParsingEngine.java @@ -25,7 +25,7 @@ package org.broadinstitute.sting.commandline; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import org.broadinstitute.sting.utils.collections.Pair; import org.broadinstitute.sting.utils.classloader.JVMUtils; import org.broadinstitute.sting.utils.Utils; @@ -294,7 +294,7 @@ public class ParsingEngine { // Grab the first argument definition and report that one as the failure. Theoretically, we should notify of all failures. List definitions = argumentSource.createArgumentDefinitions(); if(definitions.size() < 1) - throw new GATKException("Internal error. Argument source creates no definitions."); + throw new ReviewedStingException("Internal error. Argument source creates no definitions."); ArgumentDefinition definition = definitions.get(0); throw new UserException.DeprecatedArgument(definition.fullName,definition.doc); } @@ -315,7 +315,7 @@ public class ParsingEngine { // Abort if no home is found for the object. if( targets.size() == 0 ) - throw new GATKException("Internal command-line parser error: unable to find a home for argument matches " + argumentMatches); + throw new ReviewedStingException("Internal command-line parser error: unable to find a home for argument matches " + argumentMatches); for( Object target: targets ) { Object value = (argumentMatches.size() != 0) ? source.parse(this,argumentMatches) : source.createDefault(); diff --git a/java/src/org/broadinstitute/sting/gatk/GenomeAnalysisEngine.java b/java/src/org/broadinstitute/sting/gatk/GenomeAnalysisEngine.java index 2bcc58aac..725bc3727 100755 --- a/java/src/org/broadinstitute/sting/gatk/GenomeAnalysisEngine.java +++ b/java/src/org/broadinstitute/sting/gatk/GenomeAnalysisEngine.java @@ -31,7 +31,7 @@ import net.sf.samtools.*; import org.apache.log4j.Logger; import org.broadinstitute.sting.gatk.arguments.GATKArgumentCollection; import org.broadinstitute.sting.gatk.refdata.utils.helpers.DbSNPHelper; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import org.broadinstitute.sting.utils.exceptions.UserException; import org.broadinstitute.sting.utils.interval.IntervalMergingRule; import org.broadinstitute.sting.utils.interval.IntervalUtils; @@ -156,12 +156,12 @@ public class GenomeAnalysisEngine { // validate our parameters if (args == null) { - throw new GATKException("The GATKArgumentCollection passed to GenomeAnalysisEngine can not be null."); + throw new ReviewedStingException("The GATKArgumentCollection passed to GenomeAnalysisEngine can not be null."); } // validate our parameters if (my_walker == null) - throw new GATKException("The walker passed to GenomeAnalysisEngine can not be null."); + throw new ReviewedStingException("The walker passed to GenomeAnalysisEngine can not be null."); // save our argument parameter this.argCollection = args; @@ -808,7 +808,7 @@ public class GenomeAnalysisEngine { drivingDataSource.getSequenceDictionary(), SHARD_SIZE); } else - throw new GATKException("Unable to support walker of type" + walker.getClass().getName()); + throw new ReviewedStingException("Unable to support walker of type" + walker.getClass().getName()); return shardStrategy; } diff --git a/java/src/org/broadinstitute/sting/gatk/ReadMetrics.java b/java/src/org/broadinstitute/sting/gatk/ReadMetrics.java index fdc2cb459..27a86ab3f 100755 --- a/java/src/org/broadinstitute/sting/gatk/ReadMetrics.java +++ b/java/src/org/broadinstitute/sting/gatk/ReadMetrics.java @@ -30,7 +30,7 @@ import java.util.Map; import java.util.HashMap; import java.util.Collections; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; /** * Holds a bunch of basic information about the traversal. @@ -78,7 +78,7 @@ public class ReadMetrics implements Cloneable { newMetrics = (ReadMetrics)super.clone(); } catch(CloneNotSupportedException ex) { - throw new GATKException("Unable to clone runtime metrics",ex); + throw new ReviewedStingException("Unable to clone runtime metrics",ex); } newMetrics.nRecords = nRecords; newMetrics.nReads = nReads; diff --git a/java/src/org/broadinstitute/sting/gatk/WalkerManager.java b/java/src/org/broadinstitute/sting/gatk/WalkerManager.java index 18bf662eb..45675092c 100755 --- a/java/src/org/broadinstitute/sting/gatk/WalkerManager.java +++ b/java/src/org/broadinstitute/sting/gatk/WalkerManager.java @@ -30,7 +30,7 @@ import org.broadinstitute.sting.commandline.Hidden; import org.broadinstitute.sting.gatk.filters.FilterManager; import org.broadinstitute.sting.gatk.refdata.tracks.RMDTrack; import org.broadinstitute.sting.gatk.walkers.*; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import org.broadinstitute.sting.utils.classloader.PluginManager; import org.broadinstitute.sting.utils.text.TextFormattingUtils; import org.broadinstitute.sting.utils.help.DescriptionTaglet; @@ -168,7 +168,7 @@ public class WalkerManager extends PluginManager { public static DataSource getWalkerDataSource(Class walkerClass) { By byDataSource = walkerClass.getAnnotation(By.class); if( byDataSource == null ) - throw new GATKException("Unable to find By annotation for walker class " + walkerClass.getName()); + throw new ReviewedStingException("Unable to find By annotation for walker class " + walkerClass.getName()); return byDataSource.value(); } @@ -397,7 +397,7 @@ public class WalkerManager extends PluginManager { private static Requires getWalkerRequirements(Class walkerClass) { Requires requiresDataSource = walkerClass.getAnnotation(Requires.class); if( requiresDataSource == null ) - throw new GATKException( "Unable to find data types required by walker class " + walkerClass.getName()); + throw new ReviewedStingException( "Unable to find data types required by walker class " + walkerClass.getName()); return requiresDataSource; } diff --git a/java/src/org/broadinstitute/sting/gatk/arguments/GATKArgumentCollection.java b/java/src/org/broadinstitute/sting/gatk/arguments/GATKArgumentCollection.java index d80e95462..6abd8c209 100755 --- a/java/src/org/broadinstitute/sting/gatk/arguments/GATKArgumentCollection.java +++ b/java/src/org/broadinstitute/sting/gatk/arguments/GATKArgumentCollection.java @@ -27,7 +27,7 @@ package org.broadinstitute.sting.gatk.arguments; import net.sf.samtools.SAMFileReader; import org.broadinstitute.sting.gatk.phonehome.GATKRunReport; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import org.broadinstitute.sting.utils.interval.IntervalMergingRule; import org.broadinstitute.sting.commandline.Argument; import org.broadinstitute.sting.commandline.Input; @@ -191,7 +191,7 @@ public class GATKArgumentCollection { try { serializer.write(collection, result); } catch (Exception e) { - throw new GATKException("Failed to marshal the data to the file " + outputFile, e); + throw new ReviewedStingException("Failed to marshal the data to the file " + outputFile, e); } } @@ -206,7 +206,7 @@ public class GATKArgumentCollection { try { serializer.write(collection, outputFile); } catch (Exception e) { - throw new GATKException("Failed to marshal the data to the file " + outputFile, e); + throw new ReviewedStingException("Failed to marshal the data to the file " + outputFile, e); } } @@ -222,7 +222,7 @@ public class GATKArgumentCollection { GATKArgumentCollection example = serializer.read(GATKArgumentCollection.class, source); return example; } catch (Exception e) { - throw new GATKException("Failed to marshal the data from file " + filename, e); + throw new ReviewedStingException("Failed to marshal the data from file " + filename, e); } } @@ -237,7 +237,7 @@ public class GATKArgumentCollection { GATKArgumentCollection example = serializer.read(GATKArgumentCollection.class, file); return example; } catch (Exception e) { - throw new GATKException("Failed to marshal the data from file " + file.toString(), e); + throw new ReviewedStingException("Failed to marshal the data from file " + file.toString(), e); } } diff --git a/java/src/org/broadinstitute/sting/gatk/contexts/AlignmentContext.java b/java/src/org/broadinstitute/sting/gatk/contexts/AlignmentContext.java index 29867a7f4..255945619 100755 --- a/java/src/org/broadinstitute/sting/gatk/contexts/AlignmentContext.java +++ b/java/src/org/broadinstitute/sting/gatk/contexts/AlignmentContext.java @@ -26,7 +26,7 @@ package org.broadinstitute.sting.gatk.contexts; import net.sf.samtools.SAMRecord; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import org.broadinstitute.sting.utils.GenomeLoc; import org.broadinstitute.sting.utils.pileup.ReadBackedPileup; import org.broadinstitute.sting.utils.pileup.ReadBackedExtendedEventPileup; @@ -66,9 +66,9 @@ public class AlignmentContext { } public AlignmentContext(GenomeLoc loc, ReadBackedPileup basePileup, long skippedBases,boolean hasPileupBeenDownsampled ) { - if ( loc == null ) throw new GATKException("BUG: GenomeLoc in Alignment context is null"); - if ( basePileup == null ) throw new GATKException("BUG: ReadBackedPileup in Alignment context is null"); - if ( skippedBases < 0 ) throw new GATKException("BUG: skippedBases is -1 in Alignment context"); + if ( loc == null ) throw new ReviewedStingException("BUG: GenomeLoc in Alignment context is null"); + if ( basePileup == null ) throw new ReviewedStingException("BUG: ReadBackedPileup in Alignment context is null"); + if ( skippedBases < 0 ) throw new ReviewedStingException("BUG: skippedBases is -1 in Alignment context"); this.loc = loc; this.basePileup = basePileup; @@ -89,7 +89,7 @@ public class AlignmentContext { */ public ReadBackedPileup getBasePileup() { if(!hasBasePileup()) - throw new GATKException("No base pileup is available. Please check for a base pileup with hasBasePileup() before attempting to retrieve a pileup."); + throw new ReviewedStingException("No base pileup is available. Please check for a base pileup with hasBasePileup() before attempting to retrieve a pileup."); return basePileup; } @@ -99,7 +99,7 @@ public class AlignmentContext { */ public ReadBackedExtendedEventPileup getExtendedEventPileup() { if(!hasExtendedEventPileup()) - throw new GATKException("No extended event pileup is present."); + throw new ReviewedStingException("No extended event pileup is present."); return (ReadBackedExtendedEventPileup)basePileup; } diff --git a/java/src/org/broadinstitute/sting/gatk/contexts/ReferenceContext.java b/java/src/org/broadinstitute/sting/gatk/contexts/ReferenceContext.java index 0221ef3db..96d49fc2e 100644 --- a/java/src/org/broadinstitute/sting/gatk/contexts/ReferenceContext.java +++ b/java/src/org/broadinstitute/sting/gatk/contexts/ReferenceContext.java @@ -25,7 +25,7 @@ package org.broadinstitute.sting.gatk.contexts; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import org.broadinstitute.sting.utils.GenomeLoc; import org.broadinstitute.sting.utils.BaseUtils; import net.sf.samtools.util.StringUtil; @@ -191,7 +191,7 @@ public class ReferenceContext { byte[] b = new byte[stop-start]; if ( stop > bases.length ) - throw new GATKException("Bases beyond the current window requested: window="+window+", requested="+n); + throw new ReviewedStingException("Bases beyond the current window requested: window="+window+", requested="+n); int i = 0; for ( int j = start ; j < stop ; j++) b[i++]=bases[j]; diff --git a/java/src/org/broadinstitute/sting/gatk/contexts/StratifiedAlignmentContext.java b/java/src/org/broadinstitute/sting/gatk/contexts/StratifiedAlignmentContext.java index 2be1dea28..f42ab6a66 100755 --- a/java/src/org/broadinstitute/sting/gatk/contexts/StratifiedAlignmentContext.java +++ b/java/src/org/broadinstitute/sting/gatk/contexts/StratifiedAlignmentContext.java @@ -25,7 +25,7 @@ package org.broadinstitute.sting.gatk.contexts; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import org.broadinstitute.sting.utils.GenomeLoc; import org.broadinstitute.sting.utils.exceptions.UserException; import org.broadinstitute.sting.utils.pileup.*; @@ -72,7 +72,7 @@ public class StratifiedAlignmentContext { case REVERSE: return new AlignmentContext(loc,basePileup.getNegativeStrandPileup()); default: - throw new GATKException("Unable to get alignment context for type = " + type); + throw new ReviewedStingException("Unable to get alignment context for type = " + type); } } @@ -144,9 +144,9 @@ public class StratifiedAlignmentContext { boolean isExtended = contexts.iterator().next().basePileup instanceof ReadBackedExtendedEventPileup; for(StratifiedAlignmentContext context: contexts) { if(!loc.equals(context.getLocation())) - throw new GATKException("Illegal attempt to join contexts from different genomic locations"); + throw new ReviewedStingException("Illegal attempt to join contexts from different genomic locations"); if(isExtended != (context.basePileup instanceof ReadBackedExtendedEventPileup)) - throw new GATKException("Illegal attempt to join simple and extended contexts"); + throw new ReviewedStingException("Illegal attempt to join simple and extended contexts"); } AlignmentContext jointContext; diff --git a/java/src/org/broadinstitute/sting/gatk/contexts/variantcontext/VariantContextUtils.java b/java/src/org/broadinstitute/sting/gatk/contexts/variantcontext/VariantContextUtils.java index eb037cf09..522366289 100755 --- a/java/src/org/broadinstitute/sting/gatk/contexts/variantcontext/VariantContextUtils.java +++ b/java/src/org/broadinstitute/sting/gatk/contexts/variantcontext/VariantContextUtils.java @@ -30,7 +30,7 @@ import org.broad.tribble.util.popgen.HardyWeinbergCalculation; import org.broad.tribble.util.variantcontext.*; import org.broadinstitute.sting.utils.*; import org.broad.tribble.vcf.VCFConstants; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import org.broadinstitute.sting.utils.exceptions.UserException; public class VariantContextUtils { @@ -111,7 +111,7 @@ public class VariantContextUtils { */ public static List initializeMatchExps(String[] names, String[] exps) { if ( names == null || exps == null ) - throw new GATKException("BUG: neither names nor exps can be null: names " + Arrays.toString(names) + " exps=" + Arrays.toString(exps) ); + throw new ReviewedStingException("BUG: neither names nor exps can be null: names " + Arrays.toString(names) + " exps=" + Arrays.toString(exps) ); if ( names.length != exps.length ) throw new UserException("Inconsistent number of provided filter names and expressions: names=" + Arrays.toString(names) + " exps=" + Arrays.toString(exps)); @@ -323,7 +323,7 @@ public class VariantContextUtils { for ( VariantContext vc : VCs ) { if ( loc.getStart() != vc.getStart() ) // || !first.getReference().equals(vc.getReference()) ) - throw new GATKException("BUG: attempting to merge VariantContexts with different start sites: first="+ first.toString() + " second=" + vc.toString()); + throw new ReviewedStingException("BUG: attempting to merge VariantContexts with different start sites: first="+ first.toString() + " second=" + vc.toString()); if ( getLocation(vc).size() > loc.size() ) loc = getLocation(vc); // get the longest location @@ -450,7 +450,7 @@ public class VariantContextUtils { if ( ref == null || ref.length() < myRef.length() ) ref = myRef; else if ( ref.length() == myRef.length() && ! ref.equals(myRef) ) - throw new GATKException("BUG: equal length references with difference bases: "+ ref + " " + myRef); + throw new ReviewedStingException("BUG: equal length references with difference bases: "+ ref + " " + myRef); } return ref; @@ -472,7 +472,7 @@ public class VariantContextUtils { // Allele myRef = vc.getReference(); - if ( refAllele.length() <= myRef.length() ) throw new GATKException("BUG: myRef="+myRef+" is longer than refAllele="+refAllele); + if ( refAllele.length() <= myRef.length() ) throw new ReviewedStingException("BUG: myRef="+myRef+" is longer than refAllele="+refAllele); byte[] extraBases = Arrays.copyOfRange(refAllele.getBases(), myRef.length(), refAllele.length()); // System.out.printf("Remapping allele at %s%n", vc); @@ -577,7 +577,7 @@ public class VariantContextUtils { padVC = false; else if (refAllele.length() == locLength-1) padVC = true; - else throw new GATKException("Badly formed variant context, reference length must be at most one base shorter than location size"); + else throw new ReviewedStingException("Badly formed variant context, reference length must be at most one base shorter than location size"); // nothing to do if we don't need to pad bases @@ -591,7 +591,7 @@ public class VariantContextUtils { else if (attributes.containsKey(VariantContext.REFERENCE_BASE_FOR_INDEL_KEY)) refByte = (Byte)attributes.get(VariantContext.REFERENCE_BASE_FOR_INDEL_KEY); else - throw new GATKException("Error when trying to pad Variant Context: either input reference base must be a regular base, or input VC must contain reference base key"); + throw new ReviewedStingException("Error when trying to pad Variant Context: either input reference base must be a regular base, or input VC must contain reference base key"); List alleles = new ArrayList(); Map genotypes = new TreeMap(); diff --git a/java/src/org/broadinstitute/sting/gatk/datasources/DataSourceGenerationException.java b/java/src/org/broadinstitute/sting/gatk/datasources/DataSourceGenerationException.java index d1c2b2b76..7e6cab6c8 100644 --- a/java/src/org/broadinstitute/sting/gatk/datasources/DataSourceGenerationException.java +++ b/java/src/org/broadinstitute/sting/gatk/datasources/DataSourceGenerationException.java @@ -1,6 +1,6 @@ package org.broadinstitute.sting.gatk.datasources; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; /** * User: aaron @@ -20,7 +20,7 @@ import org.broadinstitute.sting.utils.exceptions.GATKException; * This exception is throw when we're unable to generate a data source, * most likely due to an incomplete input source list */ -public class DataSourceGenerationException extends GATKException { +public class DataSourceGenerationException extends ReviewedStingException { public DataSourceGenerationException(String message) { super(message); } diff --git a/java/src/org/broadinstitute/sting/gatk/datasources/providers/LocusReferenceView.java b/java/src/org/broadinstitute/sting/gatk/datasources/providers/LocusReferenceView.java index 83fefe700..eff273d0e 100755 --- a/java/src/org/broadinstitute/sting/gatk/datasources/providers/LocusReferenceView.java +++ b/java/src/org/broadinstitute/sting/gatk/datasources/providers/LocusReferenceView.java @@ -1,6 +1,6 @@ package org.broadinstitute.sting.gatk.datasources.providers; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import org.broadinstitute.sting.utils.GenomeLoc; import org.broadinstitute.sting.utils.GenomeLocParser; import org.broadinstitute.sting.gatk.walkers.Walker; @@ -85,8 +85,8 @@ public class LocusReferenceView extends ReferenceView { if( walker.getClass().isAnnotationPresent(Reference.class) ) { Window window = walker.getClass().getAnnotation(Reference.class).window(); - if( window.start() > 0 ) throw new GATKException( "Reference window starts after current locus" ); - if( window.stop() < 0 ) throw new GATKException( "Reference window ends before current locus" ); + if( window.start() > 0 ) throw new ReviewedStingException( "Reference window starts after current locus" ); + if( window.stop() < 0 ) throw new ReviewedStingException( "Reference window ends before current locus" ); windowStart = window.start(); windowStop = window.stop(); @@ -121,7 +121,7 @@ public class LocusReferenceView extends ReferenceView { if ( bounds==null || loc==null) return; // can bounds be null actually??? if ( isLocationWithinBounds(loc) ) return; if ( loc.getContigIndex() != bounds.getContigIndex() ) - throw new GATKException("Illegal attempt to expand reference view bounds to accommodate location on a different contig."); + throw new ReviewedStingException("Illegal attempt to expand reference view bounds to accommodate location on a different contig."); bounds = GenomeLocParser.createGenomeLoc(bounds.getContigIndex(), Math.min(bounds.getStart(),loc.getStart()), diff --git a/java/src/org/broadinstitute/sting/gatk/datasources/providers/ReferenceView.java b/java/src/org/broadinstitute/sting/gatk/datasources/providers/ReferenceView.java index ee4997164..385de4e5f 100755 --- a/java/src/org/broadinstitute/sting/gatk/datasources/providers/ReferenceView.java +++ b/java/src/org/broadinstitute/sting/gatk/datasources/providers/ReferenceView.java @@ -10,7 +10,7 @@ import net.sf.samtools.SAMSequenceRecord; import net.sf.samtools.SAMRecord; import net.sf.picard.reference.ReferenceSequence; import net.sf.picard.reference.IndexedFastaSequenceFile; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; /** * User: hanna * Date: May 22, 2009 @@ -80,7 +80,7 @@ public class ReferenceView implements View { int overhang = (int)(genomeLoc.getStop() - stop); if ( overhang > 0 ) { if ( overhang > BUFFER ) // todo -- this is a bit dangerous - throw new GATKException("Insufficient buffer size for Xs overhanging genome -- expand BUFFER"); + throw new ReviewedStingException("Insufficient buffer size for Xs overhanging genome -- expand BUFFER"); byte[] all = new byte[subsequence.getBases().length + overhang]; System.arraycopy(subsequence.getBases(), 0, all, 0, subsequence.getBases().length); System.arraycopy(Xs, 0, all, subsequence.getBases().length, overhang); diff --git a/java/src/org/broadinstitute/sting/gatk/datasources/providers/ShardDataProvider.java b/java/src/org/broadinstitute/sting/gatk/datasources/providers/ShardDataProvider.java index f4ca0b05c..cb912ccf9 100755 --- a/java/src/org/broadinstitute/sting/gatk/datasources/providers/ShardDataProvider.java +++ b/java/src/org/broadinstitute/sting/gatk/datasources/providers/ShardDataProvider.java @@ -2,7 +2,7 @@ package org.broadinstitute.sting.gatk.datasources.providers; import org.broadinstitute.sting.gatk.datasources.shards.Shard; import org.broadinstitute.sting.gatk.datasources.simpleDataSources.ReferenceOrderedDataSource; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import java.util.ArrayList; import java.util.List; @@ -110,7 +110,7 @@ public abstract class ShardDataProvider { Collection> conflicts = registeredView.getConflictingViews(); for( Class conflict: conflicts ) { if( conflict.isInstance(view) ) - throw new GATKException(String.format("Tried to register two conflicting views: %s and %s", + throw new ReviewedStingException(String.format("Tried to register two conflicting views: %s and %s", registeredView.getClass().getSimpleName(), view.getClass().getSimpleName())); } @@ -120,7 +120,7 @@ public abstract class ShardDataProvider { for( Class conflict: view.getConflictingViews() ) { for( View registeredView: registeredViews ) { if( conflict.isInstance(registeredView) ) - throw new GATKException(String.format("Tried to register two conflicting views: %s and %s", + throw new ReviewedStingException(String.format("Tried to register two conflicting views: %s and %s", registeredView.getClass().getSimpleName(), view.getClass().getSimpleName())); } diff --git a/java/src/org/broadinstitute/sting/gatk/datasources/shards/IntervalSharder.java b/java/src/org/broadinstitute/sting/gatk/datasources/shards/IntervalSharder.java index 5f9bdb958..0c4c08480 100644 --- a/java/src/org/broadinstitute/sting/gatk/datasources/shards/IntervalSharder.java +++ b/java/src/org/broadinstitute/sting/gatk/datasources/shards/IntervalSharder.java @@ -35,7 +35,7 @@ import java.util.*; import net.sf.samtools.*; import net.sf.picard.util.PeekableIterator; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; /** * Shard intervals based on position within the BAM file. @@ -124,7 +124,7 @@ public class IntervalSharder { for(GenomeLoc location: loci) { if(!location.getContig().equals(contig)) - throw new GATKException("Location outside bounds of contig"); + throw new ReviewedStingException("Location outside bounds of contig"); if(!binIterator.hasNext()) break; @@ -191,7 +191,7 @@ public class IntervalSharder { } else { if(lastFilePointer == null) - throw new GATKException("Illegal state: initializer failed to create cached file pointer."); + throw new ReviewedStingException("Illegal state: initializer failed to create cached file pointer."); // The start of the region overlaps the bin. Add the overlapping subset. final int regionStop = Math.min(locationStop,binStop); @@ -475,7 +475,7 @@ class BinQueueState implements Comparable { // Both BinQueueStates have next bins. Before proceeding, make sure the bin cache is valid. if(this.firstLocusInCurrentBin <= 0 || this.lastLocusInCurrentBin <= 0 || other.firstLocusInCurrentBin <= 0 || other.lastLocusInCurrentBin <= 0) { - throw new GATKException("Sharding mechanism error - bin->locus cache is invalid."); + throw new ReviewedStingException("Sharding mechanism error - bin->locus cache is invalid."); } // Straight integer subtraction works here because lhsStart, rhsStart always positive. diff --git a/java/src/org/broadinstitute/sting/gatk/datasources/shards/MonolithicShard.java b/java/src/org/broadinstitute/sting/gatk/datasources/shards/MonolithicShard.java index 2af2caf68..98df7b7b1 100644 --- a/java/src/org/broadinstitute/sting/gatk/datasources/shards/MonolithicShard.java +++ b/java/src/org/broadinstitute/sting/gatk/datasources/shards/MonolithicShard.java @@ -1,6 +1,6 @@ package org.broadinstitute.sting.gatk.datasources.shards; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import org.broadinstitute.sting.utils.GenomeLoc; import org.broadinstitute.sting.gatk.ReadMetrics; import org.broadinstitute.sting.gatk.ReadProperties; @@ -42,7 +42,7 @@ public class MonolithicShard implements Shard { public MonolithicShard(SAMDataSource readsDataSource, ShardType shardType, List locs) { this.readsDataSource = readsDataSource; if(shardType != ShardType.LOCUS && shardType != ShardType.READ) - throw new GATKException("Invalid shard type for monolithic shard: " + shardType); + throw new ReviewedStingException("Invalid shard type for monolithic shard: " + shardType); this.shardType = shardType; this.locs = locs; } diff --git a/java/src/org/broadinstitute/sting/gatk/datasources/shards/ShardStrategyFactory.java b/java/src/org/broadinstitute/sting/gatk/datasources/shards/ShardStrategyFactory.java index 74ee8361e..2bc7a3207 100644 --- a/java/src/org/broadinstitute/sting/gatk/datasources/shards/ShardStrategyFactory.java +++ b/java/src/org/broadinstitute/sting/gatk/datasources/shards/ShardStrategyFactory.java @@ -2,7 +2,7 @@ package org.broadinstitute.sting.gatk.datasources.shards; import net.sf.samtools.SAMSequenceDictionary; import net.sf.picard.reference.IndexedFastaSequenceFile; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import org.broadinstitute.sting.utils.GenomeLocSortedSet; import org.broadinstitute.sting.gatk.datasources.simpleDataSources.SAMDataSource; @@ -71,7 +71,7 @@ public class ShardStrategyFactory { case READS_EXPERIMENTAL: return new ReadShardStrategy(readsDataSource,null); default: - throw new GATKException("Strategy: " + strat + " isn't implemented for this type of shatter request"); + throw new ReviewedStingException("Strategy: " + strat + " isn't implemented for this type of shatter request"); } } @@ -109,7 +109,7 @@ public class ShardStrategyFactory { case READS_EXPERIMENTAL: return new ReadShardStrategy(readsDataSource,lst); default: - throw new GATKException("Strategy: " + strat + " isn't implemented"); + throw new ReviewedStingException("Strategy: " + strat + " isn't implemented"); } } diff --git a/java/src/org/broadinstitute/sting/gatk/datasources/simpleDataSources/ReferenceDataSource.java b/java/src/org/broadinstitute/sting/gatk/datasources/simpleDataSources/ReferenceDataSource.java index 83d4ad469..825131962 100644 --- a/java/src/org/broadinstitute/sting/gatk/datasources/simpleDataSources/ReferenceDataSource.java +++ b/java/src/org/broadinstitute/sting/gatk/datasources/simpleDataSources/ReferenceDataSource.java @@ -25,7 +25,7 @@ package org.broadinstitute.sting.gatk.datasources.simpleDataSources; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import net.sf.picard.reference.FastaSequenceIndexBuilder; import net.sf.picard.sam.CreateSequenceDictionary; import net.sf.picard.reference.IndexedFastaSequenceFile; @@ -68,7 +68,7 @@ public class ReferenceDataSource implements ReferenceDataSourceProgressListener try { // get exclusive lock if (!indexLock.exclusiveLock()) - throw new GATKException("Index file could not be written because a lock could not be obtained." + + throw new ReviewedStingException("Index file could not be written because a lock could not be obtained." + "If you are running multiple instances of GATK, another process is probably creating this " + "file now. Please wait until it is finished and try again."); FastaSequenceIndexBuilder faiBuilder = new FastaSequenceIndexBuilder(fastaFile, this); @@ -82,7 +82,7 @@ public class ReferenceDataSource implements ReferenceDataSourceProgressListener catch (Exception e) { // If lock creation succeeded, the failure must have been generating the index. // If lock creation failed, just skip over index creation entirely. - throw new GATKException("Index file does not exist and could not be created because " + e.getMessage(), e); + throw new ReviewedStingException("Index file does not exist and could not be created because " + e.getMessage(), e); } finally { indexLock.unlock(); @@ -108,7 +108,7 @@ public class ReferenceDataSource implements ReferenceDataSourceProgressListener try { // get shared lock on dict file so nobody else can start creating it if (!dictLock.exclusiveLock()) - throw new GATKException("Dictionary file could not be written because a lock could not be obtained." + + throw new ReviewedStingException("Dictionary file could not be written because a lock could not be obtained." + "If you are running multiple instances of GATK, another process is probably creating this " + "file now. Please wait until it is finished and try again."); // dict will be written to random temporary file in same directory (see note above) @@ -121,7 +121,7 @@ public class ReferenceDataSource implements ReferenceDataSourceProgressListener new CreateSequenceDictionary().instanceMain(args); if (!tempFile.renameTo(dictFile)) - throw new GATKException("Error transferring temp file " + tempFile + " to dict file " + dictFile); + throw new ReviewedStingException("Error transferring temp file " + tempFile + " to dict file " + dictFile); } catch(FileSystemInabilityToLockException ex) { logger.info("Unable to create write lock: " + ex.getMessage()); @@ -130,7 +130,7 @@ public class ReferenceDataSource implements ReferenceDataSourceProgressListener catch (Exception e) { // If lock creation succeeded, the failure must have been generating the index. // If lock creation failed, just skip over index creation entirely. - throw new GATKException("Dictionary file does not exist and could not be created because " + e.getMessage(), e); + throw new ReviewedStingException("Dictionary file does not exist and could not be created because " + e.getMessage(), e); } finally { dictLock.unlock(); @@ -149,7 +149,7 @@ public class ReferenceDataSource implements ReferenceDataSourceProgressListener try { try { if (!dictLock.sharedLock()) { - throw new GATKException("Could not open dictionary file because a lock could not be obtained."); + throw new ReviewedStingException("Could not open dictionary file because a lock could not be obtained."); } } catch(FileSystemInabilityToLockException ex) { @@ -159,7 +159,7 @@ public class ReferenceDataSource implements ReferenceDataSourceProgressListener try { if (!indexLock.sharedLock()) { - throw new GATKException("Could not open index file because a lock could not be obtained."); + throw new ReviewedStingException("Could not open index file because a lock could not be obtained."); } } catch(FileSystemInabilityToLockException ex) { diff --git a/java/src/org/broadinstitute/sting/gatk/datasources/simpleDataSources/ReferenceOrderedDataSource.java b/java/src/org/broadinstitute/sting/gatk/datasources/simpleDataSources/ReferenceOrderedDataSource.java index 1aaee0bb2..f67ed96f6 100755 --- a/java/src/org/broadinstitute/sting/gatk/datasources/simpleDataSources/ReferenceOrderedDataSource.java +++ b/java/src/org/broadinstitute/sting/gatk/datasources/simpleDataSources/ReferenceOrderedDataSource.java @@ -11,7 +11,7 @@ import org.broadinstitute.sting.gatk.refdata.utils.FlashBackIterator; import org.broadinstitute.sting.gatk.refdata.utils.LocationAwareSeekableRODIterator; import org.broadinstitute.sting.gatk.walkers.ReadWalker; import org.broadinstitute.sting.gatk.walkers.Walker; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import org.broadinstitute.sting.utils.GenomeLoc; import org.broadinstitute.sting.utils.exceptions.UserException; @@ -156,7 +156,7 @@ class ReferenceOrderedDataPool extends ResourcePool { // make sure we actually removed the assignment if (obj == null) - throw new GATKException("Failed to remove resource assignment; target key had no associated value in the resource assignment map"); + throw new ReviewedStingException("Failed to remove resource assignment; target key had no associated value in the resource assignment map"); // Return the resource to the pool. if( !allResources.contains(resource) ) - throw new GATKException("Iterator does not belong to the given pool."); + throw new ReviewedStingException("Iterator does not belong to the given pool."); availableResources.add(resource); } } diff --git a/java/src/org/broadinstitute/sting/gatk/datasources/simpleDataSources/SAMDataSource.java b/java/src/org/broadinstitute/sting/gatk/datasources/simpleDataSources/SAMDataSource.java index 69d43b92a..149468cb5 100755 --- a/java/src/org/broadinstitute/sting/gatk/datasources/simpleDataSources/SAMDataSource.java +++ b/java/src/org/broadinstitute/sting/gatk/datasources/simpleDataSources/SAMDataSource.java @@ -41,7 +41,7 @@ import org.broadinstitute.sting.gatk.ReadProperties; import org.broadinstitute.sting.gatk.ReadMetrics; import org.broadinstitute.sting.gatk.arguments.ValidationExclusion; import org.broadinstitute.sting.gatk.filters.CountingFilteringIterator; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import org.broadinstitute.sting.utils.exceptions.UserException; import java.io.File; @@ -294,7 +294,7 @@ public class SAMDataSource implements SimpleDataSource { */ public void fillShard(BAMFormatAwareShard shard) { if(!shard.buffersReads()) - throw new GATKException("Attempting to fill a non-buffering shard."); + throw new ReviewedStingException("Attempting to fill a non-buffering shard."); SAMReaders readers = resourcePool.getAvailableReaders(); // Cache the most recently viewed read so that we can check whether we've reached the end of a pair. @@ -326,7 +326,7 @@ public class SAMDataSource implements SimpleDataSource { return seekMonolithic(shard); if(!(shard instanceof BAMFormatAwareShard)) - throw new GATKException("BlockDrivenSAMDataSource cannot operate on shards of type: " + shard.getClass()); + throw new ReviewedStingException("BlockDrivenSAMDataSource cannot operate on shards of type: " + shard.getClass()); BAMFormatAwareShard bamAwareShard = (BAMFormatAwareShard)shard; if(bamAwareShard.buffersReads()) { @@ -349,7 +349,7 @@ public class SAMDataSource implements SimpleDataSource { if(readers.getReader(id) == read.getFileSource().getReader()) return id; } - throw new GATKException("Unable to find id for reader associated with read " + read.getReadName()); + throw new ReviewedStingException("Unable to find id for reader associated with read " + read.getReadName()); } /** @@ -508,7 +508,7 @@ public class SAMDataSource implements SimpleDataSource { public synchronized void releaseReaders(SAMReaders readers) { if(!allResources.contains(readers)) - throw new GATKException("Tried to return readers from the pool that didn't originate in the pool."); + throw new ReviewedStingException("Tried to return readers from the pool that didn't originate in the pool."); availableResources.add(readers); } @@ -523,12 +523,12 @@ public class SAMDataSource implements SimpleDataSource { if(id != null) return id; } - throw new GATKException("No such reader id is available"); + throw new ReviewedStingException("No such reader id is available"); } private synchronized void createNewResource() { if(allResources.size() > maxEntries) - throw new GATKException("Cannot create a new resource pool. All resources are in use."); + throw new ReviewedStingException("Cannot create a new resource pool. All resources are in use."); SAMReaders readers = new SAMReaders(readProperties); allResources.add(readers); availableResources.add(readers); diff --git a/java/src/org/broadinstitute/sting/gatk/datasources/simpleDataSources/SimpleDataSourceLoadException.java b/java/src/org/broadinstitute/sting/gatk/datasources/simpleDataSources/SimpleDataSourceLoadException.java index 7dc2b51fa..e890e6d3a 100644 --- a/java/src/org/broadinstitute/sting/gatk/datasources/simpleDataSources/SimpleDataSourceLoadException.java +++ b/java/src/org/broadinstitute/sting/gatk/datasources/simpleDataSources/SimpleDataSourceLoadException.java @@ -1,6 +1,6 @@ package org.broadinstitute.sting.gatk.datasources.simpleDataSources; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; /** * @@ -28,7 +28,7 @@ import org.broadinstitute.sting.utils.exceptions.GATKException; *

* Generate this on a simple data source load exception */ -public class SimpleDataSourceLoadException extends GATKException { +public class SimpleDataSourceLoadException extends ReviewedStingException { public SimpleDataSourceLoadException(String msg) { super(msg); } diff --git a/java/src/org/broadinstitute/sting/gatk/datasources/simpleDataSources/SimpleDataSourceSplitException.java b/java/src/org/broadinstitute/sting/gatk/datasources/simpleDataSources/SimpleDataSourceSplitException.java index 040327bc3..d83bb4ce9 100644 --- a/java/src/org/broadinstitute/sting/gatk/datasources/simpleDataSources/SimpleDataSourceSplitException.java +++ b/java/src/org/broadinstitute/sting/gatk/datasources/simpleDataSources/SimpleDataSourceSplitException.java @@ -2,7 +2,7 @@ package org.broadinstitute.sting.gatk.datasources.simpleDataSources; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; /* @@ -39,7 +39,7 @@ import org.broadinstitute.sting.utils.exceptions.GATKException; *

* an exception that get's thrown if we can't split up a data source appropriately */ -public class SimpleDataSourceSplitException extends GATKException { +public class SimpleDataSourceSplitException extends ReviewedStingException { public SimpleDataSourceSplitException(String msg) { super(msg); } diff --git a/java/src/org/broadinstitute/sting/gatk/datasources/utilities/BAMFileStat.java b/java/src/org/broadinstitute/sting/gatk/datasources/utilities/BAMFileStat.java index 1cadb1252..327c747f3 100644 --- a/java/src/org/broadinstitute/sting/gatk/datasources/utilities/BAMFileStat.java +++ b/java/src/org/broadinstitute/sting/gatk/datasources/utilities/BAMFileStat.java @@ -27,7 +27,7 @@ package org.broadinstitute.sting.gatk.datasources.utilities; import org.broadinstitute.sting.commandline.CommandLineProgram; import org.broadinstitute.sting.commandline.Argument; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import org.broadinstitute.sting.utils.instrumentation.Sizeof; import java.io.File; @@ -58,7 +58,7 @@ public class BAMFileStat extends CommandLineProgram { public int execute() { switch(command) { case ShowBlocks: - throw new GATKException("The BAM block inspector has been disabled."); + throw new ReviewedStingException("The BAM block inspector has been disabled."); case ShowIndex: showIndexBins(new File(bamFileName),range); break; @@ -171,7 +171,7 @@ public class BAMFileStat extends CommandLineProgram { } } catch(IllegalAccessException ex) { - throw new GATKException("Unable to examine cached index",ex); + throw new ReviewedStingException("Unable to examine cached index",ex); } System.out.printf("%nOverall: %d bins, %d chunks, %d linear index entries",numBins,numChunks,numLinearIndexEntries); diff --git a/java/src/org/broadinstitute/sting/gatk/executive/Accumulator.java b/java/src/org/broadinstitute/sting/gatk/executive/Accumulator.java index 6d2a25565..3cdcaddcf 100755 --- a/java/src/org/broadinstitute/sting/gatk/executive/Accumulator.java +++ b/java/src/org/broadinstitute/sting/gatk/executive/Accumulator.java @@ -29,7 +29,7 @@ import org.broadinstitute.sting.gatk.walkers.Walker; import org.broadinstitute.sting.gatk.datasources.providers.ShardDataProvider; import org.broadinstitute.sting.gatk.datasources.providers.LocusShardDataProvider; import org.broadinstitute.sting.gatk.GenomeAnalysisEngine; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import org.broadinstitute.sting.utils.GenomeLoc; import org.broadinstitute.sting.utils.collections.Pair; import org.broadinstitute.sting.utils.GenomeLocSortedSet; @@ -184,7 +184,7 @@ public abstract class Accumulator { */ public void accumulate( ShardDataProvider provider, Object result ) { if(!(provider instanceof LocusShardDataProvider)) - throw new GATKException("Unable to reduce by interval on reads traversals at this time."); + throw new ReviewedStingException("Unable to reduce by interval on reads traversals at this time."); GenomeLoc location = ((LocusShardDataProvider)provider).getLocus(); diff --git a/java/src/org/broadinstitute/sting/gatk/executive/HierarchicalMicroScheduler.java b/java/src/org/broadinstitute/sting/gatk/executive/HierarchicalMicroScheduler.java index 477d522a1..feae86587 100755 --- a/java/src/org/broadinstitute/sting/gatk/executive/HierarchicalMicroScheduler.java +++ b/java/src/org/broadinstitute/sting/gatk/executive/HierarchicalMicroScheduler.java @@ -8,7 +8,7 @@ import org.broadinstitute.sting.gatk.datasources.simpleDataSources.SAMDataSource import org.broadinstitute.sting.gatk.datasources.simpleDataSources.ReferenceOrderedDataSource; import org.broadinstitute.sting.gatk.io.*; import org.broadinstitute.sting.gatk.GenomeAnalysisEngine; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import org.broadinstitute.sting.utils.threading.ThreadPoolMonitor; import javax.management.MBeanServer; @@ -109,7 +109,7 @@ public class HierarchicalMicroScheduler extends MicroScheduler implements Hierar mbs.registerMBean(this, name); } catch (JMException ex) { - throw new GATKException("Unable to register microscheduler with JMX", ex); + throw new ReviewedStingException("Unable to register microscheduler with JMX", ex); } } @@ -129,7 +129,7 @@ public class HierarchicalMicroScheduler extends MicroScheduler implements Hierar while (isShardTraversePending() || isTreeReducePending()) { // Check for errors during execution. if(hasTraversalErrorOccurred()) - throw new GATKException("An error has occurred during the traversal.",getTraversalError()); + throw new ReviewedStingException("An error has occurred during the traversal.",getTraversalError()); // Too many files sitting around taking up space? Merge them. if (isMergeLimitExceeded()) @@ -158,7 +158,7 @@ public class HierarchicalMicroScheduler extends MicroScheduler implements Hierar notifyTraversalDone(walker,result); } catch (Exception ex) { - throw new GATKException("Unable to retrieve result", ex); + throw new ReviewedStingException("Unable to retrieve result", ex); } outputTracker.close(); @@ -358,7 +358,7 @@ public class HierarchicalMicroScheduler extends MicroScheduler implements Hierar private synchronized Throwable getTraversalError() { if(!hasTraversalErrorOccurred()) - throw new GATKException("User has attempted to retrieve a traversal error when none exists"); + throw new ReviewedStingException("User has attempted to retrieve a traversal error when none exists"); return error; } diff --git a/java/src/org/broadinstitute/sting/gatk/executive/ShardTraverser.java b/java/src/org/broadinstitute/sting/gatk/executive/ShardTraverser.java index 661a99fd6..62788737c 100755 --- a/java/src/org/broadinstitute/sting/gatk/executive/ShardTraverser.java +++ b/java/src/org/broadinstitute/sting/gatk/executive/ShardTraverser.java @@ -8,7 +8,7 @@ import org.broadinstitute.sting.gatk.traversals.TraversalEngine; import org.broadinstitute.sting.gatk.io.ThreadLocalOutputTracker; import org.broadinstitute.sting.gatk.walkers.Walker; import org.broadinstitute.sting.gatk.walkers.LocusWalker; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import java.util.concurrent.Callable; /** @@ -83,7 +83,7 @@ public class ShardTraverser implements Callable { catch(Throwable t) { // Notify that an exception has occurred and rethrow it. microScheduler.notifyOfTraversalError(t); - throw new GATKException("An error has occurred during traversal",t); + throw new ReviewedStingException("An error has occurred during traversal",t); } finally { synchronized(this) { @@ -115,7 +115,7 @@ public class ShardTraverser implements Callable { } } catch( InterruptedException ex ) { - throw new GATKException("Interrupted while waiting for more output to be finalized.",ex); + throw new ReviewedStingException("Interrupted while waiting for more output to be finalized.",ex); } } diff --git a/java/src/org/broadinstitute/sting/gatk/executive/TreeReducer.java b/java/src/org/broadinstitute/sting/gatk/executive/TreeReducer.java index 8485eafd5..8fb4adb5d 100755 --- a/java/src/org/broadinstitute/sting/gatk/executive/TreeReducer.java +++ b/java/src/org/broadinstitute/sting/gatk/executive/TreeReducer.java @@ -1,7 +1,7 @@ package org.broadinstitute.sting.gatk.executive; import org.broadinstitute.sting.gatk.walkers.TreeReducible; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import java.util.concurrent.Callable; import java.util.concurrent.Future; @@ -90,11 +90,11 @@ public class TreeReducer implements Callable { } catch( InterruptedException ex ) { microScheduler.notifyOfTraversalError(ex); - throw new GATKException("Hierarchical reduce interrupted", ex); + throw new ReviewedStingException("Hierarchical reduce interrupted", ex); } catch( ExecutionException ex ) { microScheduler.notifyOfTraversalError(ex); - throw new GATKException("Hierarchical reduce failed", ex); + throw new ReviewedStingException("Hierarchical reduce failed", ex); } long endTime = System.currentTimeMillis(); diff --git a/java/src/org/broadinstitute/sting/gatk/io/OutputTracker.java b/java/src/org/broadinstitute/sting/gatk/io/OutputTracker.java index 92bf8327b..5acf579e7 100755 --- a/java/src/org/broadinstitute/sting/gatk/io/OutputTracker.java +++ b/java/src/org/broadinstitute/sting/gatk/io/OutputTracker.java @@ -25,7 +25,7 @@ package org.broadinstitute.sting.gatk.io; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import org.broadinstitute.sting.utils.classloader.JVMUtils; import org.broadinstitute.sting.commandline.ArgumentSource; import org.broadinstitute.sting.utils.sam.SAMFileReaderBuilder; @@ -139,7 +139,7 @@ public abstract class OutputTracker { */ protected T getTargetStream( Stub stub ) { if( !outputs.containsKey(stub) ) - throw new GATKException("OutputTracker was not notified that this stub exists: " + stub); + throw new ReviewedStingException("OutputTracker was not notified that this stub exists: " + stub); Storage storage = outputs.get(stub); if( storage == null ) { storage = StorageFactory.createStorage(stub); diff --git a/java/src/org/broadinstitute/sting/gatk/io/storage/OutputStreamStorage.java b/java/src/org/broadinstitute/sting/gatk/io/storage/OutputStreamStorage.java index 541a46b3b..4dc976289 100644 --- a/java/src/org/broadinstitute/sting/gatk/io/storage/OutputStreamStorage.java +++ b/java/src/org/broadinstitute/sting/gatk/io/storage/OutputStreamStorage.java @@ -25,7 +25,7 @@ package org.broadinstitute.sting.gatk.io.storage; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import org.broadinstitute.sting.gatk.io.stubs.OutputStreamStub; import org.broadinstitute.sting.utils.exceptions.UserException; @@ -59,7 +59,7 @@ public class OutputStreamStorage extends OutputStream implements Storage, VCFWriter { this.stream = stub.getOutputStream(); } else - throw new GATKException("Unable to create target to which to write; storage was provided with neither a file nor a stream."); + throw new ReviewedStingException("Unable to create target to which to write; storage was provided with neither a file nor a stream."); writer = new StandardVCFWriter(stream); } diff --git a/java/src/org/broadinstitute/sting/gatk/io/stubs/SAMFileWriterStub.java b/java/src/org/broadinstitute/sting/gatk/io/stubs/SAMFileWriterStub.java index 2b5cc7917..ca73ac29d 100644 --- a/java/src/org/broadinstitute/sting/gatk/io/stubs/SAMFileWriterStub.java +++ b/java/src/org/broadinstitute/sting/gatk/io/stubs/SAMFileWriterStub.java @@ -35,7 +35,7 @@ import java.io.OutputStream; import org.broadinstitute.sting.gatk.io.OutputTracker; import org.broadinstitute.sting.gatk.io.StingSAMFileWriter; import org.broadinstitute.sting.gatk.GenomeAnalysisEngine; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import org.broadinstitute.sting.utils.exceptions.UserException; /** @@ -156,7 +156,7 @@ public class SAMFileWriterStub implements Stub, StingSAMFileWrite */ public void setCompressionLevel( Integer compressionLevel ) { if(writeStarted) - throw new GATKException("Attempted to change the compression level of a file with alignments already in it."); + throw new ReviewedStingException("Attempted to change the compression level of a file with alignments already in it."); this.compressionLevel = compressionLevel; } @@ -192,7 +192,7 @@ public class SAMFileWriterStub implements Stub, StingSAMFileWrite */ public void setPresorted(boolean presorted) { if(writeStarted) - throw new GATKException("Attempted to change the presorted state of a file with alignments already in it."); + throw new ReviewedStingException("Attempted to change the presorted state of a file with alignments already in it."); this.presorted = presorted; } @@ -210,7 +210,7 @@ public class SAMFileWriterStub implements Stub, StingSAMFileWrite */ public void setMaxRecordsInRam(int maxRecordsInRam) { if(writeStarted) - throw new GATKException("Attempted to change the max records in RAM of a file with alignments already in it."); + throw new ReviewedStingException("Attempted to change the max records in RAM of a file with alignments already in it."); this.maxRecordsInRam = maxRecordsInRam; } @@ -228,7 +228,7 @@ public class SAMFileWriterStub implements Stub, StingSAMFileWrite */ public void writeHeader(SAMFileHeader header) { if(writeStarted) - throw new GATKException("Attempted to change the header of a file with alignments already in it."); + throw new ReviewedStingException("Attempted to change the header of a file with alignments already in it."); this.headerOverride = header; } diff --git a/java/src/org/broadinstitute/sting/gatk/iterators/BufferingReadIterator.java b/java/src/org/broadinstitute/sting/gatk/iterators/BufferingReadIterator.java index f913f9464..f3a060be1 100644 --- a/java/src/org/broadinstitute/sting/gatk/iterators/BufferingReadIterator.java +++ b/java/src/org/broadinstitute/sting/gatk/iterators/BufferingReadIterator.java @@ -31,7 +31,7 @@ import java.util.Queue; import java.util.LinkedList; import java.util.NoSuchElementException; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; /** * Buffers access to a large stream of reads, replenishing the buffer only when the reads @@ -66,7 +66,7 @@ public class BufferingReadIterator implements CloseableIterator { } public void remove() { - throw new GATKException("Unable to remove from a BufferingReadIterator"); + throw new ReviewedStingException("Unable to remove from a BufferingReadIterator"); } /** diff --git a/java/src/org/broadinstitute/sting/gatk/phonehome/GATKRunReport.java b/java/src/org/broadinstitute/sting/gatk/phonehome/GATKRunReport.java index 6cab3a353..9d67fdf05 100644 --- a/java/src/org/broadinstitute/sting/gatk/phonehome/GATKRunReport.java +++ b/java/src/org/broadinstitute/sting/gatk/phonehome/GATKRunReport.java @@ -30,7 +30,7 @@ import org.broadinstitute.sting.gatk.CommandLineGATK; import org.broadinstitute.sting.gatk.GenomeAnalysisEngine; import org.broadinstitute.sting.gatk.arguments.GATKArgumentCollection; import org.broadinstitute.sting.gatk.walkers.Walker; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import org.broadinstitute.sting.utils.Utils; import org.simpleframework.xml.Element; import org.simpleframework.xml.ElementList; @@ -169,7 +169,7 @@ public class GATKRunReport { */ public GATKRunReport(Walker walker, Exception e, GenomeAnalysisEngine engine, PhoneHomeOption type) { if ( type == PhoneHomeOption.NO_ET ) - throw new GATKException("Trying to create a run report when type is NO_ET!"); + throw new ReviewedStingException("Trying to create a run report when type is NO_ET!"); mGATKHeader = CommandLineGATK.createApplicationHeader(); currentPath = System.getProperty("user.dir"); @@ -245,7 +245,7 @@ public class GATKRunReport { serializer.write(this, stream); //throw new StingException("test"); } catch (Exception e) { - throw new GATKException("Failed to marshal the data to the file " + stream, e); + throw new ReviewedStingException("Failed to marshal the data to the file " + stream, e); } } diff --git a/java/src/org/broadinstitute/sting/gatk/refdata/IntervalRod.java b/java/src/org/broadinstitute/sting/gatk/refdata/IntervalRod.java index 0b1c41857..63ee1a62b 100755 --- a/java/src/org/broadinstitute/sting/gatk/refdata/IntervalRod.java +++ b/java/src/org/broadinstitute/sting/gatk/refdata/IntervalRod.java @@ -1,6 +1,6 @@ package org.broadinstitute.sting.gatk.refdata; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import org.broadinstitute.sting.utils.GenomeLoc; import java.io.File; @@ -28,7 +28,7 @@ public class IntervalRod extends BasicReferenceOrderedDatum { } public String repl() { - throw new GATKException("repl() is not implemented yet"); + throw new ReviewedStingException("repl() is not implemented yet"); } public String toSimpleString() { return loc.toString(); } diff --git a/java/src/org/broadinstitute/sting/gatk/refdata/PlinkRod.java b/java/src/org/broadinstitute/sting/gatk/refdata/PlinkRod.java index 215c09f55..3b879b232 100644 --- a/java/src/org/broadinstitute/sting/gatk/refdata/PlinkRod.java +++ b/java/src/org/broadinstitute/sting/gatk/refdata/PlinkRod.java @@ -1,7 +1,7 @@ package org.broadinstitute.sting.gatk.refdata; import org.broad.tribble.util.variantcontext.Allele; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import org.broadinstitute.sting.utils.GenomeLoc; import org.broadinstitute.sting.utils.GenomeLocParser; @@ -65,7 +65,7 @@ public class PlinkRod extends BasicReferenceOrderedDatum implements Iterator implements Ite named_constructor = type.getConstructor(String.class); } catch (java.lang.NoSuchMethodException e) { - throw new GATKException("ROD class "+type.getName()+" does not have constructor that accepts a single String argument (track name)"); + throw new ReviewedStingException("ROD class "+type.getName()+" does not have constructor that accepts a single String argument (track name)"); } ROD rod = instantiateROD(name); fieldDelimiter = rod.delimiterRegex(); // get delimiter from the ROD itself diff --git a/java/src/org/broadinstitute/sting/gatk/refdata/RODRecordListImpl.java b/java/src/org/broadinstitute/sting/gatk/refdata/RODRecordListImpl.java index e5f0487d5..3a7b26753 100644 --- a/java/src/org/broadinstitute/sting/gatk/refdata/RODRecordListImpl.java +++ b/java/src/org/broadinstitute/sting/gatk/refdata/RODRecordListImpl.java @@ -2,7 +2,7 @@ package org.broadinstitute.sting.gatk.refdata; import org.broadinstitute.sting.gatk.refdata.utils.GATKFeature; import org.broadinstitute.sting.gatk.refdata.utils.RODRecordList; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import org.broadinstitute.sting.utils.GenomeLoc; import java.util.*; @@ -47,10 +47,10 @@ public class RODRecordListImpl extends AbstractList implements Comp records.add(r); if ( r == null ) continue; if ( ! this.name.equals(r.getName() ) ) { - throw new GATKException("Attempt to add GATKFeature with non-matching name "+r.getName()+" to the track "+name); + throw new ReviewedStingException("Attempt to add GATKFeature with non-matching name "+r.getName()+" to the track "+name); } if ( location != null && ! location.overlapsP(r.getLocation()) ) { - throw new GATKException("Attempt to add GATKFeature that lies outside of specified interval "+location+"; offending GATKFeature:\n"+r.toString()); + throw new ReviewedStingException("Attempt to add GATKFeature that lies outside of specified interval "+location+"; offending GATKFeature:\n"+r.toString()); } } } @@ -72,7 +72,7 @@ public class RODRecordListImpl extends AbstractList implements Comp public void add(GATKFeature record, boolean allowNameMismatch) { if ( record != null ) { if ( ! allowNameMismatch && ! name.equals(record.getName() ) ) - throw new GATKException("Attempt to add GATKFeature with non-matching name "+record.getName()+" to the track "+name); + throw new ReviewedStingException("Attempt to add GATKFeature with non-matching name "+record.getName()+" to the track "+name); } records.add(record); } diff --git a/java/src/org/broadinstitute/sting/gatk/refdata/RefMetaDataTracker.java b/java/src/org/broadinstitute/sting/gatk/refdata/RefMetaDataTracker.java index a9d82a112..6bb6d19dc 100644 --- a/java/src/org/broadinstitute/sting/gatk/refdata/RefMetaDataTracker.java +++ b/java/src/org/broadinstitute/sting/gatk/refdata/RefMetaDataTracker.java @@ -5,7 +5,7 @@ import org.broad.tribble.util.variantcontext.VariantContext; import org.broadinstitute.sting.gatk.contexts.ReferenceContext; import org.broadinstitute.sting.gatk.refdata.utils.GATKFeature; import org.broadinstitute.sting.gatk.refdata.utils.RODRecordList; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import org.broadinstitute.sting.utils.GenomeLoc; import org.broadinstitute.sting.utils.exceptions.UserException; @@ -290,7 +290,7 @@ public class RefMetaDataTracker { Collection contexts = getVariantContexts(ref, name, allowedTypes, curLocation, requireStartHere, false ); if ( contexts.size() > 1 ) - throw new GATKException("Requested a single VariantContext object for track " + name + " but multiple variants were present at position " + curLocation); + throw new ReviewedStingException("Requested a single VariantContext object for track " + name + " but multiple variants were present at position " + curLocation); else if ( contexts.size() == 0 ) return null; else diff --git a/java/src/org/broadinstitute/sting/gatk/refdata/SeekableRODIterator.java b/java/src/org/broadinstitute/sting/gatk/refdata/SeekableRODIterator.java index f0180a4be..c995f53bc 100644 --- a/java/src/org/broadinstitute/sting/gatk/refdata/SeekableRODIterator.java +++ b/java/src/org/broadinstitute/sting/gatk/refdata/SeekableRODIterator.java @@ -5,7 +5,7 @@ import org.broadinstitute.sting.gatk.iterators.PushbackIterator; import org.broadinstitute.sting.gatk.refdata.utils.GATKFeature; import org.broadinstitute.sting.gatk.refdata.utils.LocationAwareSeekableRODIterator; import org.broadinstitute.sting.gatk.refdata.utils.RODRecordList; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import org.broadinstitute.sting.utils.GenomeLoc; import org.broadinstitute.sting.utils.GenomeLocParser; import org.broadinstitute.sting.utils.exceptions.UserException; @@ -131,7 +131,7 @@ public class SeekableRODIterator implements LocationAwareSeekableRODIterator { */ public RODRecordList next() { if ( ! next_is_allowed ) - throw new GATKException("Illegal use of iterator: Can not advance iterator with next() after seek-forward query of length > 1"); + throw new ReviewedStingException("Illegal use of iterator: Can not advance iterator with next() after seek-forward query of length > 1"); curr_position++; // curr_query_end = -1; @@ -178,7 +178,7 @@ public class SeekableRODIterator implements LocationAwareSeekableRODIterator { r = it.next(); // we got here only if we do need next record, time to load it for real long stop = r.getLocation().getStop(); - if ( stop < curr_position ) throw new GATKException("DEBUG: encountered contig that should have been loaded earlier"); // this should never happen + if ( stop < curr_position ) throw new ReviewedStingException("DEBUG: encountered contig that should have been loaded earlier"); // this should never happen if ( stop > max_position ) max_position = stop; // max_position keeps the rightmost stop position across all loaded records records.add(r); } @@ -257,14 +257,14 @@ public class SeekableRODIterator implements LocationAwareSeekableRODIterator { public RODRecordList seekForward(GenomeLoc interval) { if ( interval.getContigIndex() < curr_contig ) - throw new GATKException("Out of order query: query contig "+interval.getContig()+" is located before "+ + throw new ReviewedStingException("Out of order query: query contig "+interval.getContig()+" is located before "+ "the iterator's current contig"); if ( interval.getContigIndex() == curr_contig ) { if ( interval.getStart() < curr_position ) - throw new GATKException("Out of order query: query position "+interval +" is located before "+ + throw new ReviewedStingException("Out of order query: query position "+interval +" is located before "+ "the iterator's current position "+curr_contig + ":" + curr_position); if ( interval.getStop() < curr_query_end ) - throw new GATKException("Unsupported querying sequence: current query interval " + + throw new ReviewedStingException("Unsupported querying sequence: current query interval " + interval+" ends before the end of previous query interval ("+curr_query_end+")"); } diff --git a/java/src/org/broadinstitute/sting/gatk/refdata/features/refseq/RefSeqFeature.java b/java/src/org/broadinstitute/sting/gatk/refdata/features/refseq/RefSeqFeature.java index 6e9eb88de..af895b262 100644 --- a/java/src/org/broadinstitute/sting/gatk/refdata/features/refseq/RefSeqFeature.java +++ b/java/src/org/broadinstitute/sting/gatk/refdata/features/refseq/RefSeqFeature.java @@ -4,7 +4,7 @@ import org.broad.tribble.Feature; import org.broadinstitute.sting.gatk.refdata.Transcript; import org.broadinstitute.sting.gatk.refdata.utils.GATKFeature; import org.broadinstitute.sting.gatk.refdata.utils.RODRecordList; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import org.broadinstitute.sting.utils.GenomeLoc; import org.broadinstitute.sting.utils.GenomeLocParser; @@ -60,7 +60,7 @@ public class RefSeqFeature implements Transcript, Feature { /** Genomic location of the n-th exon; throws an exception if n is out of bounds */ public GenomeLoc getExonLocation(int n) { - if ( n >= exons.size() || n < 0 ) throw new GATKException("Index out-of-bounds. Transcript has " + exons.size() +" exons; requested: "+n); + if ( n >= exons.size() || n < 0 ) throw new ReviewedStingException("Index out-of-bounds. Transcript has " + exons.size() +" exons; requested: "+n); return exons.get(n); } diff --git a/java/src/org/broadinstitute/sting/gatk/refdata/tracks/RMDTrackCreationException.java b/java/src/org/broadinstitute/sting/gatk/refdata/tracks/RMDTrackCreationException.java index 484d90fdf..29aefacc6 100644 --- a/java/src/org/broadinstitute/sting/gatk/refdata/tracks/RMDTrackCreationException.java +++ b/java/src/org/broadinstitute/sting/gatk/refdata/tracks/RMDTrackCreationException.java @@ -23,7 +23,7 @@ package org.broadinstitute.sting.gatk.refdata.tracks; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; /** @@ -34,7 +34,7 @@ import org.broadinstitute.sting.utils.exceptions.GATKException; * * if we fail for some reason to make a track, throw this exception */ -public class RMDTrackCreationException extends GATKException { +public class RMDTrackCreationException extends ReviewedStingException { public RMDTrackCreationException(String msg) { super(msg); } diff --git a/java/src/org/broadinstitute/sting/gatk/refdata/tracks/TribbleTrack.java b/java/src/org/broadinstitute/sting/gatk/refdata/tracks/TribbleTrack.java index 9694bcb24..4890bb9a0 100644 --- a/java/src/org/broadinstitute/sting/gatk/refdata/tracks/TribbleTrack.java +++ b/java/src/org/broadinstitute/sting/gatk/refdata/tracks/TribbleTrack.java @@ -30,7 +30,7 @@ import org.broad.tribble.FeatureSource; import org.broad.tribble.source.BasicFeatureSource; import org.broadinstitute.sting.gatk.refdata.utils.FeatureToGATKFeatureIterator; import org.broadinstitute.sting.gatk.refdata.utils.GATKFeature; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import org.broadinstitute.sting.utils.GenomeLoc; import org.broadinstitute.sting.utils.exceptions.UserException; @@ -115,7 +115,7 @@ public class TribbleTrack extends RMDTrack implements QueryableTrack { try { reader.close(); } catch (IOException e) { - throw new GATKException("Unable to close reader " + reader.toString(),e); + throw new ReviewedStingException("Unable to close reader " + reader.toString(),e); } reader = null; } diff --git a/java/src/org/broadinstitute/sting/gatk/refdata/tracks/builders/TribbleRMDTrackBuilder.java b/java/src/org/broadinstitute/sting/gatk/refdata/tracks/builders/TribbleRMDTrackBuilder.java index 56cd44aa0..e0fc5dd52 100644 --- a/java/src/org/broadinstitute/sting/gatk/refdata/tracks/builders/TribbleRMDTrackBuilder.java +++ b/java/src/org/broadinstitute/sting/gatk/refdata/tracks/builders/TribbleRMDTrackBuilder.java @@ -36,7 +36,7 @@ import org.broad.tribble.util.LittleEndianOutputStream; import org.broadinstitute.sting.gatk.refdata.tracks.TribbleTrack; import org.broadinstitute.sting.gatk.refdata.tracks.RMDTrack; import org.broadinstitute.sting.gatk.refdata.tracks.RMDTrackCreationException; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import org.broadinstitute.sting.utils.collections.Pair; import org.broadinstitute.sting.utils.classloader.PluginManager; import org.broadinstitute.sting.utils.exceptions.UserException; @@ -227,7 +227,7 @@ public class TribbleRMDTrackBuilder extends PluginManager implemen locked = lock.sharedLock(); } catch(FileSystemInabilityToLockException ex) { - throw new GATKException("Unexpected inability to lock exception", ex); + throw new ReviewedStingException("Unexpected inability to lock exception", ex); } Index idx; try { @@ -294,7 +294,7 @@ public class TribbleRMDTrackBuilder extends PluginManager implemen return index; } catch(FileSystemInabilityToLockException ex) { - throw new GATKException("Unexpected inability to lock exception", ex); + throw new ReviewedStingException("Unexpected inability to lock exception", ex); } finally { if (locked) lock.unlock(); diff --git a/java/src/org/broadinstitute/sting/gatk/walkers/analyzeannotations/AnnotationDatum.java b/java/src/org/broadinstitute/sting/gatk/walkers/analyzeannotations/AnnotationDatum.java index 2995723e1..888eb7e6e 100755 --- a/java/src/org/broadinstitute/sting/gatk/walkers/analyzeannotations/AnnotationDatum.java +++ b/java/src/org/broadinstitute/sting/gatk/walkers/analyzeannotations/AnnotationDatum.java @@ -1,6 +1,6 @@ package org.broadinstitute.sting.gatk.walkers.analyzeannotations; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import java.util.Comparator; @@ -114,7 +114,7 @@ public class AnnotationDatum implements Comparator { final public float calcTiTv( final int INDEX ) { if( ti[INDEX] < 0 || tv[INDEX] < 0 ) { - throw new GATKException( "Integer overflow detected! There are too many variants piled up in one annotation bin." ); + throw new ReviewedStingException( "Integer overflow detected! There are too many variants piled up in one annotation bin." ); } if( tv[INDEX] == 0 ) { // Don't divide by zero diff --git a/java/src/org/broadinstitute/sting/gatk/walkers/annotator/HaplotypeScore.java b/java/src/org/broadinstitute/sting/gatk/walkers/annotator/HaplotypeScore.java index bd5406137..bfa1c4db5 100644 --- a/java/src/org/broadinstitute/sting/gatk/walkers/annotator/HaplotypeScore.java +++ b/java/src/org/broadinstitute/sting/gatk/walkers/annotator/HaplotypeScore.java @@ -33,7 +33,7 @@ import org.broadinstitute.sting.gatk.contexts.AlignmentContext; import org.broadinstitute.sting.gatk.refdata.RefMetaDataTracker; import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.*; import org.broadinstitute.sting.utils.*; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import org.broadinstitute.sting.utils.genotype.Haplotype; import org.broadinstitute.sting.utils.pileup.*; @@ -197,7 +197,7 @@ public class HaplotypeScore implements InfoFieldAnnotation, StandardAnnotation { String b = haplotypeB.toString(); if (a.length() != b.length()) - throw new GATKException("Haplotypes a and b must be of same length"); + throw new ReviewedStingException("Haplotypes a and b must be of same length"); char chA, chB; char wc = REGEXP_WILDCARD.charAt(0); diff --git a/java/src/org/broadinstitute/sting/gatk/walkers/annotator/VariantAnnotatorEngine.java b/java/src/org/broadinstitute/sting/gatk/walkers/annotator/VariantAnnotatorEngine.java index 3e49fac4a..1b7527416 100755 --- a/java/src/org/broadinstitute/sting/gatk/walkers/annotator/VariantAnnotatorEngine.java +++ b/java/src/org/broadinstitute/sting/gatk/walkers/annotator/VariantAnnotatorEngine.java @@ -49,7 +49,7 @@ import org.broadinstitute.sting.gatk.refdata.RefMetaDataTracker; import org.broadinstitute.sting.gatk.refdata.utils.helpers.DbSNPHelper; import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.*; import org.broadinstitute.sting.gatk.walkers.annotator.genomicannotator.*; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import org.broadinstitute.sting.utils.classloader.PackageUtils; import org.broadinstitute.sting.utils.exceptions.UserException; @@ -168,7 +168,7 @@ public class VariantAnnotatorEngine { Collection results = this.annotateContext(tracker, ref, EMPTY_STRATIFIED_ALIGNMENT_CONTEXT, vc); if ( results.size() != 1 ) - throw new GATKException("BUG: annotateContext call requires 1 resulting annotated VC, but got " + results); + throw new ReviewedStingException("BUG: annotateContext call requires 1 resulting annotated VC, but got " + results); return results.iterator().next(); diff --git a/java/src/org/broadinstitute/sting/gatk/walkers/annotator/genomicannotator/JoinTable.java b/java/src/org/broadinstitute/sting/gatk/walkers/annotator/genomicannotator/JoinTable.java index fa67bf888..1b2c85b3e 100755 --- a/java/src/org/broadinstitute/sting/gatk/walkers/annotator/genomicannotator/JoinTable.java +++ b/java/src/org/broadinstitute/sting/gatk/walkers/annotator/genomicannotator/JoinTable.java @@ -33,7 +33,7 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.List; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import org.broadinstitute.sting.utils.exceptions.UserException; /** @@ -83,7 +83,7 @@ public class JoinTable */ public void parseFromFile(String filename, String localBindingName, String localColumnName, String externalBindingName, String externalColumnName) { if(parsedFromFile) { - throw new GATKException("parseFromFile(" + filename +", ..) called more than once"); + throw new ReviewedStingException("parseFromFile(" + filename +", ..) called more than once"); } parsedFromFile = true; @@ -135,7 +135,7 @@ public class JoinTable br.close(); } } catch(IOException e) { - throw new GATKException("Unable to close file: " + filename, e); + throw new ReviewedStingException("Unable to close file: " + filename, e); } } } diff --git a/java/src/org/broadinstitute/sting/gatk/walkers/annotator/genomicannotator/JoinTableParser.java b/java/src/org/broadinstitute/sting/gatk/walkers/annotator/genomicannotator/JoinTableParser.java index c93c988a7..d3fcfd42a 100755 --- a/java/src/org/broadinstitute/sting/gatk/walkers/annotator/genomicannotator/JoinTableParser.java +++ b/java/src/org/broadinstitute/sting/gatk/walkers/annotator/genomicannotator/JoinTableParser.java @@ -31,7 +31,7 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import org.broadinstitute.sting.utils.Utils; import org.broadinstitute.sting.utils.exceptions.UserException; @@ -63,7 +63,7 @@ public class JoinTableParser public List readHeader(BufferedReader br) throws IOException { if(header != null) { - throw new GATKException("readHeader(..) called more than once. Header is currently set to: " + header); + throw new ReviewedStingException("readHeader(..) called more than once. Header is currently set to: " + header); } header = Collections.unmodifiableList(parseHeader(br)); diff --git a/java/src/org/broadinstitute/sting/gatk/walkers/annotator/genomicannotator/TranscriptToGenomicInfo.java b/java/src/org/broadinstitute/sting/gatk/walkers/annotator/genomicannotator/TranscriptToGenomicInfo.java index caf5f93ec..b0588b9e4 100755 --- a/java/src/org/broadinstitute/sting/gatk/walkers/annotator/genomicannotator/TranscriptToGenomicInfo.java +++ b/java/src/org/broadinstitute/sting/gatk/walkers/annotator/genomicannotator/TranscriptToGenomicInfo.java @@ -44,7 +44,7 @@ import org.broadinstitute.sting.gatk.walkers.Requires; import org.broadinstitute.sting.gatk.walkers.RodWalker; import org.broadinstitute.sting.gatk.walkers.Window; import org.broadinstitute.sting.utils.BaseUtils; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import org.broadinstitute.sting.utils.exceptions.UserException; /** @@ -973,7 +973,7 @@ public class TranscriptToGenomicInfo extends RodWalker { */ public int computeInitialCodingCoord() { if(!isProteinCodingTranscript()) { - throw new GATKException("This method should only be called for protein-coding transcripts"); + throw new ReviewedStingException("This method should only be called for protein-coding transcripts"); } if(positiveStrand) diff --git a/java/src/org/broadinstitute/sting/gatk/walkers/coverage/CoverageUtils.java b/java/src/org/broadinstitute/sting/gatk/walkers/coverage/CoverageUtils.java index 7eec418f9..a58d71129 100644 --- a/java/src/org/broadinstitute/sting/gatk/walkers/coverage/CoverageUtils.java +++ b/java/src/org/broadinstitute/sting/gatk/walkers/coverage/CoverageUtils.java @@ -4,7 +4,7 @@ import net.sf.samtools.SAMReadGroupRecord; import net.sf.samtools.SAMRecord; import org.broadinstitute.sting.gatk.contexts.AlignmentContext; import org.broadinstitute.sting.utils.BaseUtils; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import org.broadinstitute.sting.utils.exceptions.UserException; import org.broadinstitute.sting.utils.pileup.PileupElement; @@ -57,7 +57,7 @@ public class CoverageUtils { } else if ( type == DoCOutputType.Partition.sample_by_platform_by_center ) { return String.format("%s_pl_%s_cn_%s",r.getSample(),r.getPlatform(),r.getSequencingCenter()); } else { - throw new GATKException("Invalid type ID sent to getTypeID. This is a BUG!"); + throw new ReviewedStingException("Invalid type ID sent to getTypeID. This is a BUG!"); } } @@ -119,7 +119,7 @@ public class CoverageUtils { try { counts[BaseUtils.simpleBaseToBaseIndex(e.getBase())]++; } catch (ArrayIndexOutOfBoundsException exc) { - throw new GATKException("Expected a simple base, but actually received"+(char)e.getBase()); + throw new ReviewedStingException("Expected a simple base, but actually received"+(char)e.getBase()); } } } diff --git a/java/src/org/broadinstitute/sting/gatk/walkers/coverage/DepthOfCoverageWalker.java b/java/src/org/broadinstitute/sting/gatk/walkers/coverage/DepthOfCoverageWalker.java index 27a95f514..e93b579a6 100644 --- a/java/src/org/broadinstitute/sting/gatk/walkers/coverage/DepthOfCoverageWalker.java +++ b/java/src/org/broadinstitute/sting/gatk/walkers/coverage/DepthOfCoverageWalker.java @@ -40,7 +40,7 @@ import org.broadinstitute.sting.utils.*; import org.broadinstitute.sting.utils.collections.Pair; import org.broadinstitute.sting.commandline.Argument; import org.broadinstitute.sting.commandline.Output; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import org.broadinstitute.sting.utils.exceptions.UserException; import java.io.File; @@ -226,7 +226,7 @@ public class DepthOfCoverageWalker extends LocusWalker maxWindowElements() || elementsToRight > maxWindowElements() ) - throw new GATKException("Too large a window requested"); + throw new ReviewedStingException("Too large a window requested"); if ( elementsToLeft < 0 || elementsToRight < 0 ) - throw new GATKException("Window size cannot be negative"); + throw new ReviewedStingException("Window size cannot be negative"); FiltrationContext[] array = new FiltrationContext[elementsToLeft + elementsToRight + 1]; ListIterator iter = window.listIterator(currentContext - elementsToLeft); diff --git a/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/DiploidGenotypeCalculationModel.java b/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/DiploidGenotypeCalculationModel.java index 547ddde15..46a935f78 100755 --- a/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/DiploidGenotypeCalculationModel.java +++ b/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/DiploidGenotypeCalculationModel.java @@ -30,7 +30,7 @@ import org.broad.tribble.util.variantcontext.Genotype; import org.broad.tribble.vcf.VCFConstants; import org.broadinstitute.sting.utils.*; import org.broadinstitute.sting.utils.collections.Pair; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import org.broadinstitute.sting.utils.genotype.DiploidGenotype; import org.broadinstitute.sting.utils.pileup.ReadBackedPileup; import org.broadinstitute.sting.gatk.contexts.StratifiedAlignmentContext; @@ -192,7 +192,7 @@ public class DiploidGenotypeCalculationModel extends JointEstimateGenotypeCalcul public void incrementFrequency() { if ( frequency == 2 * N ) - throw new GATKException("Frequency was incremented past N; how is this possible?"); + throw new ReviewedStingException("Frequency was incremented past N; how is this possible?"); frequency++; double greedy = VALUE_NOT_CALCULATED; @@ -219,7 +219,7 @@ public class DiploidGenotypeCalculationModel extends JointEstimateGenotypeCalcul // so we can ignore that case } if ( greedyIndex == -1 ) - throw new GATKException("There is no best choice for a new alternate allele; how is this possible?"); + throw new ReviewedStingException("There is no best choice for a new alternate allele; how is this possible?"); if ( indexes[greedyIndex] == GenotypeType.HET.ordinal() ) indexes[greedyIndex] = GenotypeType.HOM.ordinal(); diff --git a/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/SimpleIndelCalculationModel.java b/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/SimpleIndelCalculationModel.java index e3afe847b..25ba13061 100755 --- a/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/SimpleIndelCalculationModel.java +++ b/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/SimpleIndelCalculationModel.java @@ -5,7 +5,7 @@ import org.broad.tribble.util.variantcontext.Genotype; import org.broad.tribble.util.variantcontext.VariantContext; import org.broadinstitute.sting.utils.*; import org.broadinstitute.sting.utils.collections.Pair; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import org.broadinstitute.sting.utils.pileup.*; import org.broadinstitute.sting.gatk.refdata.RefMetaDataTracker; import org.broadinstitute.sting.gatk.contexts.*; @@ -72,7 +72,7 @@ public class SimpleIndelCalculationModel extends GenotypeCalculationModel { alleles.add( Allele.create(bestEvent.substring(1), true )); loc = GenomeLocParser.setStop(loc, loc.getStop() + bestEvent.length()-1); } else - throw new GATKException("Internal error (probably a bug): event does not conform to expected format: "+ bestEvent); + throw new ReviewedStingException("Internal error (probably a bug): event does not conform to expected format: "+ bestEvent); } VariantContext vc = new VariantContext("UG_Indel_call", loc.getContig(), loc.getStart(), loc.getStop(), alleles, new HashMap() /* genotypes */, diff --git a/java/src/org/broadinstitute/sting/gatk/walkers/indels/IndelRealigner.java b/java/src/org/broadinstitute/sting/gatk/walkers/indels/IndelRealigner.java index 74f025908..d785bf595 100755 --- a/java/src/org/broadinstitute/sting/gatk/walkers/indels/IndelRealigner.java +++ b/java/src/org/broadinstitute/sting/gatk/walkers/indels/IndelRealigner.java @@ -31,7 +31,7 @@ import net.sf.samtools.util.SequenceUtil; import net.sf.picard.reference.IndexedFastaSequenceFile; import org.broad.tribble.util.variantcontext.VariantContext; import org.broadinstitute.sting.commandline.*; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import org.broadinstitute.sting.utils.exceptions.UserException; import org.broadinstitute.sting.utils.interval.IntervalMergingRule; import org.broadinstitute.sting.utils.interval.IntervalUtils; @@ -334,7 +334,7 @@ public class IndelRealigner extends ReadWalker { do { currentInterval = intervals.hasNext() ? intervals.next() : null; } while ( currentInterval != null && (readLoc == null || currentInterval.isBefore(readLoc)) ); - } catch (GATKException e) { + } catch (ReviewedStingException e) { throw new UserException.MissortedFile(new File(intervalsFile), " *** Are you sure that your interval file is sorted? If not, you must use the --targetIntervalsAreNotSorted argument. ***", e); } diff --git a/java/src/org/broadinstitute/sting/gatk/walkers/qc/CycleQualityWalker.java b/java/src/org/broadinstitute/sting/gatk/walkers/qc/CycleQualityWalker.java index e0b627d3d..7451565c8 100644 --- a/java/src/org/broadinstitute/sting/gatk/walkers/qc/CycleQualityWalker.java +++ b/java/src/org/broadinstitute/sting/gatk/walkers/qc/CycleQualityWalker.java @@ -30,7 +30,7 @@ import org.broadinstitute.sting.gatk.walkers.DataSource; import org.broadinstitute.sting.gatk.walkers.ReadWalker; import org.broadinstitute.sting.gatk.refdata.ReadMetaDataTracker; import org.broadinstitute.sting.gatk.contexts.ReferenceContext; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import org.broadinstitute.sting.utils.collections.PrimitivePair; import org.broadinstitute.sting.utils.exceptions.UserException; import org.broadinstitute.sting.utils.sam.AlignmentUtils; @@ -81,7 +81,7 @@ public class CycleQualityWalker extends ReadWalker { private Map cyclesByLibraryMapOrig = null; public void initialize() { - if ( PREFIX == null ) throw new GATKException("Prefix for output file(s) must be specified"); + if ( PREFIX == null ) throw new ReviewedStingException("Prefix for output file(s) must be specified"); cyclesByLaneMap = new HashMap(); cyclesByLibraryMap = new HashMap(); cyclesByLaneMapOrig = new HashMap(); diff --git a/java/src/org/broadinstitute/sting/gatk/walkers/qc/ReadValidationWalker.java b/java/src/org/broadinstitute/sting/gatk/walkers/qc/ReadValidationWalker.java index ec3a9b677..6ad0340a4 100644 --- a/java/src/org/broadinstitute/sting/gatk/walkers/qc/ReadValidationWalker.java +++ b/java/src/org/broadinstitute/sting/gatk/walkers/qc/ReadValidationWalker.java @@ -3,7 +3,7 @@ package org.broadinstitute.sting.gatk.walkers.qc; import org.broadinstitute.sting.gatk.refdata.ReadMetaDataTracker; import org.broadinstitute.sting.gatk.walkers.ReadWalker; import org.broadinstitute.sting.gatk.contexts.ReferenceContext; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import net.sf.samtools.SAMRecord; import net.sf.samtools.SAMFileWriter; @@ -58,7 +58,7 @@ public class ReadValidationWalker extends ReadWalker { try { m = MessageDigest.getInstance("MD5"); } catch (NoSuchAlgorithmException e) { - throw new GATKException("Unable to get the MD5 algorithm. Get a more eXtreme version of JAVA!@!@!!"); + throw new ReviewedStingException("Unable to get the MD5 algorithm. Get a more eXtreme version of JAVA!@!@!!"); } } diff --git a/java/src/org/broadinstitute/sting/gatk/walkers/qc/ValidatingPileupWalker.java b/java/src/org/broadinstitute/sting/gatk/walkers/qc/ValidatingPileupWalker.java index d06b2035d..72ba37830 100755 --- a/java/src/org/broadinstitute/sting/gatk/walkers/qc/ValidatingPileupWalker.java +++ b/java/src/org/broadinstitute/sting/gatk/walkers/qc/ValidatingPileupWalker.java @@ -33,7 +33,7 @@ import org.broadinstitute.sting.gatk.walkers.*; import org.broadinstitute.sting.utils.*; import org.broadinstitute.sting.commandline.Argument; import org.broadinstitute.sting.commandline.Output; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import org.broadinstitute.sting.utils.exceptions.UserException; import org.broadinstitute.sting.utils.pileup.ReadBackedPileup; @@ -140,7 +140,7 @@ public class ValidatingPileupWalker extends LocusWalker { if ( interesting != null ) interestingReasons.add(interesting); break; default: - throw new GATKException("BUG: Unexpected evaluation order " + evaluation); + throw new ReviewedStingException("BUG: Unexpected evaluation order " + evaluation); } } } @@ -708,7 +708,7 @@ public class VariantEvalWalker extends RodWalker { for ( EvaluationContext group : contexts ) { String[] parts = group.getDisplayName().split(CONTEXT_SEPARATOR); if ( parts.length != N_CONTEXT_NAME_PARTS ) { - throw new GATKException("Unexpected number of eval name parts " + group.getDisplayName() + " length = " + parts.length + ", expected " + N_CONTEXT_NAME_PARTS); + throw new ReviewedStingException("Unexpected number of eval name parts " + group.getDisplayName() + " length = " + parts.length + ", expected " + N_CONTEXT_NAME_PARTS); } else { for ( int i = 0; i < parts.length; i++ ) nameSizes[i] = Math.max(nameSizes[i], parts[i].length()); diff --git a/java/src/org/broadinstitute/sting/gatk/walkers/variantrecalibration/VariantGaussianMixtureModel.java b/java/src/org/broadinstitute/sting/gatk/walkers/variantrecalibration/VariantGaussianMixtureModel.java index a7cce23ad..1a7152b49 100755 --- a/java/src/org/broadinstitute/sting/gatk/walkers/variantrecalibration/VariantGaussianMixtureModel.java +++ b/java/src/org/broadinstitute/sting/gatk/walkers/variantrecalibration/VariantGaussianMixtureModel.java @@ -28,7 +28,7 @@ package org.broadinstitute.sting.gatk.walkers.variantrecalibration; import org.apache.log4j.Logger; import org.broad.tribble.util.variantcontext.VariantContext; import org.broadinstitute.sting.gatk.contexts.variantcontext.VariantContextUtils; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import org.broadinstitute.sting.utils.MathUtils; import org.broadinstitute.sting.utils.collections.ExpandingArrayList; import org.broadinstitute.sting.utils.exceptions.UserException; @@ -699,7 +699,7 @@ public final class VariantGaussianMixtureModel extends VariantOptimizationModel logger.warn("About to throw exception due to numerical instability. Try running with fewer annotations and then with fewer Gaussians. " + "It is best to only use the annotations which appear to be Gaussianly distributed for this Gaussian mixture model."); - throw new GATKException("Numerical Instability! Found NaN after performing log10: " + pVarInClusterLog10[kkk] + ", cluster = " + kkk + ", variant index = " + iii); + throw new ReviewedStingException("Numerical Instability! Found NaN after performing log10: " + pVarInClusterLog10[kkk] + ", cluster = " + kkk + ", variant index = " + iii); } } @@ -709,7 +709,7 @@ public final class VariantGaussianMixtureModel extends VariantOptimizationModel if( Double.isNaN(pVarInCluster[kkk][iii]) ) { logger.warn("About to throw exception due to numerical instability. Try running with fewer annotations and then with fewer Gaussians. " + "It is best to only use the annotations which appear to be Gaussianly distributed for this Gaussian mixture model."); - throw new GATKException("Numerical Instability! Found NaN after rescaling log10 values: " + pVarInCluster[kkk][iii] + ", cluster = " + kkk + ", variant index = " + iii); + throw new ReviewedStingException("Numerical Instability! Found NaN after rescaling log10 values: " + pVarInCluster[kkk][iii] + ", cluster = " + kkk + ", variant index = " + iii); } } } @@ -775,7 +775,7 @@ public final class VariantGaussianMixtureModel extends VariantOptimizationModel if( Double.isNaN(prob) ) { logger.warn("About to throw exception due to numerical instability. Try running with fewer annotations and then with fewer Gaussians. " + "It is best to only use the annotations which appear to be Gaussianly distributed for this Gaussian mixture model."); - throw new GATKException("Numerical Instability! Found NaN in M-step: " + pVarInCluster[kkk][iii] + ", cluster = " + kkk + ", variant index = " + iii); + throw new ReviewedStingException("Numerical Instability! Found NaN in M-step: " + pVarInCluster[kkk][iii] + ", cluster = " + kkk + ", variant index = " + iii); } sumProb += prob; for( int jjj = 0; jjj < numAnnotations; jjj++ ) { diff --git a/java/src/org/broadinstitute/sting/oneoffprojects/walkers/BeagleOutputByDepthWalker.java b/java/src/org/broadinstitute/sting/oneoffprojects/walkers/BeagleOutputByDepthWalker.java index 762b64e87..a263008fc 100755 --- a/java/src/org/broadinstitute/sting/oneoffprojects/walkers/BeagleOutputByDepthWalker.java +++ b/java/src/org/broadinstitute/sting/oneoffprojects/walkers/BeagleOutputByDepthWalker.java @@ -35,7 +35,7 @@ import org.broadinstitute.sting.gatk.contexts.AlignmentContext; import org.broadinstitute.sting.gatk.contexts.ReferenceContext; import org.broadinstitute.sting.gatk.refdata.RefMetaDataTracker; import org.broadinstitute.sting.gatk.walkers.RodWalker; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import org.broadinstitute.sting.utils.GenomeLoc; import java.io.PrintStream; @@ -156,7 +156,7 @@ public class BeagleOutputByDepthWalker extends RodWalker { else if (compGenotype.isHomVar()) hg = 2; else - throw new GATKException("Bug! invalid genotype!"); + throw new ReviewedStingException("Bug! invalid genotype!"); if (postbglGenotype.isNoCall()) bg = -1; @@ -167,7 +167,7 @@ public class BeagleOutputByDepthWalker extends RodWalker { else if (postbglGenotype.isHomVar()) bg = 2; else - throw new GATKException("Bug! invalid genotype!"); + throw new ReviewedStingException("Bug! invalid genotype!"); if (prebglGenotype.isNoCall()) @@ -179,7 +179,7 @@ public class BeagleOutputByDepthWalker extends RodWalker { else if (prebglGenotype.isHomVar()) pg = 2; else - throw new GATKException("Bug! invalid genotype!"); + throw new ReviewedStingException("Bug! invalid genotype!"); outputWriter.format("%d %d %d %d\n",dp, hg, pg, bg); diff --git a/java/src/org/broadinstitute/sting/oneoffprojects/walkers/DesignFileGeneratorWalker.java b/java/src/org/broadinstitute/sting/oneoffprojects/walkers/DesignFileGeneratorWalker.java index ce24c5fc5..2c907ebd1 100644 --- a/java/src/org/broadinstitute/sting/oneoffprojects/walkers/DesignFileGeneratorWalker.java +++ b/java/src/org/broadinstitute/sting/oneoffprojects/walkers/DesignFileGeneratorWalker.java @@ -7,7 +7,7 @@ import org.broadinstitute.sting.gatk.refdata.*; import org.broadinstitute.sting.gatk.refdata.features.refseq.RefSeqFeature; import org.broadinstitute.sting.gatk.refdata.utils.GATKFeature; import org.broadinstitute.sting.gatk.walkers.RodWalker; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import org.broadinstitute.sting.utils.GenomeLoc; import org.broadinstitute.sting.utils.GenomeLocParser; import org.broadinstitute.sting.commandline.Output; @@ -196,7 +196,7 @@ class IntervalInfoBuilder { } } } else { - throw new GATKException("Attempting to update an IntervalInfoBuilder twice with the same (non-TCGA) gene: "+gene); + throw new ReviewedStingException("Attempting to update an IntervalInfoBuilder twice with the same (non-TCGA) gene: "+gene); } } else { diff --git a/java/src/org/broadinstitute/sting/oneoffprojects/walkers/DownsamplingValidationWalker.java b/java/src/org/broadinstitute/sting/oneoffprojects/walkers/DownsamplingValidationWalker.java index bf5d96984..f50e33550 100644 --- a/java/src/org/broadinstitute/sting/oneoffprojects/walkers/DownsamplingValidationWalker.java +++ b/java/src/org/broadinstitute/sting/oneoffprojects/walkers/DownsamplingValidationWalker.java @@ -29,7 +29,7 @@ import org.broadinstitute.sting.gatk.refdata.features.samread.SAMReadFeature; import org.broadinstitute.sting.gatk.contexts.ReferenceContext; import org.broadinstitute.sting.gatk.contexts.AlignmentContext; import org.broadinstitute.sting.gatk.walkers.LocusWalker; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import org.broadinstitute.sting.utils.pileup.ReadBackedPileup; import org.broadinstitute.sting.commandline.Argument; @@ -71,7 +71,7 @@ public class DownsamplingValidationWalker extends LocusWalker { int matchingReadsFound = 0; if(unsampledReadsStartingAtThisLocus.isEmpty()) { if(!sampledReadsStartingAtThisLocus.isEmpty()) - throw new GATKException("Downsampler hallucinated a read starting at locus "+ref.getLocus()); + throw new ReviewedStingException("Downsampler hallucinated a read starting at locus "+ref.getLocus()); } else { boolean foundMatch = false; @@ -86,10 +86,10 @@ public class DownsamplingValidationWalker extends LocusWalker { } if(!foundMatch) - throw new GATKException("Downsampler failed to include any read starting at locus "+ref.getLocus()); + throw new ReviewedStingException("Downsampler failed to include any read starting at locus "+ref.getLocus()); if(matchingReadsFound > maxExpectedNumberOfReads) - throw new GATKException("Downsampler found too many reads starting at locus "+ref.getLocus()); + throw new ReviewedStingException("Downsampler found too many reads starting at locus "+ref.getLocus()); } return matchingReadsFound; diff --git a/java/src/org/broadinstitute/sting/oneoffprojects/walkers/MendelianViolationClassifier.java b/java/src/org/broadinstitute/sting/oneoffprojects/walkers/MendelianViolationClassifier.java index 797a146c2..5401fa360 100644 --- a/java/src/org/broadinstitute/sting/oneoffprojects/walkers/MendelianViolationClassifier.java +++ b/java/src/org/broadinstitute/sting/oneoffprojects/walkers/MendelianViolationClassifier.java @@ -21,7 +21,7 @@ import org.broadinstitute.sting.gatk.walkers.genotyper.VariantCallContext; import org.broadinstitute.sting.gatk.walkers.varianteval.MendelianViolationEvaluator; import org.broadinstitute.sting.utils.*; import org.broadinstitute.sting.utils.collections.Pair; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import org.broadinstitute.sting.utils.vcf.VCFUtils; import org.broadinstitute.sting.utils.pileup.PileupElement; @@ -420,7 +420,7 @@ public class MendelianViolationClassifier extends LocusWalker splitContext = StratifiedAlignmentContext.splitContextBySample(context.getBasePileup()); diff --git a/java/src/org/broadinstitute/sting/oneoffprojects/walkers/QualityScoreByStrandWalker.java b/java/src/org/broadinstitute/sting/oneoffprojects/walkers/QualityScoreByStrandWalker.java index 2ead0e1e0..7d0439eaf 100644 --- a/java/src/org/broadinstitute/sting/oneoffprojects/walkers/QualityScoreByStrandWalker.java +++ b/java/src/org/broadinstitute/sting/oneoffprojects/walkers/QualityScoreByStrandWalker.java @@ -28,7 +28,7 @@ package org.broadinstitute.sting.oneoffprojects.walkers; import java.io.File; import java.io.IOException; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import org.broadinstitute.sting.utils.QualityUtils; import org.broadinstitute.sting.utils.exceptions.UserException; import org.broadinstitute.sting.utils.pileup.ReadBackedPileup; @@ -210,7 +210,7 @@ class StrandedCounts { public void updateReadPair( int fQual, int rQual, int fOff, int rOff ) { // hehe f Off if ( rOff < 0 || fOff < 0 ) - throw new GATKException("Offset is negative. Should never happen."); + throw new ReviewedStingException("Offset is negative. Should never happen."); forwardCountsByOffset[fOff][fQual < 0 ? 0 : fQual > 40 ? 40 : fQual]++; reverseCountsByOffset[rOff][rQual < 0 ? 0 : rQual > 40 ? 40 : rQual]++; } diff --git a/java/src/org/broadinstitute/sting/oneoffprojects/walkers/TestReadFishingWalker.java b/java/src/org/broadinstitute/sting/oneoffprojects/walkers/TestReadFishingWalker.java index 6c7ab7d59..2a10f1ad5 100644 --- a/java/src/org/broadinstitute/sting/oneoffprojects/walkers/TestReadFishingWalker.java +++ b/java/src/org/broadinstitute/sting/oneoffprojects/walkers/TestReadFishingWalker.java @@ -34,7 +34,7 @@ import org.broadinstitute.sting.alignment.bwa.c.BWACAligner; import org.broadinstitute.sting.alignment.Alignment; import org.broadinstitute.sting.commandline.Argument; import org.broadinstitute.sting.commandline.Output; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import org.broadinstitute.sting.utils.GenomeLoc; import org.broadinstitute.sting.utils.GenomeLocParser; import net.sf.samtools.SAMRecord; @@ -128,7 +128,7 @@ public class TestReadFishingWalker extends ReadWalker { System.arraycopy(referenceSequence.getBases(),eventStart,revisedReference,eventStart+eventLength,bufferWidth); } else - throw new GATKException("Invalid indel type: " + type); + throw new ReviewedStingException("Invalid indel type: " + type); aligners.put(GenomeLocParser.createGenomeLoc(contig,start,stop),new BWACAligner(revisedReference,new BWAConfiguration())); if(++numAlignersCreated % 100 == 0) diff --git a/java/src/org/broadinstitute/sting/oneoffprojects/walkers/VCF4WriterTestWalker.java b/java/src/org/broadinstitute/sting/oneoffprojects/walkers/VCF4WriterTestWalker.java index 34ab9fc64..d17bffcfc 100755 --- a/java/src/org/broadinstitute/sting/oneoffprojects/walkers/VCF4WriterTestWalker.java +++ b/java/src/org/broadinstitute/sting/oneoffprojects/walkers/VCF4WriterTestWalker.java @@ -11,7 +11,7 @@ import org.broadinstitute.sting.gatk.datasources.simpleDataSources.ReferenceOrde import org.broadinstitute.sting.gatk.refdata.RefMetaDataTracker; import org.broadinstitute.sting.gatk.refdata.tracks.RMDTrack; import org.broadinstitute.sting.gatk.walkers.RodWalker; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import org.broadinstitute.sting.utils.GenomeLoc; import org.broadinstitute.sting.utils.vcf.VCFUtils; @@ -95,7 +95,7 @@ public class VCF4WriterTestWalker extends RodWalker { out.printf("Read %d header lines%n", header.getMetaData().size()); } catch (FileNotFoundException e ) { - throw new GATKException(e.getMessage()); + throw new ReviewedStingException(e.getMessage()); } final Set vcfSamples = header.getGenotypeSamples(); diff --git a/java/src/org/broadinstitute/sting/playground/analyzeconcordance/AnalyzeConcordance.java b/java/src/org/broadinstitute/sting/playground/analyzeconcordance/AnalyzeConcordance.java index e1c977501..ddac5f58f 100644 --- a/java/src/org/broadinstitute/sting/playground/analyzeconcordance/AnalyzeConcordance.java +++ b/java/src/org/broadinstitute/sting/playground/analyzeconcordance/AnalyzeConcordance.java @@ -27,7 +27,7 @@ package org.broadinstitute.sting.playground.analyzeconcordance; import org.broadinstitute.sting.commandline.CommandLineProgram; import org.broadinstitute.sting.commandline.Argument; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import org.broadinstitute.sting.utils.text.XReadLines; import org.broadinstitute.sting.utils.Utils; import org.broadinstitute.sting.utils.PathUtils; @@ -92,7 +92,7 @@ public class AnalyzeConcordance extends CommandLineProgram { generateHtmlReport(); logger.info("...Done!"); } catch (Exception e) { - throw new GATKException("Error analyzing concordance", e); + throw new ReviewedStingException("Error analyzing concordance", e); } return result; @@ -102,7 +102,7 @@ public class AnalyzeConcordance extends CommandLineProgram { // create the output directory where all the data tables and plots will go File outputDir = new File(this.outputDir); if (!outputDir.exists() && !outputDir.mkdirs()) { - throw new GATKException("Couldn't create directory: " + this.outputDir); + throw new ReviewedStingException("Couldn't create directory: " + this.outputDir); } } diff --git a/java/src/org/broadinstitute/sting/playground/examples/SampleXmlMarshaller.java b/java/src/org/broadinstitute/sting/playground/examples/SampleXmlMarshaller.java index 8468d87f5..c5f4c7efb 100755 --- a/java/src/org/broadinstitute/sting/playground/examples/SampleXmlMarshaller.java +++ b/java/src/org/broadinstitute/sting/playground/examples/SampleXmlMarshaller.java @@ -1,7 +1,7 @@ package org.broadinstitute.sting.playground.examples; import org.apache.log4j.BasicConfigurator; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import org.simpleframework.xml.Element; import org.simpleframework.xml.Root; import org.simpleframework.xml.Serializer; @@ -121,7 +121,7 @@ public class SampleXmlMarshaller { SampleXmlMarshaller example = serializer.read(SampleXmlMarshaller.class, source); return example; } catch (Exception e) { - throw new GATKException("Failed to marshal the data to file " + filename,e); + throw new ReviewedStingException("Failed to marshal the data to file " + filename,e); } } } diff --git a/java/src/org/broadinstitute/sting/playground/gatk/walkers/LocusMismatchWalker.java b/java/src/org/broadinstitute/sting/playground/gatk/walkers/LocusMismatchWalker.java index 2aeff6db0..74329fd90 100755 --- a/java/src/org/broadinstitute/sting/playground/gatk/walkers/LocusMismatchWalker.java +++ b/java/src/org/broadinstitute/sting/playground/gatk/walkers/LocusMismatchWalker.java @@ -39,7 +39,7 @@ import org.broadinstitute.sting.gatk.walkers.genotyper.UnifiedArgumentCollection import org.broadinstitute.sting.gatk.walkers.genotyper.UnifiedGenotyperEngine; import org.broadinstitute.sting.gatk.walkers.genotyper.VariantCallContext; import org.broadinstitute.sting.utils.BaseUtils; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import org.broadinstitute.sting.commandline.Argument; import org.broadinstitute.sting.commandline.Output; import org.broadinstitute.sting.utils.pileup.PileupElement; @@ -155,7 +155,7 @@ public class LocusMismatchWalker extends LocusWalker implements if ( g.isHomRef() ) return "HOM-REF"; else if ( g.isHet() ) return "HET"; else if ( g.isHom() ) return "HOM-NONREF"; - else throw new GATKException("Unexpected genotype in getGenotypeClass " + g); + else throw new ReviewedStingException("Unexpected genotype in getGenotypeClass " + g); } public boolean useRead( PileupElement e ) { diff --git a/java/src/org/broadinstitute/sting/playground/gatk/walkers/ReadBackedPhasingWalker.java b/java/src/org/broadinstitute/sting/playground/gatk/walkers/ReadBackedPhasingWalker.java index 433f0aecf..c331596f7 100755 --- a/java/src/org/broadinstitute/sting/playground/gatk/walkers/ReadBackedPhasingWalker.java +++ b/java/src/org/broadinstitute/sting/playground/gatk/walkers/ReadBackedPhasingWalker.java @@ -38,7 +38,7 @@ import org.broadinstitute.sting.gatk.walkers.*; import org.broadinstitute.sting.commandline.Argument; import org.broadinstitute.sting.commandline.Output; import org.broadinstitute.sting.utils.*; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import org.broadinstitute.sting.utils.vcf.VCFUtils; import org.broadinstitute.sting.utils.pileup.PileupElement; import org.broadinstitute.sting.utils.pileup.ReadBackedPileup; @@ -301,7 +301,7 @@ public class ReadBackedPhasingWalker extends RodWalker maxPhaseSites) { logger.warn("Trying to phase sample " + samp + " at locus " + VariantContextUtils.getLocation(vc) + " within a window of " + cacheWindow + " bases yields " + sampleWindowVaList.size() + " heterozygous sites to phase:\n" + toStringVRL(sampleWindowVaList)); @@ -433,7 +433,7 @@ public class ReadBackedPhasingWalker extends RodWalker 2!"); + throw new ReviewedStingException("LOGICAL ERROR: Only considering haplotypes of length > 2!"); byte prevBase = hap.getBase(0); // The 1st base in the haplotype byte curBase = hap.getBase(1); // The 2nd base in the haplotype @@ -746,7 +746,7 @@ public class ReadBackedPhasingWalker extends RodWalker { try { digest = MessageDigest.getInstance("MD5"); } catch (NoSuchAlgorithmException e) { - throw new GATKException("Unable to find MD5 checksumer"); + throw new ReviewedStingException("Unable to find MD5 checksumer"); } out.println("Header:"); // enumerate the list of ROD's we've loaded diff --git a/java/src/org/broadinstitute/sting/playground/utils/GenomicMap.java b/java/src/org/broadinstitute/sting/playground/utils/GenomicMap.java index f85f13da2..c22105ed5 100644 --- a/java/src/org/broadinstitute/sting/playground/utils/GenomicMap.java +++ b/java/src/org/broadinstitute/sting/playground/utils/GenomicMap.java @@ -49,7 +49,7 @@ import net.sf.samtools.SAMRecord; import org.broadinstitute.sting.gatk.iterators.PushbackIterator; import org.broadinstitute.sting.utils.*; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import org.broadinstitute.sting.utils.exceptions.UserException; import org.broadinstitute.sting.utils.sam.AlignmentUtils; import org.broadinstitute.sting.utils.collections.Pair; @@ -77,8 +77,8 @@ public class GenomicMap implements Iterable c) { - if ( name == null ) throw new GATKException("Custom contig name can not be null"); - if ( map.containsKey(name)) throw new GATKException("Custom contig "+name+" already exists"); + if ( name == null ) throw new ReviewedStingException("Custom contig name can not be null"); + if ( map.containsKey(name)) throw new ReviewedStingException("Custom contig "+name+" already exists"); map.put(name, c); } @@ -184,7 +184,7 @@ public class GenomicMap implements Iterable,Integer> seekForward(Collection segments,int position) { - if ( position < 1 ) throw new GATKException("Position "+position + " is outside of custom contig boundaries"); + if ( position < 1 ) throw new ReviewedStingException("Position "+position + " is outside of custom contig boundaries"); PushbackIterator iter = new PushbackIterator(segments.iterator()); @@ -392,7 +392,7 @@ public class GenomicMap implements Iterable segments) { diff --git a/java/src/org/broadinstitute/sting/playground/utils/ProcessUtils.java b/java/src/org/broadinstitute/sting/playground/utils/ProcessUtils.java index d86934baa..781a6fc9c 100644 --- a/java/src/org/broadinstitute/sting/playground/utils/ProcessUtils.java +++ b/java/src/org/broadinstitute/sting/playground/utils/ProcessUtils.java @@ -25,7 +25,7 @@ package org.broadinstitute.sting.playground.utils; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import org.broadinstitute.sting.utils.text.XReadLines; import org.apache.log4j.Logger; @@ -60,7 +60,7 @@ public class ProcessUtils { return result; } catch (Exception e) { - throw new GATKException("Error running command:" + command, e); + throw new ReviewedStingException("Error running command:" + command, e); } } } diff --git a/java/src/org/broadinstitute/sting/playground/utils/report/AnalysisModuleScanner.java b/java/src/org/broadinstitute/sting/playground/utils/report/AnalysisModuleScanner.java index 4308d93c3..46b23719d 100644 --- a/java/src/org/broadinstitute/sting/playground/utils/report/AnalysisModuleScanner.java +++ b/java/src/org/broadinstitute/sting/playground/utils/report/AnalysisModuleScanner.java @@ -26,7 +26,7 @@ package org.broadinstitute.sting.playground.utils.report; import org.broadinstitute.sting.playground.utils.report.tags.Analysis; import org.broadinstitute.sting.playground.utils.report.tags.DataPoint; import org.broadinstitute.sting.playground.utils.report.tags.Param; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import java.lang.annotation.Annotation; import java.lang.reflect.Field; @@ -73,7 +73,7 @@ public class AnalysisModuleScanner { /** scan the class and find all appropriate fields and tables */ public void scan() { if (cls == null || !cls.isAnnotationPresent(Analysis.class)) - throw new GATKException("The class passed in cannot be null, " + "" + + throw new ReviewedStingException("The class passed in cannot be null, " + "" + "and must contain the @Analysis annotation, class " + cls + " was the input"); // get the annotation off of the class diff --git a/java/src/org/broadinstitute/sting/playground/utils/report/ReportMarshaller.java b/java/src/org/broadinstitute/sting/playground/utils/report/ReportMarshaller.java index 34314a4f7..1dc360797 100644 --- a/java/src/org/broadinstitute/sting/playground/utils/report/ReportMarshaller.java +++ b/java/src/org/broadinstitute/sting/playground/utils/report/ReportMarshaller.java @@ -27,7 +27,7 @@ package org.broadinstitute.sting.playground.utils.report; import org.broadinstitute.sting.playground.utils.report.templates.ReportFormat; import org.broadinstitute.sting.playground.utils.report.utils.ComplexDataUtils; import org.broadinstitute.sting.playground.utils.report.utils.Node; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import java.io.*; import java.lang.reflect.Field; @@ -195,7 +195,7 @@ public class ReportMarshaller { else node.addAllChildren(nodes); } catch (IllegalAccessException e) { - throw new GATKException("Unable to access field " + f); + throw new ReviewedStingException("Unable to access field " + f); } } } diff --git a/java/src/org/broadinstitute/sting/queue/extensions/gatk/GATKExtensionsGenerator.java b/java/src/org/broadinstitute/sting/queue/extensions/gatk/GATKExtensionsGenerator.java index d819c7502..92574d4ad 100644 --- a/java/src/org/broadinstitute/sting/queue/extensions/gatk/GATKExtensionsGenerator.java +++ b/java/src/org/broadinstitute/sting/queue/extensions/gatk/GATKExtensionsGenerator.java @@ -39,7 +39,7 @@ import org.broadinstitute.sting.gatk.io.stubs.SAMFileReaderArgumentTypeDescripto import org.broadinstitute.sting.gatk.io.stubs.SAMFileWriterArgumentTypeDescriptor; import org.broadinstitute.sting.gatk.refdata.tracks.RMDTrackManager; import org.broadinstitute.sting.gatk.walkers.Walker; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import java.io.File; import java.io.IOException; @@ -94,7 +94,7 @@ public class GATKExtensionsGenerator extends CommandLineProgram { protected int execute() { try { if (!outputDirectory.isDirectory() && !outputDirectory.mkdirs()) - throw new GATKException("Unable to create output directory: " + outputDirectory); + throw new ReviewedStingException("Unable to create output directory: " + outputDirectory); for (Class clp: clpManager.getValues()) { diff --git a/java/src/org/broadinstitute/sting/utils/CardinalityCounter.java b/java/src/org/broadinstitute/sting/utils/CardinalityCounter.java index 978920d81..50d5e8dda 100644 --- a/java/src/org/broadinstitute/sting/utils/CardinalityCounter.java +++ b/java/src/org/broadinstitute/sting/utils/CardinalityCounter.java @@ -1,6 +1,6 @@ package org.broadinstitute.sting.utils; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import java.util.Iterator; @@ -37,7 +37,7 @@ public class CardinalityCounter implements Iterator, Iterable { public int[] next() { if (!hasNext()) - throw new GATKException("CANNOT iterate past end!"); + throw new ReviewedStingException("CANNOT iterate past end!"); // Copy the assignment to be returned: int[] nextList = new int[valList.length]; diff --git a/java/src/org/broadinstitute/sting/utils/GenomeLoc.java b/java/src/org/broadinstitute/sting/utils/GenomeLoc.java index 93537299f..9809bff0d 100644 --- a/java/src/org/broadinstitute/sting/utils/GenomeLoc.java +++ b/java/src/org/broadinstitute/sting/utils/GenomeLoc.java @@ -1,7 +1,7 @@ package org.broadinstitute.sting.utils; import net.sf.samtools.SAMRecord; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import java.util.ArrayList; import java.util.List; @@ -163,9 +163,9 @@ public class GenomeLoc implements Comparable, Cloneable, Serializable return ! discontinuousP( that ); } - public GenomeLoc merge( GenomeLoc that ) throws GATKException { + public GenomeLoc merge( GenomeLoc that ) throws ReviewedStingException { if (!(this.contiguousP(that))) { - throw new GATKException("The two genome loc's need to be contigous"); + throw new ReviewedStingException("The two genome loc's need to be contigous"); } return new GenomeLoc(getContig(), this.contigIndex, @@ -173,9 +173,9 @@ public class GenomeLoc implements Comparable, Cloneable, Serializable Math.max( getStop(), that.getStop()) ); } - public GenomeLoc intersect( GenomeLoc that ) throws GATKException { + public GenomeLoc intersect( GenomeLoc that ) throws ReviewedStingException { if (!(this.overlapsP(that))) { - throw new GATKException("GenomeLoc::intersect(): The two genome loc's need to overlap"); + throw new ReviewedStingException("GenomeLoc::intersect(): The two genome loc's need to overlap"); } return new GenomeLoc(getContig(), this.contigIndex, diff --git a/java/src/org/broadinstitute/sting/utils/GenomeLocParser.java b/java/src/org/broadinstitute/sting/utils/GenomeLocParser.java index d6530ade0..8f23ae6c7 100644 --- a/java/src/org/broadinstitute/sting/utils/GenomeLocParser.java +++ b/java/src/org/broadinstitute/sting/utils/GenomeLocParser.java @@ -42,7 +42,7 @@ import org.apache.log4j.Logger; import org.broadinstitute.sting.gatk.GenomeAnalysisEngine; import org.broadinstitute.sting.gatk.arguments.ValidationExclusion; import org.broadinstitute.sting.utils.bed.BedParser; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import org.broadinstitute.sting.utils.exceptions.UserException; import org.broadinstitute.sting.utils.interval.IntervalMergingRule; import org.broadinstitute.sting.utils.text.XReadLines; @@ -428,10 +428,10 @@ public class GenomeLocParser { public static GenomeLoc createGenomeLoc(int contigIndex, final long start, final long stop) { checkSetup(); if (start < 0) { - throw new GATKException("Bad start position " + start); + throw new ReviewedStingException("Bad start position " + start); } if (stop < -1) { - throw new GATKException("Bad stop position " + stop); + throw new ReviewedStingException("Bad stop position " + stop); } // a negative -1 indicates it's not a meaningful end position @@ -498,16 +498,16 @@ public class GenomeLocParser { */ private static GenomeLoc exceptionOnInvalidGenomeLoc(GenomeLoc toReturn) { if (toReturn.getStart() < 0) { - throw new GATKException("Parameters to GenomeLocParser are incorrect: the start position is less than 0"); + throw new ReviewedStingException("Parameters to GenomeLocParser are incorrect: the start position is less than 0"); } if ((toReturn.getStop() != -1) && (toReturn.getStop() < 0)) { - throw new GATKException("Parameters to GenomeLocParser are incorrect: the stop position is less than 0"); + throw new ReviewedStingException("Parameters to GenomeLocParser are incorrect: the stop position is less than 0"); } if (toReturn.getContigIndex() < 0) { - throw new GATKException("Parameters to GenomeLocParser are incorrect: the contig index is less than 0"); + throw new ReviewedStingException("Parameters to GenomeLocParser are incorrect: the contig index is less than 0"); } if (toReturn.getContigIndex() >= contigInfo.getSequences().size()) { - throw new GATKException("Parameters to GenomeLocParser are incorrect: the contig index is greater then the stored sequence count"); + throw new ReviewedStingException("Parameters to GenomeLocParser are incorrect: the contig index is greater then the stored sequence count"); } return toReturn; @@ -528,11 +528,11 @@ public class GenomeLocParser { private static void exceptionOnInvalidGenomeLocBounds(GenomeLoc locus) { int contigSize = contigInfo.getSequence(locus.getContigIndex()).getSequenceLength(); if(locus.getStart() > contigSize) - throw new GATKException(String.format("GenomeLoc is invalid: locus start %d is after the end of contig %s",locus.getStart(),locus.getContig())); + throw new ReviewedStingException(String.format("GenomeLoc is invalid: locus start %d is after the end of contig %s",locus.getStart(),locus.getContig())); if(locus.getStop() > contigSize) - throw new GATKException(String.format("GenomeLoc is invalid: locus stop %d is after the end of contig %s",locus.getStop(),locus.getContig())); + throw new ReviewedStingException(String.format("GenomeLoc is invalid: locus stop %d is after the end of contig %s",locus.getStop(),locus.getContig())); if (locus.getStart() > locus.getStop()) { - throw new GATKException("Parameters to GenomeLocParser are incorrect: the start position is greater than the end position"); + throw new ReviewedStingException("Parameters to GenomeLocParser are incorrect: the start position is greater than the end position"); } } @@ -624,7 +624,7 @@ public class GenomeLocParser { int index = -1; if ((index = contigInfo.getSequenceIndex(contig)) < 0) { - throw new GATKException("Contig name ( " + contig + " ) not in the set sequence dictionary."); + throw new ReviewedStingException("Contig name ( " + contig + " ) not in the set sequence dictionary."); } return exceptionOnInvalidGenomeLoc(new GenomeLoc(contig, index, loc.start, loc.getStop())); } @@ -637,7 +637,7 @@ public class GenomeLocParser { public static GenomeLoc setContigIndex(GenomeLoc loc, int contig) { checkSetup(); if ((contig >= GenomeLocParser.contigInfo.getSequences().size()) || (contig < 0)) { - throw new GATKException("Contig index ( " + contig + " ) is not in the sequence dictionary set."); + throw new ReviewedStingException("Contig index ( " + contig + " ) is not in the sequence dictionary set."); } return exceptionOnInvalidGenomeLoc(new GenomeLoc(GenomeLocParser.contigInfo.getSequence(contig).getSequenceName(), contig, loc.start, loc.getStop())); } @@ -710,7 +710,7 @@ public class GenomeLocParser { /** check to make sure that we've setup the contig information */ private static void checkSetup() { if (contigInfo == null) { - throw new GATKException("The GenomeLocParser hasn't been setup with a contig sequence yet"); + throw new ReviewedStingException("The GenomeLocParser hasn't been setup with a contig sequence yet"); } } diff --git a/java/src/org/broadinstitute/sting/utils/GenomeLocSortedSet.java b/java/src/org/broadinstitute/sting/utils/GenomeLocSortedSet.java index 28b4aa98c..fcb73f1ce 100755 --- a/java/src/org/broadinstitute/sting/utils/GenomeLocSortedSet.java +++ b/java/src/org/broadinstitute/sting/utils/GenomeLocSortedSet.java @@ -3,7 +3,7 @@ package org.broadinstitute.sting.utils; import net.sf.samtools.SAMSequenceDictionary; import net.sf.samtools.SAMSequenceRecord; import org.apache.log4j.Logger; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import java.util.*; @@ -110,7 +110,7 @@ public class GenomeLocSortedSet extends AbstractSet { } else { int loc = Collections.binarySearch(mArray,e); if (loc >= 0) { - throw new GATKException("Genome Loc Sorted Set already contains the GenomicLoc " + e.toString()); + throw new ReviewedStingException("Genome Loc Sorted Set already contains the GenomicLoc " + e.toString()); } else { mArray.add((loc+1) * -1,e); return true; @@ -194,7 +194,7 @@ public class GenomeLocSortedSet extends AbstractSet { } else if ( e.getStop() < p.getStart() ) { toExclude.pop(); // p starts after e stops, e is done } else { - throw new GATKException("BUG: unexpected condition: p=" + p + ", e=" + e); + throw new ReviewedStingException("BUG: unexpected condition: p=" + p + ", e=" + e); } if ( i++ % 10000 == 0 ) diff --git a/java/src/org/broadinstitute/sting/utils/HeapSizeMonitor.java b/java/src/org/broadinstitute/sting/utils/HeapSizeMonitor.java index e45e883cb..9cf1b8c06 100644 --- a/java/src/org/broadinstitute/sting/utils/HeapSizeMonitor.java +++ b/java/src/org/broadinstitute/sting/utils/HeapSizeMonitor.java @@ -1,6 +1,6 @@ package org.broadinstitute.sting.utils; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import java.lang.management.ManagementFactory; import java.lang.management.MemoryMXBean; @@ -42,7 +42,7 @@ public class HeapSizeMonitor { monitorThread.join(); } catch(InterruptedException ex) { - throw new GATKException("Unable to connect to monitor thread"); + throw new ReviewedStingException("Unable to connect to monitor thread"); } monitorThread = null; } @@ -74,7 +74,7 @@ public class HeapSizeMonitor { Thread.sleep(monitorFrequencyMillis); } catch(InterruptedException ex) { - throw new GATKException("Unable to continue monitoring heap consumption",ex); + throw new ReviewedStingException("Unable to continue monitoring heap consumption",ex); } } } diff --git a/java/src/org/broadinstitute/sting/utils/MalformedGenomeLocException.java b/java/src/org/broadinstitute/sting/utils/MalformedGenomeLocException.java index a0d11d6c7..ce554397c 100644 --- a/java/src/org/broadinstitute/sting/utils/MalformedGenomeLocException.java +++ b/java/src/org/broadinstitute/sting/utils/MalformedGenomeLocException.java @@ -1,6 +1,6 @@ package org.broadinstitute.sting.utils; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; /** * User: hanna * Date: Jun 2, 2009 @@ -19,7 +19,7 @@ import org.broadinstitute.sting.utils.exceptions.GATKException; * bad sequence id out of bounds, etc. */ -public class MalformedGenomeLocException extends GATKException { +public class MalformedGenomeLocException extends ReviewedStingException { /** * Create a new MalformedGenomeLocException with the given message. Does not preserve the existing stack trace. * @param message The message. diff --git a/java/src/org/broadinstitute/sting/utils/PathUtils.java b/java/src/org/broadinstitute/sting/utils/PathUtils.java index 2feb14484..47466be20 100755 --- a/java/src/org/broadinstitute/sting/utils/PathUtils.java +++ b/java/src/org/broadinstitute/sting/utils/PathUtils.java @@ -1,6 +1,6 @@ package org.broadinstitute.sting.utils; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import java.util.List; import java.util.ArrayList; @@ -114,7 +114,7 @@ public class PathUtils { } if (dir.listFiles() == null) { - throw new GATKException("The volume '" + dir.getAbsolutePath() + "' could not be accessed."); + throw new ReviewedStingException("The volume '" + dir.getAbsolutePath() + "' could not be accessed."); } } diff --git a/java/src/org/broadinstitute/sting/utils/ReservoirDownsampler.java b/java/src/org/broadinstitute/sting/utils/ReservoirDownsampler.java index b1a4e3c8d..1cfe4b25f 100644 --- a/java/src/org/broadinstitute/sting/utils/ReservoirDownsampler.java +++ b/java/src/org/broadinstitute/sting/utils/ReservoirDownsampler.java @@ -1,6 +1,6 @@ package org.broadinstitute.sting.utils; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import java.util.*; @@ -35,7 +35,7 @@ public class ReservoirDownsampler { */ public ReservoirDownsampler(final int maxElements) { if(maxElements < 0) - throw new GATKException("Unable to work with an negative size collection of elements"); + throw new ReviewedStingException("Unable to work with an negative size collection of elements"); this.reservoir = new ArrayList(maxElements); this.maxElements = maxElements; } diff --git a/java/src/org/broadinstitute/sting/utils/SequenceDictionaryUtils.java b/java/src/org/broadinstitute/sting/utils/SequenceDictionaryUtils.java index 4198bc9c3..fb3d6f6a2 100755 --- a/java/src/org/broadinstitute/sting/utils/SequenceDictionaryUtils.java +++ b/java/src/org/broadinstitute/sting/utils/SequenceDictionaryUtils.java @@ -29,7 +29,7 @@ import net.sf.samtools.SAMSequenceRecord; import org.apache.log4j.Logger; import org.broadinstitute.sting.gatk.GenomeAnalysisEngine; import org.broadinstitute.sting.gatk.arguments.ValidationExclusion; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import org.broadinstitute.sting.utils.exceptions.UserException; import java.util.*; @@ -116,7 +116,7 @@ public class SequenceDictionaryUtils { case OUT_OF_ORDER: throw new UserException.IncompatibleSequenceDictionaries("Order of contigs differences, which is unsafe", name1, dict1, name2, dict2); default: - throw new GATKException("Unexpected SequenceDictionaryComparison type"); + throw new ReviewedStingException("Unexpected SequenceDictionaryComparison type"); } } diff --git a/java/src/org/broadinstitute/sting/utils/WilcoxonRankSum.java b/java/src/org/broadinstitute/sting/utils/WilcoxonRankSum.java index e5819fb75..b9ea9d0bc 100755 --- a/java/src/org/broadinstitute/sting/utils/WilcoxonRankSum.java +++ b/java/src/org/broadinstitute/sting/utils/WilcoxonRankSum.java @@ -30,7 +30,7 @@ import cern.jet.random.Normal; import java.util.*; import org.broadinstitute.sting.utils.collections.Pair; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; public class WilcoxonRankSum { static final String headerString = ("nA nB .005 .01 .025 .05 .10 .20"); @@ -186,7 +186,7 @@ public class WilcoxonRankSum { U = n1 < n2 ? U1 : U2; break; default: - throw new GATKException("Unexpected WILCOXON H0: " + h0); + throw new ReviewedStingException("Unexpected WILCOXON H0: " + h0); } // data is nA nB then @@ -233,7 +233,7 @@ public class WilcoxonRankSum { pvalue = NORMAL.cdf(z); break; default: - throw new GATKException("Unexpected WILCOXON H0: " + h0); + throw new ReviewedStingException("Unexpected WILCOXON H0: " + h0); } return pvalue; diff --git a/java/src/org/broadinstitute/sting/utils/classloader/JVMUtils.java b/java/src/org/broadinstitute/sting/utils/classloader/JVMUtils.java index 905814304..9b7c2c4de 100755 --- a/java/src/org/broadinstitute/sting/utils/classloader/JVMUtils.java +++ b/java/src/org/broadinstitute/sting/utils/classloader/JVMUtils.java @@ -25,7 +25,7 @@ package org.broadinstitute.sting.utils.classloader; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import java.lang.reflect.Modifier; import java.lang.reflect.Field; @@ -126,7 +126,7 @@ public class JVMUtils { field.set(instance, value); } catch( IllegalAccessException ex ) { - throw new GATKException(String.format("Could not set %s in instance %s to %s",field.getName(),instance.getClass().getName(),value.toString())); + throw new ReviewedStingException(String.format("Could not set %s in instance %s to %s",field.getName(),instance.getClass().getName(),value.toString())); } } @@ -142,7 +142,7 @@ public class JVMUtils { return field.get(instance); } catch( IllegalAccessException ex ) { - throw new GATKException(String.format("Could not retrieve %s in instance %s",field.getName(),instance.getClass().getName())); + throw new ReviewedStingException(String.format("Could not retrieve %s in instance %s",field.getName(),instance.getClass().getName())); } } diff --git a/java/src/org/broadinstitute/sting/utils/classloader/PackageUtils.java b/java/src/org/broadinstitute/sting/utils/classloader/PackageUtils.java index b97dff22c..4f570aa7a 100755 --- a/java/src/org/broadinstitute/sting/utils/classloader/PackageUtils.java +++ b/java/src/org/broadinstitute/sting/utils/classloader/PackageUtils.java @@ -27,7 +27,7 @@ package org.broadinstitute.sting.utils.classloader; import ch.qos.logback.classic.Level; import ch.qos.logback.classic.Logger; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import org.broadinstitute.sting.utils.exceptions.DynamicClassResolutionException; import org.reflections.Reflections; import org.reflections.scanners.SubTypesScanner; @@ -136,7 +136,7 @@ public class PackageUtils { method.invoke(ClassLoader.getSystemClassLoader(), url); resetReflections(); } catch (Exception e) { - throw new GATKException("Error adding url to the current classloader.", e); + throw new ReviewedStingException("Error adding url to the current classloader.", e); } } diff --git a/java/src/org/broadinstitute/sting/utils/classloader/PluginManager.java b/java/src/org/broadinstitute/sting/utils/classloader/PluginManager.java index 4d59f9400..bc26a0609 100644 --- a/java/src/org/broadinstitute/sting/utils/classloader/PluginManager.java +++ b/java/src/org/broadinstitute/sting/utils/classloader/PluginManager.java @@ -25,7 +25,7 @@ package org.broadinstitute.sting.utils.classloader; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import org.broadinstitute.sting.utils.exceptions.DynamicClassResolutionException; import java.util.HashMap; @@ -87,7 +87,7 @@ public abstract class PluginManager { Class plugin = pluginsByName.get(pluginName); try { if( plugin == null ) - throw new GATKException(String.format("Could not find %s with name: %s", pluginCategory,pluginName)); + throw new ReviewedStingException(String.format("Could not find %s with name: %s", pluginCategory,pluginName)); return plugin.newInstance(); } catch (Exception e) { throw new DynamicClassResolutionException(plugin, e); diff --git a/java/src/org/broadinstitute/sting/utils/collections/CircularArray.java b/java/src/org/broadinstitute/sting/utils/collections/CircularArray.java index d107b85b2..5a669e65c 100644 --- a/java/src/org/broadinstitute/sting/utils/collections/CircularArray.java +++ b/java/src/org/broadinstitute/sting/utils/collections/CircularArray.java @@ -25,7 +25,7 @@ package org.broadinstitute.sting.utils.collections; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; /** This class, closely resembling a deque (except that it is not dynamically grown), @@ -69,7 +69,7 @@ public class CircularArray { /** Creates an array of fixed length */ public CircularArray(int length) { - if ( length <= 0 ) throw new GATKException("CircularArray length must be positive. Passed: "+length); + if ( length <= 0 ) throw new ReviewedStingException("CircularArray length must be positive. Passed: "+length); data = new Object[length]; offset = 0; } @@ -150,7 +150,7 @@ public class CircularArray { /** Creates an array of fixed length */ public Int(int length) { - if ( length <= 0 ) throw new GATKException("CircularArray length must be positive. Passed: "+length); + if ( length <= 0 ) throw new ReviewedStingException("CircularArray length must be positive. Passed: "+length); data = new int[length]; // automaticaly initialized to zeros offset = 0; } diff --git a/java/src/org/broadinstitute/sting/utils/collections/MergingIterator.java b/java/src/org/broadinstitute/sting/utils/collections/MergingIterator.java index c6bf96f64..61b842c05 100644 --- a/java/src/org/broadinstitute/sting/utils/collections/MergingIterator.java +++ b/java/src/org/broadinstitute/sting/utils/collections/MergingIterator.java @@ -27,7 +27,7 @@ package org.broadinstitute.sting.utils.collections; import org.broadinstitute.sting.gatk.refdata.utils.LocationAwareSeekableRODIterator; import org.broadinstitute.sting.gatk.refdata.utils.RODRecordList; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import org.broadinstitute.sting.utils.GenomeLoc; import java.util.*; @@ -42,10 +42,10 @@ public class MergingIterator implements Iterator, Iterable it) { if ( it instanceof LocationAwareSeekableRODIterator) { this.it = (LocationAwareSeekableRODIterator)it; - if ( ! it.hasNext() ) throw new GATKException("Iterator is empty"); + if ( ! it.hasNext() ) throw new ReviewedStingException("Iterator is empty"); update(); } else { - throw new GATKException("Iterator passed to MergingIterator is not LocationAwareSeekableRODIterator"); + throw new ReviewedStingException("Iterator passed to MergingIterator is not LocationAwareSeekableRODIterator"); } } diff --git a/java/src/org/broadinstitute/sting/utils/duplicates/DupUtils.java b/java/src/org/broadinstitute/sting/utils/duplicates/DupUtils.java index 27d6619cd..d2baa46c1 100644 --- a/java/src/org/broadinstitute/sting/utils/duplicates/DupUtils.java +++ b/java/src/org/broadinstitute/sting/utils/duplicates/DupUtils.java @@ -28,7 +28,7 @@ package org.broadinstitute.sting.utils.duplicates; import net.sf.samtools.SAMRecord; import org.broadinstitute.sting.utils.*; import org.broadinstitute.sting.utils.collections.Pair; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import org.broadinstitute.sting.utils.pileup.ReadBackedPileup; import org.broadinstitute.sting.utils.pileup.PileupElement; import org.broadinstitute.sting.utils.pileup.ReadBackedPileupImpl; @@ -41,7 +41,7 @@ public class DupUtils { try { return (SAMRecord)read.clone(); } catch ( CloneNotSupportedException e ) { - throw new GATKException("Unexpected Clone failure!"); + throw new ReviewedStingException("Unexpected Clone failure!"); } } diff --git a/java/src/org/broadinstitute/sting/utils/exceptions/GATKException.java b/java/src/org/broadinstitute/sting/utils/exceptions/ReviewedStingException.java similarity index 74% rename from java/src/org/broadinstitute/sting/utils/exceptions/GATKException.java rename to java/src/org/broadinstitute/sting/utils/exceptions/ReviewedStingException.java index a71cb85a8..e1ff72ca1 100644 --- a/java/src/org/broadinstitute/sting/utils/exceptions/GATKException.java +++ b/java/src/org/broadinstitute/sting/utils/exceptions/ReviewedStingException.java @@ -24,17 +24,17 @@ package org.broadinstitute.sting.utils.exceptions; -import org.broadinstitute.sting.utils.exceptions.StingException; - /** - * Temp class to track split from Sting exception to UserException + * A trivial extension around StingException to mark exceptions that have been reviewed for correctness, + * completeness, etc. By using this exception you are saying "this is the right error message". StingException + * is now just a catch all for lazy users. */ -public class GATKException extends StingException { - public GATKException(String msg) { +public class ReviewedStingException extends StingException { + public ReviewedStingException(String msg) { super(msg); } - public GATKException(String message, Throwable throwable) { + public ReviewedStingException(String message, Throwable throwable) { super(message, throwable); } } diff --git a/java/src/org/broadinstitute/sting/utils/exceptions/UserException.java b/java/src/org/broadinstitute/sting/utils/exceptions/UserException.java index b7fe6655f..b5cd705db 100755 --- a/java/src/org/broadinstitute/sting/utils/exceptions/UserException.java +++ b/java/src/org/broadinstitute/sting/utils/exceptions/UserException.java @@ -41,7 +41,7 @@ import java.util.Arrays; * Date: Sep 3, 2010 * Time: 2:24:09 PM */ -public class UserException extends GATKException { +public class UserException extends ReviewedStingException { public UserException(String msg) { super(msg); } public UserException(String msg, Throwable e) { super(msg, e); } private UserException(Throwable e) { super("", e); } // cannot be called, private access diff --git a/java/src/org/broadinstitute/sting/utils/fasta/ArtificialFastaUtils.java b/java/src/org/broadinstitute/sting/utils/fasta/ArtificialFastaUtils.java index 8b1e85030..90f9fe5bd 100644 --- a/java/src/org/broadinstitute/sting/utils/fasta/ArtificialFastaUtils.java +++ b/java/src/org/broadinstitute/sting/utils/fasta/ArtificialFastaUtils.java @@ -1,6 +1,6 @@ package org.broadinstitute.sting.utils.fasta; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import java.io.FileNotFoundException; import java.io.FileOutputStream; @@ -34,7 +34,7 @@ public class ArtificialFastaUtils { try { s = new PrintStream(new FileOutputStream(fileName)); } catch (FileNotFoundException e) { - throw new GATKException("Filename " + fileName + " passed to the ArtificialFastaUtils generated a FileNotFound exception", e); + throw new ReviewedStingException("Filename " + fileName + " passed to the ArtificialFastaUtils generated a FileNotFound exception", e); } generateFakeFasta(contigNames, contigSizes, pattern, s); } @@ -58,7 +58,7 @@ public class ArtificialFastaUtils { */ private static void generateFakeFasta(List contigNames, List contigSizes, BASE_PATTERN pattern, PrintStream s) { if (contigNames.size() != contigSizes.size()) { - throw new GATKException("ArtificialContig name and size arrays are not equal sizes"); + throw new ReviewedStingException("ArtificialContig name and size arrays are not equal sizes"); } for (int x = 0; x < contigNames.size(); x++) { ArtificialContig tig = new ArtificialContig(contigNames.get(x), contigSizes.get(x), pattern); @@ -122,7 +122,7 @@ class ArtificialContig { case ALL_G: return "G"; default: - throw new GATKException("Unknown base pattern"); + throw new ReviewedStingException("Unknown base pattern"); } } diff --git a/java/src/org/broadinstitute/sting/utils/file/FSLockWithShared.java b/java/src/org/broadinstitute/sting/utils/file/FSLockWithShared.java index 767a7aadf..965210bea 100644 --- a/java/src/org/broadinstitute/sting/utils/file/FSLockWithShared.java +++ b/java/src/org/broadinstitute/sting/utils/file/FSLockWithShared.java @@ -1,7 +1,7 @@ package org.broadinstitute.sting.utils.file; import org.apache.log4j.Logger; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import java.io.File; import java.io.IOException; @@ -143,7 +143,7 @@ public class FSLockWithShared { channel.close(); } catch (Exception e) { - throw new GATKException("An error occurred while unlocking file", e); + throw new ReviewedStingException("An error occurred while unlocking file", e); } } } diff --git a/java/src/org/broadinstitute/sting/utils/genotype/LikelihoodObject.java b/java/src/org/broadinstitute/sting/utils/genotype/LikelihoodObject.java index 334394a3e..f68523479 100755 --- a/java/src/org/broadinstitute/sting/utils/genotype/LikelihoodObject.java +++ b/java/src/org/broadinstitute/sting/utils/genotype/LikelihoodObject.java @@ -3,7 +3,7 @@ package org.broadinstitute.sting.utils.genotype; import edu.mit.broad.picard.genotype.DiploidGenotype; import edu.mit.broad.picard.genotype.geli.GenotypeLikelihoods; import net.sf.samtools.SAMFileHeader; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import java.util.HashMap; @@ -234,15 +234,15 @@ public class LikelihoodObject { switch (mLikelihoodType) { case NEGATIVE_LOG: if (score < 0) - throw new GATKException("Likelikhood score of " + score + " is invalid, for NEGATIVE_LOG it must be greater than or equal to 0"); + throw new ReviewedStingException("Likelikhood score of " + score + " is invalid, for NEGATIVE_LOG it must be greater than or equal to 0"); break; case LOG: if (score > 0) - throw new GATKException("Likelikhood score of " + score + " is invalid, for LOG it must be less than or equal to 0"); + throw new ReviewedStingException("Likelikhood score of " + score + " is invalid, for LOG it must be less than or equal to 0"); break; case RAW: if (score < 0 || score > 1) - throw new GATKException("Likelikhood score of " + score + " is invalid, for RAW it must be [0,1]"); + throw new ReviewedStingException("Likelikhood score of " + score + " is invalid, for RAW it must be [0,1]"); break; } } diff --git a/java/src/org/broadinstitute/sting/utils/genotype/glf/GLFReader.java b/java/src/org/broadinstitute/sting/utils/genotype/glf/GLFReader.java index bf5b15d02..86c53fe99 100644 --- a/java/src/org/broadinstitute/sting/utils/genotype/glf/GLFReader.java +++ b/java/src/org/broadinstitute/sting/utils/genotype/glf/GLFReader.java @@ -3,7 +3,7 @@ package org.broadinstitute.sting.utils.genotype.glf; import net.sf.samtools.util.BinaryCodec; import net.sf.samtools.util.BlockCompressedInputStream; import net.sf.samtools.util.RuntimeEOFException; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import org.broadinstitute.sting.utils.exceptions.UserException; import org.broadinstitute.sting.utils.genotype.LikelihoodObject; @@ -225,7 +225,7 @@ public class GLFReader implements Iterator { } public void remove() { - throw new GATKException("GLFReader doesn't support remove()"); + throw new ReviewedStingException("GLFReader doesn't support remove()"); } public void close() { diff --git a/java/src/org/broadinstitute/sting/utils/genotype/glf/GLFRecord.java b/java/src/org/broadinstitute/sting/utils/genotype/glf/GLFRecord.java index 5d2b8e5cf..242d3a092 100755 --- a/java/src/org/broadinstitute/sting/utils/genotype/glf/GLFRecord.java +++ b/java/src/org/broadinstitute/sting/utils/genotype/glf/GLFRecord.java @@ -1,7 +1,7 @@ package org.broadinstitute.sting.utils.genotype.glf; import net.sf.samtools.util.BinaryCodec; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; /* @@ -251,7 +251,7 @@ public abstract class GLFRecord { * @return the minimum value */ protected static double findMin(double vals[]) { - if (vals.length < 1) throw new GATKException("findMin: an array of size < 1 was passed in"); + if (vals.length < 1) throw new ReviewedStingException("findMin: an array of size < 1 was passed in"); double min = vals[0]; for (double d : vals) diff --git a/java/src/org/broadinstitute/sting/utils/help/ApplicationDetails.java b/java/src/org/broadinstitute/sting/utils/help/ApplicationDetails.java index c2a5f8f77..b948b2eb5 100644 --- a/java/src/org/broadinstitute/sting/utils/help/ApplicationDetails.java +++ b/java/src/org/broadinstitute/sting/utils/help/ApplicationDetails.java @@ -25,7 +25,7 @@ package org.broadinstitute.sting.utils.help; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import org.broadinstitute.sting.utils.classloader.JVMUtils; import org.broadinstitute.sting.commandline.CommandLineProgram; @@ -80,7 +80,7 @@ public class ApplicationDetails { runningInstructions = JVMUtils.getLocationFor( application ).getName(); } catch( IOException ex ) { - throw new GATKException("Unable to determine running instructions", ex); + throw new ReviewedStingException("Unable to determine running instructions", ex); } if( runningInstructions.endsWith(".jar") ) diff --git a/java/src/org/broadinstitute/sting/utils/help/ResourceBundleExtractorDoclet.java b/java/src/org/broadinstitute/sting/utils/help/ResourceBundleExtractorDoclet.java index b044f779a..49a93148b 100644 --- a/java/src/org/broadinstitute/sting/utils/help/ResourceBundleExtractorDoclet.java +++ b/java/src/org/broadinstitute/sting/utils/help/ResourceBundleExtractorDoclet.java @@ -31,7 +31,7 @@ import java.util.*; import java.io.PrintStream; import java.io.IOException; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import org.broadinstitute.sting.utils.classloader.JVMUtils; import org.broadinstitute.sting.utils.Utils; import org.broadinstitute.sting.gatk.walkers.Walker; @@ -181,7 +181,7 @@ public class ResourceBundleExtractorDoclet { for(Tag tag: element.tags()) { if(tag.name().equals("@"+DisplayNameTaglet.NAME)) { if(name != null) - throw new GATKException("Only one display name tag can be used per package / walker."); + throw new ReviewedStingException("Only one display name tag can be used per package / walker."); name = tag.text(); } else if(tag.name().equals("@"+VERSION_TAGLET_NAME)) diff --git a/java/src/org/broadinstitute/sting/utils/instrumentation/Sizeof.java b/java/src/org/broadinstitute/sting/utils/instrumentation/Sizeof.java index 2eaa07d89..d5c47bc07 100644 --- a/java/src/org/broadinstitute/sting/utils/instrumentation/Sizeof.java +++ b/java/src/org/broadinstitute/sting/utils/instrumentation/Sizeof.java @@ -24,7 +24,7 @@ package org.broadinstitute.sting.utils.instrumentation; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import java.lang.instrument.Instrumentation; import java.lang.reflect.Field; @@ -73,7 +73,7 @@ public class Sizeof { */ public static long getObjectSize(Object o) { if(!isEnabled()) - throw new GATKException("Sizeof operator is currently disabled! To enable, review the documentation in Sizeof.java"); + throw new ReviewedStingException("Sizeof operator is currently disabled! To enable, review the documentation in Sizeof.java"); return instrumentation.getObjectSize(o); } @@ -84,7 +84,7 @@ public class Sizeof { */ public static long getObjectGraphSize(Object o) { if(!isEnabled()) - throw new GATKException("Sizeof operator is currently disabled! To enable, review the documentation in Sizeof.java"); + throw new ReviewedStingException("Sizeof operator is currently disabled! To enable, review the documentation in Sizeof.java"); IdentityHashMap objectsSeen = new IdentityHashMap(); return getObjectGraphSize(o,objectsSeen); } @@ -134,7 +134,7 @@ public class Sizeof { fieldValue = field.get(o); } catch(IllegalAccessException ex) { - throw new GATKException("Unable to access field " + field.getName(),ex); + throw new ReviewedStingException("Unable to access field " + field.getName(),ex); } totalSize += getObjectGraphSize(fieldValue,objectsSeen); } diff --git a/java/src/org/broadinstitute/sting/utils/pileup/AbstractReadBackedPileup.java b/java/src/org/broadinstitute/sting/utils/pileup/AbstractReadBackedPileup.java index 7b039608f..95f1e3073 100644 --- a/java/src/org/broadinstitute/sting/utils/pileup/AbstractReadBackedPileup.java +++ b/java/src/org/broadinstitute/sting/utils/pileup/AbstractReadBackedPileup.java @@ -24,7 +24,7 @@ package org.broadinstitute.sting.utils.pileup; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import org.broadinstitute.sting.utils.GenomeLoc; import org.broadinstitute.sting.utils.BaseUtils; import org.broadinstitute.sting.gatk.iterators.IterableIterator; @@ -82,8 +82,8 @@ public abstract class AbstractReadBackedPileup pileup) { - if ( loc == null ) throw new GATKException("Illegal null genomeloc in ReadBackedPileup"); - if ( pileup == null ) throw new GATKException("Illegal null pileup in ReadBackedPileup"); + if ( loc == null ) throw new ReviewedStingException("Illegal null genomeloc in ReadBackedPileup"); + if ( pileup == null ) throw new ReviewedStingException("Illegal null pileup in ReadBackedPileup"); this.loc = loc; this.pileupElementTracker = new UnifiedPileupElementTracker(pileup); @@ -96,8 +96,8 @@ public abstract class AbstractReadBackedPileup pileup, int size, int nDeletions, int nMQ0Reads) { - if ( loc == null ) throw new GATKException("Illegal null genomeloc in UnifiedReadBackedPileup"); - if ( pileup == null ) throw new GATKException("Illegal null pileup in UnifiedReadBackedPileup"); + if ( loc == null ) throw new ReviewedStingException("Illegal null genomeloc in UnifiedReadBackedPileup"); + if ( pileup == null ) throw new ReviewedStingException("Illegal null pileup in UnifiedReadBackedPileup"); this.loc = loc; this.pileupElementTracker = new UnifiedPileupElementTracker(pileup); @@ -158,9 +158,9 @@ public abstract class AbstractReadBackedPileup readsOffsets2Pileup(List reads, List offsets ) { - if ( reads == null ) throw new GATKException("Illegal null read list in UnifiedReadBackedPileup"); - if ( offsets == null ) throw new GATKException("Illegal null offsets list in UnifiedReadBackedPileup"); - if ( reads.size() != offsets.size() ) throw new GATKException("Reads and offset lists have different sizes!"); + if ( reads == null ) throw new ReviewedStingException("Illegal null read list in UnifiedReadBackedPileup"); + if ( offsets == null ) throw new ReviewedStingException("Illegal null offsets list in UnifiedReadBackedPileup"); + if ( reads.size() != offsets.size() ) throw new ReviewedStingException("Reads and offset lists have different sizes!"); UnifiedPileupElementTracker pileup = new UnifiedPileupElementTracker(); for ( int i = 0; i < reads.size(); i++ ) { @@ -178,8 +178,8 @@ public abstract class AbstractReadBackedPileup readsOffsets2Pileup(List reads, int offset ) { - if ( reads == null ) throw new GATKException("Illegal null read list in UnifiedReadBackedPileup"); - if ( offset < 0 ) throw new GATKException("Illegal offset < 0 UnifiedReadBackedPileup"); + if ( reads == null ) throw new ReviewedStingException("Illegal null read list in UnifiedReadBackedPileup"); + if ( offset < 0 ) throw new ReviewedStingException("Illegal offset < 0 UnifiedReadBackedPileup"); UnifiedPileupElementTracker pileup = new UnifiedPileupElementTracker(); for ( int i = 0; i < reads.size(); i++ ) { diff --git a/java/src/org/broadinstitute/sting/utils/pileup/ReadBackedExtendedEventPileupImpl.java b/java/src/org/broadinstitute/sting/utils/pileup/ReadBackedExtendedEventPileupImpl.java index 42718320e..b64ef8ce0 100644 --- a/java/src/org/broadinstitute/sting/utils/pileup/ReadBackedExtendedEventPileupImpl.java +++ b/java/src/org/broadinstitute/sting/utils/pileup/ReadBackedExtendedEventPileupImpl.java @@ -23,7 +23,7 @@ */ package org.broadinstitute.sting.utils.pileup; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import org.broadinstitute.sting.utils.GenomeLoc; import org.broadinstitute.sting.utils.collections.Pair; @@ -140,7 +140,7 @@ public class ReadBackedExtendedEventPileupImpl extends AbstractReadBackedPileup< case INSERTION: v[i] = 'I'; break; case DELETION: v[i] = 'D'; break; case NOEVENT: v[i] = '.'; break; - default: throw new GATKException("Unknown event type encountered: "+e.getType()); + default: throw new ReviewedStingException("Unknown event type encountered: "+e.getType()); } i++; } @@ -190,7 +190,7 @@ public class ReadBackedExtendedEventPileupImpl extends AbstractReadBackedPileup< indel = getDeletionString(e.getEventLength(),refBases); break; case NOEVENT: continue; - default: throw new GATKException("Unknown event type encountered: "+e.getType()); + default: throw new ReviewedStingException("Unknown event type encountered: "+e.getType()); } cnt = events.get(indel); diff --git a/java/src/org/broadinstitute/sting/utils/sam/AlignmentUtils.java b/java/src/org/broadinstitute/sting/utils/sam/AlignmentUtils.java index 6683c89d2..c4f3338f0 100644 --- a/java/src/org/broadinstitute/sting/utils/sam/AlignmentUtils.java +++ b/java/src/org/broadinstitute/sting/utils/sam/AlignmentUtils.java @@ -31,7 +31,7 @@ import net.sf.samtools.Cigar; import net.sf.samtools.CigarElement; import net.sf.samtools.util.StringUtil; import org.broadinstitute.sting.gatk.contexts.ReferenceContext; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import org.broadinstitute.sting.utils.pileup.*; import org.broadinstitute.sting.utils.Utils; @@ -146,7 +146,7 @@ public class AlignmentUtils { case H: case P: break; - default: throw new GATKException("The " + ce.getOperator() + " cigar element is not currently supported"); + default: throw new ReviewedStingException("The " + ce.getOperator() + " cigar element is not currently supported"); } } @@ -298,7 +298,7 @@ public class AlignmentUtils { case P: break; default: - throw new GATKException( "Unsupported cigar operator: " + ce.getOperator() ); + throw new ReviewedStingException( "Unsupported cigar operator: " + ce.getOperator() ); } } return alignment; @@ -337,7 +337,7 @@ public class AlignmentUtils { case P: break; default: - throw new GATKException( "Unsupported cigar operator: " + ce.getOperator() ); + throw new ReviewedStingException( "Unsupported cigar operator: " + ce.getOperator() ); } } return alignment; diff --git a/java/src/org/broadinstitute/sting/utils/sam/ArtificialSAMFileReader.java b/java/src/org/broadinstitute/sting/utils/sam/ArtificialSAMFileReader.java index 5297e0345..16293ba62 100644 --- a/java/src/org/broadinstitute/sting/utils/sam/ArtificialSAMFileReader.java +++ b/java/src/org/broadinstitute/sting/utils/sam/ArtificialSAMFileReader.java @@ -10,7 +10,7 @@ import java.io.ByteArrayInputStream; import java.io.UnsupportedEncodingException; import java.util.*; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import org.broadinstitute.sting.utils.GenomeLoc; import org.broadinstitute.sting.utils.GenomeLocParser; /** @@ -93,7 +93,7 @@ public class ArtificialSAMFileReader extends SAMFileReader { return new ByteArrayInputStream(byteArray); } catch( UnsupportedEncodingException ex ) { - throw new GATKException("Unable to build empty input stream",ex); + throw new ReviewedStingException("Unable to build empty input stream",ex); } } } diff --git a/java/src/org/broadinstitute/sting/utils/sam/ArtificialSAMQueryIterator.java b/java/src/org/broadinstitute/sting/utils/sam/ArtificialSAMQueryIterator.java index d98a6c6f1..4f5dcca61 100644 --- a/java/src/org/broadinstitute/sting/utils/sam/ArtificialSAMQueryIterator.java +++ b/java/src/org/broadinstitute/sting/utils/sam/ArtificialSAMQueryIterator.java @@ -6,7 +6,7 @@ import net.sf.samtools.SAMRecord; import java.util.List; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; /* @@ -126,7 +126,7 @@ public class ArtificialSAMQueryIterator extends ArtificialSAMIterator { // sanity check that we have an actual matching read next SAMRecord rec = this.peek(); if (rec == null) { - throw new GATKException("The next read doesn't match"); + throw new ReviewedStingException("The next read doesn't match"); } // set the seeked variable to true seeked = true; @@ -165,7 +165,7 @@ public class ArtificialSAMQueryIterator extends ArtificialSAMIterator { super.next(); } if (!super.hasNext()) { - throw new GATKException("Unable to find the target chromosome"); + throw new ReviewedStingException("Unable to find the target chromosome"); } while (super.hasNext() && this.peek().getAlignmentStart() < start) { super.next(); @@ -173,7 +173,7 @@ public class ArtificialSAMQueryIterator extends ArtificialSAMIterator { // sanity check that we have an actual matching read next SAMRecord rec = this.peek(); if (!matches(rec)) { - throw new GATKException("The next read doesn't match"); + throw new ReviewedStingException("The next read doesn't match"); } // set the seeked variable to true seeked = true; diff --git a/java/src/org/broadinstitute/sting/utils/sam/ArtificialSAMUtils.java b/java/src/org/broadinstitute/sting/utils/sam/ArtificialSAMUtils.java index b424c59a3..095fe3ab3 100755 --- a/java/src/org/broadinstitute/sting/utils/sam/ArtificialSAMUtils.java +++ b/java/src/org/broadinstitute/sting/utils/sam/ArtificialSAMUtils.java @@ -2,7 +2,7 @@ package org.broadinstitute.sting.utils.sam; import net.sf.samtools.*; import org.broadinstitute.sting.gatk.iterators.StingSAMIterator; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import java.io.File; import java.util.ArrayList; @@ -115,7 +115,7 @@ public class ArtificialSAMUtils { */ public static SAMFileHeader createEnumeratedReadGroups( SAMFileHeader header, List readGroupIDs, List sampleNames ) { if (readGroupIDs.size() != sampleNames.size()) { - throw new GATKException("read group count and sample name count must be the same"); + throw new ReviewedStingException("read group count and sample name count must be the same"); } List readGroups = new ArrayList(); @@ -145,7 +145,7 @@ public class ArtificialSAMUtils { public static SAMRecord createArtificialRead( SAMFileHeader header, String name, int refIndex, int alignmentStart, int length ) { if( (refIndex == SAMRecord.NO_ALIGNMENT_REFERENCE_INDEX && alignmentStart != SAMRecord.NO_ALIGNMENT_START) || (refIndex != SAMRecord.NO_ALIGNMENT_REFERENCE_INDEX && alignmentStart == SAMRecord.NO_ALIGNMENT_START) ) - throw new GATKException("Invalid alignment start for artificial read, start = " + alignmentStart); + throw new ReviewedStingException("Invalid alignment start for artificial read, start = " + alignmentStart); SAMRecord record = new SAMRecord(header); record.setReadName(name); record.setReferenceIndex(refIndex); @@ -183,7 +183,7 @@ public class ArtificialSAMUtils { */ public static SAMRecord createArtificialRead( SAMFileHeader header, String name, int refIndex, int alignmentStart, byte[] bases, byte[] qual ) { if (bases.length != qual.length) { - throw new GATKException("Passed in read string is different length then the quality array"); + throw new ReviewedStingException("Passed in read string is different length then the quality array"); } SAMRecord rec = createArtificialRead(header, name, refIndex, alignmentStart, bases.length); rec.setReadBases(bases); diff --git a/java/src/org/broadinstitute/sting/utils/sam/SAMFileReaderBuilder.java b/java/src/org/broadinstitute/sting/utils/sam/SAMFileReaderBuilder.java index ab22b4e19..f8a0ca6a7 100644 --- a/java/src/org/broadinstitute/sting/utils/sam/SAMFileReaderBuilder.java +++ b/java/src/org/broadinstitute/sting/utils/sam/SAMFileReaderBuilder.java @@ -29,7 +29,7 @@ import net.sf.samtools.SAMFileReader; import java.io.File; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; /** * Allows the user to steadily accumulate information about what @@ -72,9 +72,9 @@ public class SAMFileReaderBuilder { */ public SAMFileReader build() { if( samFile == null ) - throw new GATKException( "Filename for output sam file must be supplied."); + throw new ReviewedStingException( "Filename for output sam file must be supplied."); if( validationStringency == null ) - throw new GATKException( "Header for output sam file must be supplied."); + throw new ReviewedStingException( "Header for output sam file must be supplied."); SAMFileReader reader = new SAMFileReader( samFile ); reader.setValidationStringency( validationStringency ); diff --git a/java/src/org/broadinstitute/sting/utils/text/TextFormattingUtils.java b/java/src/org/broadinstitute/sting/utils/text/TextFormattingUtils.java index 93cece9cd..803d6ac0f 100644 --- a/java/src/org/broadinstitute/sting/utils/text/TextFormattingUtils.java +++ b/java/src/org/broadinstitute/sting/utils/text/TextFormattingUtils.java @@ -26,7 +26,7 @@ package org.broadinstitute.sting.utils.text; import org.apache.log4j.Logger; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import java.util.*; import java.util.regex.Pattern; @@ -110,7 +110,7 @@ public class TextFormattingUtils { bundle = new PropertyResourceBundle(new StringReader("")); } catch(IOException ioe) { - throw new GATKException("No resource bundle found, and unable to create an empty placeholder.",ioe); + throw new ReviewedStingException("No resource bundle found, and unable to create an empty placeholder.",ioe); } } return bundle; diff --git a/java/src/org/broadinstitute/sting/utils/wiggle/WiggleWriter.java b/java/src/org/broadinstitute/sting/utils/wiggle/WiggleWriter.java index 3c47d5a8b..ab91d0e2e 100755 --- a/java/src/org/broadinstitute/sting/utils/wiggle/WiggleWriter.java +++ b/java/src/org/broadinstitute/sting/utils/wiggle/WiggleWriter.java @@ -1,6 +1,6 @@ package org.broadinstitute.sting.utils.wiggle; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import org.broadinstitute.sting.utils.GenomeLoc; import org.broadinstitute.sting.utils.exceptions.UserException; @@ -76,7 +76,7 @@ public class WiggleWriter { write(wWriter,String.format("%d\t%s",loc.getStart(),dataPoint.toString())); } else { // todo -- maybe allow this to open a new file for the new chromosome? - throw new GATKException("Attempting to write multiple contigs into wiggle file, first contig was "+firstLoc.getContig()+" most recent "+loc.getContig()); + throw new ReviewedStingException("Attempting to write multiple contigs into wiggle file, first contig was "+firstLoc.getContig()+" most recent "+loc.getContig()); } } diff --git a/java/test/org/broadinstitute/sting/BaseTest.java b/java/test/org/broadinstitute/sting/BaseTest.java index 9f9f56676..1da296e42 100755 --- a/java/test/org/broadinstitute/sting/BaseTest.java +++ b/java/test/org/broadinstitute/sting/BaseTest.java @@ -2,7 +2,7 @@ package org.broadinstitute.sting; import org.apache.log4j.*; import org.apache.log4j.spi.LoggingEvent; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import org.junit.*; import java.io.*; @@ -141,13 +141,13 @@ public abstract class BaseTest { try { digest = MessageDigest.getInstance("MD5"); } catch (NoSuchAlgorithmException e) { - throw new GATKException("Unable to find MD5 digest"); + throw new ReviewedStingException("Unable to find MD5 digest"); } InputStream is; try { is = new FileInputStream(file); } catch (FileNotFoundException e) { - throw new GATKException("Unable to open file " + file); + throw new ReviewedStingException("Unable to open file " + file); } byte[] buffer = new byte[8192]; int read; @@ -161,14 +161,14 @@ public abstract class BaseTest { } catch (IOException e) { - throw new GATKException("Unable to process file for MD5", e); + throw new ReviewedStingException("Unable to process file for MD5", e); } finally { try { is.close(); } catch (IOException e) { - throw new GATKException("Unable to close input stream for MD5 calculation", e); + throw new ReviewedStingException("Unable to close input stream for MD5 calculation", e); } } } diff --git a/java/test/org/broadinstitute/sting/WalkerTest.java b/java/test/org/broadinstitute/sting/WalkerTest.java index d82a9d76d..fcd9ac2f0 100755 --- a/java/test/org/broadinstitute/sting/WalkerTest.java +++ b/java/test/org/broadinstitute/sting/WalkerTest.java @@ -28,7 +28,7 @@ package org.broadinstitute.sting; import junit.framework.Assert; import org.broadinstitute.sting.gatk.CommandLineExecutable; import org.broadinstitute.sting.gatk.CommandLineGATK; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import org.broadinstitute.sting.utils.collections.Pair; import org.broadinstitute.sting.utils.Utils; import org.junit.Test; @@ -62,7 +62,7 @@ public class WalkerTest extends BaseTest { if ( ! dir.exists() ) { System.out.printf("##### Creating MD5 db %s%n", MD5_FILE_DB_SUBDIR); if ( ! dir.mkdir() ) { - throw new GATKException("Infrastructure failure: failed to create md5 directory " + MD5_FILE_DB_SUBDIR); + throw new ReviewedStingException("Infrastructure failure: failed to create md5 directory " + MD5_FILE_DB_SUBDIR); } } } @@ -81,7 +81,7 @@ public class WalkerTest extends BaseTest { try { FileUtils.copyFile(resultsFile, dbFile); } catch ( IOException e ) { - throw new GATKException(e.getMessage()); + throw new ReviewedStingException(e.getMessage()); } } else { System.out.printf("##### MD5 file is up to date: %s%n", dbFile.getPath()); @@ -213,7 +213,7 @@ public class WalkerTest extends BaseTest { } public Class getExpectedException() { - if ( ! expectsException() ) throw new GATKException("Tried to get expection for walker test that doesn't expect one"); + if ( ! expectsException() ) throw new ReviewedStingException("Tried to get expection for walker test that doesn't expect one"); return expectedException; } @@ -261,7 +261,7 @@ public class WalkerTest extends BaseTest { fl.deleteOnExit(); return fl; } catch (IOException ex) { - throw new GATKException("Cannot create temp file: " + ex.getMessage(), ex); + throw new ReviewedStingException("Cannot create temp file: " + ex.getMessage(), ex); } } diff --git a/java/test/org/broadinstitute/sting/commandline/ParsingEngineUnitTest.java b/java/test/org/broadinstitute/sting/commandline/ParsingEngineUnitTest.java index c2650aad1..833e6cce4 100755 --- a/java/test/org/broadinstitute/sting/commandline/ParsingEngineUnitTest.java +++ b/java/test/org/broadinstitute/sting/commandline/ParsingEngineUnitTest.java @@ -26,7 +26,7 @@ package org.broadinstitute.sting.commandline; import org.broadinstitute.sting.BaseTest; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import org.junit.Test; import org.junit.Before; import org.junit.Assert; @@ -355,7 +355,7 @@ public class ParsingEngineUnitTest extends BaseTest { parsingEngine.validate(); } - @Test(expected= GATKException.class) + @Test(expected= ReviewedStingException.class) public void duplicateLongNameTest() { parsingEngine.addArgumentSource( DuplicateLongNameProvider.class ); } @@ -368,7 +368,7 @@ public class ParsingEngineUnitTest extends BaseTest { public Integer bar; } - @Test(expected=GATKException.class) + @Test(expected= ReviewedStingException.class) public void duplicateShortNameTest() { parsingEngine.addArgumentSource( DuplicateShortNameProvider.class ); } @@ -593,7 +593,7 @@ public class ParsingEngineUnitTest extends BaseTest { RequiredArgProvider rap = new RequiredArgProvider(); } - @Test(expected=GATKException.class) + @Test(expected= ReviewedStingException.class) public void multipleArgumentCollectionTest() { parsingEngine.addArgumentSource( MultipleArgumentCollectionProvider.class ); } diff --git a/java/test/org/broadinstitute/sting/gatk/datasources/providers/ShardDataProviderUnitTest.java b/java/test/org/broadinstitute/sting/gatk/datasources/providers/ShardDataProviderUnitTest.java index 23decfa06..691849959 100755 --- a/java/test/org/broadinstitute/sting/gatk/datasources/providers/ShardDataProviderUnitTest.java +++ b/java/test/org/broadinstitute/sting/gatk/datasources/providers/ShardDataProviderUnitTest.java @@ -1,6 +1,6 @@ package org.broadinstitute.sting.gatk.datasources.providers; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import org.junit.Before; import org.junit.Assert; import org.junit.Test; @@ -66,7 +66,7 @@ public class ShardDataProviderUnitTest extends BaseTest { /** * Try adding a view which conflicts with some other view that's already been registered. */ - @Test(expected= GATKException.class) + @Test(expected= ReviewedStingException.class) public void testAddViewWithExistingConflict() { View initial = new ConflictingTestView( provider ); View conflictsWithInitial = new TestView( provider ); @@ -75,7 +75,7 @@ public class ShardDataProviderUnitTest extends BaseTest { /** * Try adding a view which has a conflict with a previously registered view. */ - @Test(expected=GATKException.class) + @Test(expected= ReviewedStingException.class) public void testAddViewWithNewConflict() { View conflictsWithInitial = new TestView( provider ); View initial = new ConflictingTestView( provider ); diff --git a/java/test/org/broadinstitute/sting/gatk/filters/ReadGroupBlackListFilterUnitTest.java b/java/test/org/broadinstitute/sting/gatk/filters/ReadGroupBlackListFilterUnitTest.java index fb2254e6d..0b86466dd 100644 --- a/java/test/org/broadinstitute/sting/gatk/filters/ReadGroupBlackListFilterUnitTest.java +++ b/java/test/org/broadinstitute/sting/gatk/filters/ReadGroupBlackListFilterUnitTest.java @@ -1,7 +1,7 @@ package org.broadinstitute.sting.gatk.filters; import org.broadinstitute.sting.BaseTest; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import org.broadinstitute.sting.utils.sam.ArtificialSAMUtils; import org.broadinstitute.sting.utils.GenomeLocParser; import org.junit.BeforeClass; @@ -46,18 +46,18 @@ public class ReadGroupBlackListFilterUnitTest extends BaseTest { GenomeLocParser.setupRefContigOrdering(header.getSequenceDictionary()); } - @Test(expected = GATKException.class) + @Test(expected = ReviewedStingException.class) public void testBadFilter() { List badFilters = Collections.singletonList("bad"); new ReadGroupBlackListFilter(badFilters); } - @Test(expected = GATKException.class) + @Test(expected = ReviewedStingException.class) public void testBadFilterTag() { List badFilters = Collections.singletonList("bad:filter"); new ReadGroupBlackListFilter(badFilters); } - @Test(expected = GATKException.class) + @Test(expected = ReviewedStingException.class) public void testBadFilterFile() { List badFilters = Collections.singletonList("/foo/bar/rgbl.txt"); new ReadGroupBlackListFilter(badFilters); diff --git a/java/test/org/broadinstitute/sting/gatk/refdata/tracks/RMDTrackManagerUnitTest.java b/java/test/org/broadinstitute/sting/gatk/refdata/tracks/RMDTrackManagerUnitTest.java index 98807fba0..8e81d83f0 100644 --- a/java/test/org/broadinstitute/sting/gatk/refdata/tracks/RMDTrackManagerUnitTest.java +++ b/java/test/org/broadinstitute/sting/gatk/refdata/tracks/RMDTrackManagerUnitTest.java @@ -27,7 +27,7 @@ import net.sf.samtools.SAMSequenceRecord; import net.sf.picard.reference.IndexedFastaSequenceFile; import org.broadinstitute.sting.BaseTest; import org.broadinstitute.sting.gatk.refdata.utils.GATKFeature; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import org.broadinstitute.sting.utils.GenomeLocParser; import org.junit.Assert; import org.junit.Before; @@ -72,7 +72,7 @@ public class RMDTrackManagerUnitTest extends BaseTest { try { fIter = ((TribbleTrack) t).query("1", 1, 5000); } catch (IOException e) { - throw new GATKException("blah I/O exception"); + throw new ReviewedStingException("blah I/O exception"); } while (fIter.hasNext()) { fIter.next(); @@ -123,7 +123,7 @@ public class RMDTrackManagerUnitTest extends BaseTest { try { fIter = ((TribbleTrack) t).query("1", x, x + intervalSize); } catch (IOException e) { - throw new GATKException("blah I/O exception"); + throw new ReviewedStingException("blah I/O exception"); } while (fIter.hasNext()) { fIter.next(); diff --git a/java/test/org/broadinstitute/sting/utils/GenomeLocParserUnitTest.java b/java/test/org/broadinstitute/sting/utils/GenomeLocParserUnitTest.java index 46b2ed6f2..293c37cdd 100644 --- a/java/test/org/broadinstitute/sting/utils/GenomeLocParserUnitTest.java +++ b/java/test/org/broadinstitute/sting/utils/GenomeLocParserUnitTest.java @@ -3,7 +3,7 @@ package org.broadinstitute.sting.utils; import net.sf.samtools.SAMFileHeader; import org.broadinstitute.sting.BaseTest; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import org.broadinstitute.sting.utils.sam.ArtificialSAMUtils; import static org.junit.Assert.assertEquals; @@ -20,7 +20,7 @@ import org.junit.Test; * Test out the functionality of the new genome loc parser */ public class GenomeLocParserUnitTest extends BaseTest { - @Test(expected = GATKException.class) + @Test(expected = ReviewedStingException.class) public void testUnsetupException() { GenomeLocParser.contigInfo = null; GenomeLocParser.createGenomeLoc(0, 0, 0); @@ -66,7 +66,7 @@ public class GenomeLocParserUnitTest extends BaseTest { assertEquals("chr1".compareTo(GenomeLocParser.getContigInfo("chr1").getSequenceName()), 0); // should be in the reference } - @Test(expected = GATKException.class) + @Test(expected = ReviewedStingException.class) public void testParseBadString() { GenomeLocParser.parseGenomeLoc("Bad:0-1"); } @@ -144,7 +144,7 @@ public class GenomeLocParserUnitTest extends BaseTest { assertEquals(1, loc.getStart()); } - @Test(expected = GATKException.class) + @Test(expected = ReviewedStingException.class) public void testGenomeLocParseOnlyBadChrome() { GenomeLoc loc = GenomeLocParser.parseGenomeLoc("chr12"); assertEquals(0, loc.getContigIndex()); @@ -152,7 +152,7 @@ public class GenomeLocParserUnitTest extends BaseTest { assertEquals(1, loc.getStart()); } - @Test(expected = GATKException.class) + @Test(expected = ReviewedStingException.class) public void testGenomeLocBad() { GenomeLoc loc = GenomeLocParser.parseGenomeLoc("chr1:1-"); assertEquals(0, loc.getContigIndex()); @@ -160,7 +160,7 @@ public class GenomeLocParserUnitTest extends BaseTest { assertEquals(1, loc.getStart()); } - @Test(expected = GATKException.class) + @Test(expected = ReviewedStingException.class) public void testGenomeLocBad2() { GenomeLoc loc = GenomeLocParser.parseGenomeLoc("chr1:1-500-0"); assertEquals(0, loc.getContigIndex()); @@ -168,7 +168,7 @@ public class GenomeLocParserUnitTest extends BaseTest { assertEquals(1, loc.getStart()); } - @Test(expected = GATKException.class) + @Test(expected = ReviewedStingException.class) public void testGenomeLocBad3() { GenomeLoc loc = GenomeLocParser.parseGenomeLoc("chr1:1--0"); assertEquals(0, loc.getContigIndex()); diff --git a/java/test/org/broadinstitute/sting/utils/GenomeLocSortedSetUnitTest.java b/java/test/org/broadinstitute/sting/utils/GenomeLocSortedSetUnitTest.java index bbb11fc86..f722e1a42 100755 --- a/java/test/org/broadinstitute/sting/utils/GenomeLocSortedSetUnitTest.java +++ b/java/test/org/broadinstitute/sting/utils/GenomeLocSortedSetUnitTest.java @@ -2,7 +2,7 @@ package org.broadinstitute.sting.utils; import net.sf.samtools.SAMFileHeader; import org.broadinstitute.sting.BaseTest; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import org.broadinstitute.sting.utils.sam.ArtificialSAMUtils; import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertEquals; @@ -81,7 +81,7 @@ public class GenomeLocSortedSetUnitTest extends BaseTest { } - @Test(expected = GATKException.class) + @Test(expected = ReviewedStingException.class) public void testAddDupplicate() { assertTrue(mSortedSet.size() == 0); GenomeLoc g = GenomeLocParser.createGenomeLoc(1, 0, 0); diff --git a/java/test/org/broadinstitute/sting/utils/PathUtilsUnitTest.java b/java/test/org/broadinstitute/sting/utils/PathUtilsUnitTest.java index f54944a05..88eea4604 100755 --- a/java/test/org/broadinstitute/sting/utils/PathUtilsUnitTest.java +++ b/java/test/org/broadinstitute/sting/utils/PathUtilsUnitTest.java @@ -1,7 +1,7 @@ package org.broadinstitute.sting.utils; import org.broadinstitute.sting.BaseTest; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import org.junit.BeforeClass; import org.junit.Test; import org.junit.Assert; @@ -28,7 +28,7 @@ public class PathUtilsUnitTest extends BaseTest { try { PathUtils.refreshVolume(new File(filename)); - } catch (GATKException e) { + } catch (ReviewedStingException e) { result = false; } diff --git a/java/test/org/broadinstitute/sting/utils/genotype/vcf/VCFWriterUnitTest.java b/java/test/org/broadinstitute/sting/utils/genotype/vcf/VCFWriterUnitTest.java index e22b5d18a..ab01ae5fc 100644 --- a/java/test/org/broadinstitute/sting/utils/genotype/vcf/VCFWriterUnitTest.java +++ b/java/test/org/broadinstitute/sting/utils/genotype/vcf/VCFWriterUnitTest.java @@ -7,7 +7,7 @@ import org.broad.tribble.util.variantcontext.VariantContext; import org.broad.tribble.vcf.*; import org.broadinstitute.sting.BaseTest; import org.broadinstitute.sting.gatk.refdata.tracks.builders.TribbleRMDTrackBuilder; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import org.broadinstitute.sting.utils.GenomeLoc; import org.broadinstitute.sting.utils.GenomeLocParser; import org.junit.Assert; @@ -58,7 +58,7 @@ public class VCFWriterUnitTest extends BaseTest { headerFromFile = (VCFHeader)reader.readHeader(lineReader); } catch (FileNotFoundException e ) { - throw new GATKException(e.getMessage()); + throw new ReviewedStingException(e.getMessage()); } int counter = 0; @@ -80,7 +80,7 @@ public class VCFWriterUnitTest extends BaseTest { fakeVCFFile.delete(); } catch (IOException e ) { - throw new GATKException(e.getMessage()); + throw new ReviewedStingException(e.getMessage()); } } diff --git a/java/test/org/broadinstitute/sting/utils/interval/IntervalFileMergingIteratorUnitTest.java b/java/test/org/broadinstitute/sting/utils/interval/IntervalFileMergingIteratorUnitTest.java index 9f94659f6..8c2bfa224 100644 --- a/java/test/org/broadinstitute/sting/utils/interval/IntervalFileMergingIteratorUnitTest.java +++ b/java/test/org/broadinstitute/sting/utils/interval/IntervalFileMergingIteratorUnitTest.java @@ -25,7 +25,7 @@ package org.broadinstitute.sting.utils.interval; -import org.broadinstitute.sting.utils.exceptions.GATKException; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import org.junit.BeforeClass; import org.junit.Test; import org.junit.Assert; @@ -101,7 +101,7 @@ public class IntervalFileMergingIteratorUnitTest extends BaseTest { GenomeLoc l_expected = check_it.next(); // System.out.println("int: "+l+" expected: "+l_expected) ; } - } catch ( GATKException e) { + } catch ( ReviewedStingException e) { Assert.assertEquals( e.getMessage(), "Interval chr5:7414 in the interval file is out of order."); } }