Final step in error refactoring. GATK exception is now ReviewedStingException, indicating that this exception is really what one wants. Only use this exception when you have thought about StingException vs. UserException and made a real decision.

git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@4267 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
depristo 2010-09-12 15:07:38 +00:00
parent 7ad8fbdd5a
commit 7880863eb7
160 changed files with 525 additions and 525 deletions

View File

@ -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);
}
}

View File

@ -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)

View File

@ -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<Integer,Integer> {
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;

View File

@ -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));
}
}
}

View File

@ -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);
}

View File

@ -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() )

View File

@ -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<AlignmentMatchSequenceEntry>();
@ -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.");
}
}

View File

@ -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();

View File

@ -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);

View File

@ -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);
}
}
}

View File

@ -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);
}
}
}

View File

@ -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<Byte>
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));
}
/**

View File

@ -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<Byte,Long>(counts);
other.cumulativeCounts = new HashMap<Byte,Long>(cumulativeCounts);

View File

@ -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)));
}
}

View File

@ -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);
}

View File

@ -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);
}
}
}

View File

@ -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);
}
}
}

View File

@ -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<T> {
public BasePackedInputStream( Class<T> 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();

View File

@ -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<T> {
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());
}
}

View File

@ -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);
}
}

View File

@ -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<ArgumentDefinition> {
*/
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<ArgumentDefinition> mergedDefinitions = new ArrayList<ArgumentDefinition>();

View File

@ -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<ArgumentDefinition> {
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 );
}

View File

@ -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);
}
}

View File

@ -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);
}

View File

@ -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<Object,Object> multiplexedMapping = new HashMap<Object,Object>();
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<Object,Object> multiplexedMapping = new HashMap<Object,Object>();
@ -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<? extends Multiplexer> 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());

View File

@ -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);
}
}
}

View File

@ -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<ArgumentDefinition> 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();

View File

@ -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;
}

View File

@ -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;

View File

@ -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<Walker> {
public static DataSource getWalkerDataSource(Class<? extends Walker> 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<Walker> {
private static Requires getWalkerRequirements(Class<? extends Walker> 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;
}

View File

@ -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);
}
}

View File

@ -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;
}

View File

@ -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];

View File

@ -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<RBP extends ReadBackedPileup> {
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<RBP extends ReadBackedPileup> {
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;

View File

@ -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<JexlVCMatchExp> 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<Allele> alleles = new ArrayList<Allele>();
Map<String, Genotype> genotypes = new TreeMap<String, Genotype>();

View File

@ -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);
}

View File

@ -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()),

View File

@ -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);

View File

@ -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<Class<? extends View>> conflicts = registeredView.getConflictingViews();
for( Class<? extends View> 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<? extends View> 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()));
}

View File

@ -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<BinQueueState> {
// 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.

View File

@ -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<GenomeLoc> 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;
}

View File

@ -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");
}
}

View File

@ -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) {

View File

@ -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<LocationAwareSeekableRODIter
return null;
}
else {
throw new GATKException("Unable to find a ROD iterator for segments of type " + segment.getClass());
throw new ReviewedStingException("Unable to find a ROD iterator for segments of type " + segment.getClass());
}
}
@ -215,7 +215,7 @@ class ReferenceOrderedQueryDataPool extends ResourcePool<FeatureSource, Location
return new SeekableRODIterator(new FeatureToGATKFeatureIterator(resource.iterator(),rod.getName()));
}
} catch (IOException e) {
throw new GATKException("Unable to create iterator for rod named " + rod.getName(),e);
throw new ReviewedStingException("Unable to create iterator for rod named " + rod.getName(),e);
}
}

View File

@ -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;
import org.broadinstitute.sting.utils.GenomeLoc;
import org.broadinstitute.sting.utils.GenomeLocParser;
@ -88,10 +88,10 @@ abstract class ResourcePool <T,I extends Iterator> {
// 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);
}
}

View File

@ -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);

View File

@ -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;
* <p/>
* 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);
}

View File

@ -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;
* <p/>
* 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);
}

View File

@ -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);

View File

@ -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();

View File

@ -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;
}

View File

@ -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);
}
}

View File

@ -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();

View File

@ -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> T getTargetStream( Stub<T> 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<T> storage = outputs.get(stub);
if( storage == null ) {
storage = StorageFactory.createStorage(stub);

View File

@ -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<OutputS
this.outputStream = stub.getOutputStream();
}
else
throw new GATKException("Not enough information to create storage for an OutputStream; need either a file or an existing output stream");
throw new ReviewedStingException("Not enough information to create storage for an OutputStream; need either a file or an existing output stream");
}
public OutputStreamStorage( OutputStreamStub stub, File file ) {

View File

@ -29,7 +29,7 @@ import org.broadinstitute.sting.gatk.io.stubs.Stub;
import org.broadinstitute.sting.gatk.io.stubs.OutputStreamStub;
import org.broadinstitute.sting.gatk.io.stubs.SAMFileWriterStub;
import org.broadinstitute.sting.gatk.io.stubs.VCFWriterStub;
import org.broadinstitute.sting.utils.exceptions.GATKException;
import org.broadinstitute.sting.utils.exceptions.ReviewedStingException;
import java.io.File;
@ -85,7 +85,7 @@ public class StorageFactory {
storage = new VCFWriterStorage(vcfWriterStub);
}
else
throw new GATKException("Unsupported stub type: " + stub.getClass().getName());
throw new ReviewedStingException("Unsupported stub type: " + stub.getClass().getName());
return storage;
}

View File

@ -5,7 +5,7 @@ import org.broad.tribble.vcf.VCFHeader;
import org.broad.tribble.vcf.VCFHeaderLine;
import org.broad.tribble.util.variantcontext.VariantContext;
import org.broad.tribble.vcf.VCFWriter;
import org.broadinstitute.sting.utils.exceptions.GATKException;
import org.broadinstitute.sting.utils.exceptions.ReviewedStingException;
import org.broadinstitute.sting.gatk.io.stubs.VCFWriterStub;
import java.io.*;
@ -48,7 +48,7 @@ public class VCFWriterStorage implements Storage<VCFWriterStorage>, 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);
}

View File

@ -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<SAMFileWriter>, 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<SAMFileWriter>, 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<SAMFileWriter>, 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<SAMFileWriter>, 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;
}

View File

@ -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<SAMRecord> {
}
public void remove() {
throw new GATKException("Unable to remove from a BufferingReadIterator");
throw new ReviewedStingException("Unable to remove from a BufferingReadIterator");
}
/**

View File

@ -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);
}
}

View File

@ -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(); }

View File

@ -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<Pli
try {
plink.initialize(file);
} catch (FileNotFoundException e) {
throw new GATKException("Unable to find file " + file);
throw new ReviewedStingException("Unable to find file " + file);
}
return plink;
}
@ -188,9 +188,9 @@ public class PlinkRod extends BasicReferenceOrderedDatum implements Iterator<Pli
return seqVars;
} catch ( FileNotFoundException e ) {
throw new GATKException("File "+file.getAbsolutePath()+" could not be found. This was checked earlier. Should never happen.",e);
throw new ReviewedStingException("File "+file.getAbsolutePath()+" could not be found. This was checked earlier. Should never happen.",e);
} catch ( IOException e ) {
throw new GATKException("Error reading file "+file.getAbsolutePath()+".",e);
throw new ReviewedStingException("Error reading file "+file.getAbsolutePath()+".",e);
}
}
@ -200,7 +200,7 @@ public class PlinkRod extends BasicReferenceOrderedDatum implements Iterator<Pli
}
if ( plinkFileType != PlinkFileType.STANDARD_PED )
throw new GATKException("Plink file is likely of .raw or recoded format. Please use an uncoded .ped file.");
throw new ReviewedStingException("Plink file is likely of .raw or recoded format. Please use an uncoded .ped file.");
StringTokenizer st = new StringTokenizer(plinkLine, "\t");
int offset = 0;
@ -224,7 +224,7 @@ public class PlinkRod extends BasicReferenceOrderedDatum implements Iterator<Pli
// if the first line is not a comment (what we're used to seeing),
// then it's the raw header (comes from de-binary-ing a .bed file)
if ( !header.startsWith("#") )
throw new GATKException("Plink file is likely of .raw or recoded format. Please use an uncoded .ped file.");
throw new ReviewedStingException("Plink file is likely of .raw or recoded format. Please use an uncoded .ped file.");
plinkFileType = PlinkFileType.STANDARD_PED;
@ -281,7 +281,7 @@ public class PlinkRod extends BasicReferenceOrderedDatum implements Iterator<Pli
try {
reader = new BufferedReader( new FileReader( bimFile ));
} catch ( FileNotFoundException e) {
throw new GATKException("The SNP information file accompanying the binary ped file was not found (the .bim file). "+
throw new ReviewedStingException("The SNP information file accompanying the binary ped file was not found (the .bim file). "+
"Please ensure that it is in the same directory as the .bed and .fam files. The file we "+
"Were looking for was "+bimFile.getAbsolutePath(),e);
}
@ -300,7 +300,7 @@ public class PlinkRod extends BasicReferenceOrderedDatum implements Iterator<Pli
line = reader.readLine();
}
} catch ( IOException e ) {
throw new GATKException("There was an error reading the .bim file "+bimFile.getAbsolutePath(), e);
throw new ReviewedStingException("There was an error reading the .bim file "+bimFile.getAbsolutePath(), e);
}
return variants;
@ -311,7 +311,7 @@ public class PlinkRod extends BasicReferenceOrderedDatum implements Iterator<Pli
try {
reader = new BufferedReader( new FileReader( famFile ));
} catch ( FileNotFoundException e) {
throw new GATKException("The Family information file accompanying the binary ped file was not found (the .fam file). "+
throw new ReviewedStingException("The Family information file accompanying the binary ped file was not found (the .fam file). "+
"Please ensure that it is in the same directory as the .bed and .bim files. The file we "+
"Were looking for was "+famFile.getAbsolutePath(),e);
}
@ -327,7 +327,7 @@ public class PlinkRod extends BasicReferenceOrderedDatum implements Iterator<Pli
}
} while ( line != null );
} catch (IOException e) {
throw new GATKException("There was an error reading the .fam file "+famFile.getAbsolutePath(),e);
throw new ReviewedStingException("There was an error reading the .fam file "+famFile.getAbsolutePath(),e);
}
return sampleNames;
@ -338,7 +338,7 @@ public class PlinkRod extends BasicReferenceOrderedDatum implements Iterator<Pli
try {
inStream = new FileInputStream(bedFile);
} catch (FileNotFoundException e) {
throw new GATKException("The Binary pedigree file file accompanying the family file was not found (the .bed file). "+
throw new ReviewedStingException("The Binary pedigree file file accompanying the family file was not found (the .bed file). "+
"Please ensure that it is in the same directory as the .bim and .fam files. The file we "+
"Were looking for was "+bedFile.getAbsolutePath(),e);
}
@ -378,7 +378,7 @@ public class PlinkRod extends BasicReferenceOrderedDatum implements Iterator<Pli
}
} while ( genotype != -1 );
} catch ( IOException e) {
throw new GATKException("Error reading binary ped file "+bedFile.getAbsolutePath(), e);
throw new ReviewedStingException("Error reading binary ped file "+bedFile.getAbsolutePath(), e);
}
return variants;

View File

@ -25,7 +25,7 @@
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.exceptions.DynamicClassResolutionException;
import org.broadinstitute.sting.utils.exceptions.UserException;
import org.broadinstitute.sting.utils.text.XReadLines;
@ -123,7 +123,7 @@ public class RODRecordIterator<ROD extends ReferenceOrderedDatum> 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

View File

@ -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<GATKFeature> 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<GATKFeature> 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);
}

View File

@ -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<VariantContext> 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

View File

@ -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+")");
}

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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;
}

View File

@ -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<FeatureCodec> 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<FeatureCodec> 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();

View File

@ -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<AnnotationDatum> {
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

View File

@ -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);

View File

@ -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<VariantContext> 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();

View File

@ -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);
}
}
}

View File

@ -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<String> 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));

View File

@ -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<Integer, Integer> {
*/
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)

View File

@ -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());
}
}
}

View File

@ -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<Map<DoCOutputType.Partiti
partition.add(String.format("%s_pl_%s_cn_%s",rg.getSample(),rg.getPlatform(),rg.getSequencingCenter()));
}
} else {
throw new GATKException("Invalid aggregation type sent to getSamplesFromToolKit");
throw new ReviewedStingException("Invalid aggregation type sent to getSamplesFromToolKit");
}
return partition;
@ -289,7 +289,7 @@ public class DepthOfCoverageWalker extends LocusWalker<Map<DoCOutputType.Partiti
getCorrectStream(partition, DoCOutputType.Aggregation.interval, DoCOutputType.FileType.statistics),
partition);
} else {
throw new GATKException("Partition type "+partition.toString()+" had no entries. Please check that your .bam header has all appropriate partition types.");
throw new ReviewedStingException("Partition type "+partition.toString()+" had no entries. Please check that your .bam header has all appropriate partition types.");
}
}
@ -766,7 +766,7 @@ public class DepthOfCoverageWalker extends LocusWalker<Map<DoCOutputType.Partiti
int index = 0;
for ( String s : namesInAg ) {
if ( ! s.equalsIgnoreCase(order.get(index)) ) {
throw new GATKException("IDs are out of order for type "+t+"! Aggregator has different ordering");
throw new ReviewedStingException("IDs are out of order for type "+t+"! Aggregator has different ordering");
}
index++;
}

View File

@ -1,6 +1,6 @@
package org.broadinstitute.sting.gatk.walkers.fasta;
import org.broadinstitute.sting.utils.exceptions.GATKException;
import org.broadinstitute.sting.utils.exceptions.ReviewedStingException;
import java.io.PrintStream;
@ -23,7 +23,7 @@ public class FastaSequence {
}
public void setName(String name) {
if ( printedHeader ) throw new GATKException("Can not set name for FASTA record: header is already printed.");
if ( printedHeader ) throw new ReviewedStingException("Can not set name for FASTA record: header is already printed.");
this.name = name;
}

View File

@ -25,7 +25,7 @@
package org.broadinstitute.sting.gatk.walkers.filters;
import org.broadinstitute.sting.utils.exceptions.GATKException;
import org.broadinstitute.sting.utils.exceptions.ReviewedStingException;
import java.util.*;
@ -80,9 +80,9 @@ public class FiltrationContextWindow {
*/
public FiltrationContext[] getWindow(int elementsToLeft, int elementsToRight) {
if ( elementsToLeft > 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<FiltrationContext> iter = window.listIterator(currentContext - elementsToLeft);

View File

@ -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();

View File

@ -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<String, Genotype>() /* genotypes */,

View File

@ -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<Integer, Integer> {
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);
}

View File

@ -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<Integer,Integer> {
private Map<String,CycleStats[]> 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<String,CycleStats[]>();
cyclesByLibraryMap = new HashMap<String,CycleStats[]>();
cyclesByLaneMapOrig = new HashMap<String,CycleStats[]>();

View File

@ -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<SAMRecord, SAMRecord> {
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!@!@!!");
}
}

View File

@ -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<Integer, ValidationStats
else if( pileup.hasIndelGenotype() )
return pileup.getIndelGenotype();
else
throw new GATKException("Unsupported pileup type: " + pileup);
throw new ReviewedStingException("Unsupported pileup type: " + pileup);
}
}

View File

@ -25,7 +25,7 @@
package org.broadinstitute.sting.gatk.walkers.recalibration;
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.GATKSAMRecord;
import org.broadinstitute.sting.utils.sam.AlignmentUtils;
@ -326,7 +326,7 @@ public class RecalDataManager {
if( attr instanceof String ) {
colorSpace = ((String)attr).getBytes();
} else {
throw new GATKException(String.format("Value encoded by %s in %s isn't a string!", RecalDataManager.COLOR_SPACE_ATTRIBUTE_TAG, read.getReadName()));
throw new ReviewedStingException(String.format("Value encoded by %s in %s isn't a string!", RecalDataManager.COLOR_SPACE_ATTRIBUTE_TAG, read.getReadName()));
}
// Loop over the read and calculate first the inferred bases from the color and then check if it is consistent with the read
@ -373,7 +373,7 @@ public class RecalDataManager {
if( attr instanceof String ) {
colorSpace = ((String)attr).substring(1).getBytes(); // trim off the Sentinel
} else {
throw new GATKException(String.format("Value encoded by %s in %s isn't a string!", RecalDataManager.COLOR_SPACE_ATTRIBUTE_TAG, read.getReadName()));
throw new ReviewedStingException(String.format("Value encoded by %s in %s isn't a string!", RecalDataManager.COLOR_SPACE_ATTRIBUTE_TAG, read.getReadName()));
}
for( byte color : colorSpace ) {
@ -448,7 +448,7 @@ public class RecalDataManager {
colorSpaceQuals = x.getBytes();
SAMUtils.fastqToPhred(colorSpaceQuals);
} else {
throw new GATKException(String.format("Value encoded by %s in %s isn't a string!", RecalDataManager.COLOR_SPACE_QUAL_ATTRIBUTE_TAG, read.getReadName()));
throw new ReviewedStingException(String.format("Value encoded by %s in %s isn't a string!", RecalDataManager.COLOR_SPACE_QUAL_ATTRIBUTE_TAG, read.getReadName()));
}
for( int iii = 1; iii < inconsistency.length - 1; iii++ ) {

View File

@ -7,7 +7,7 @@ import org.broadinstitute.sting.gatk.contexts.AlignmentContext;
import org.broadinstitute.sting.gatk.contexts.ReferenceContext;
import org.broadinstitute.sting.playground.utils.report.tags.Analysis;
import org.broadinstitute.sting.playground.utils.report.tags.DataPoint;
import org.broadinstitute.sting.utils.exceptions.GATKException;
import org.broadinstitute.sting.utils.exceptions.ReviewedStingException;
@Analysis(name = "Count Variants", description = "Counts different classes of variants in the sample")
@ -112,7 +112,7 @@ public class CountVariants extends VariantEvaluator implements StandardEval {
nComplex++;
break;
default:
throw new GATKException("Unexpected VariantContext type " + vc1.getType());
throw new ReviewedStingException("Unexpected VariantContext type " + vc1.getType());
}
for (Genotype g : vc1.getGenotypes().values()) {
@ -130,7 +130,7 @@ public class CountVariants extends VariantEvaluator implements StandardEval {
nHomVar++;
break;
default:
throw new GATKException("BUG: Unexpected genotype type: " + g);
throw new ReviewedStingException("BUG: Unexpected genotype type: " + g);
}
}

View File

@ -8,7 +8,7 @@ import org.broadinstitute.sting.gatk.refdata.*;
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.utils.TableType;
import org.broadinstitute.sting.utils.exceptions.GATKException;
import org.broadinstitute.sting.utils.exceptions.ReviewedStingException;
import org.apache.log4j.Logger;
import org.broadinstitute.sting.utils.exceptions.UserException;
@ -141,7 +141,7 @@ public class GenotypeConcordance extends VariantEvaluator implements StandardEva
} else if ( x == 1 ) {
return String.valueOf(falsePositiveHist[y]);
} else {
throw new GATKException( "Unknown row in " + getName() + ", row = " + x );
throw new ReviewedStingException( "Unknown row in " + getName() + ", row = " + x );
}
}
@ -553,7 +553,7 @@ class SampleSummaryStats implements TableType {
final long[][] stats = sampleStats.concordanceStats.get(sample);
final double[] summary = concordanceSummary.get(sample);
if( stats == null ) { throw new GATKException( "SampleStats and SampleSummaryStats contain different samples! sample = " + sample ); }
if( stats == null ) { throw new ReviewedStingException( "SampleStats and SampleSummaryStats contain different samples! sample = " + sample ); }
long numer, denom;

View File

@ -7,7 +7,7 @@ import org.broadinstitute.sting.gatk.refdata.RefMetaDataTracker;
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.utils.TableType;
import org.broadinstitute.sting.utils.exceptions.GATKException;
import org.broadinstitute.sting.utils.exceptions.ReviewedStingException;
/**
* IF THERE IS NO JAVADOC RIGHT HERE, YELL AT chartl
@ -77,7 +77,7 @@ public class IndelLengthHistogram extends VariantEvaluator {
private int len2index(int len) {
if ( len > limit || len < -limit ) {
throw new GATKException("Indel length exceeds limit of "+limit+" please increase indel limit size");
throw new ReviewedStingException("Indel length exceeds limit of "+limit+" please increase indel limit size");
}
return len + limit;
}
@ -105,7 +105,7 @@ public class IndelLengthHistogram extends VariantEvaluator {
} else if ( vc1.isDeletion() ) {
indelHistogram.update(-vc1.getReference().length());
} else {
throw new GATKException("Indel type that is not insertion or deletion.");
throw new ReviewedStingException("Indel type that is not insertion or deletion.");
}
}

View File

@ -8,7 +8,7 @@ import org.broadinstitute.sting.gatk.contexts.AlignmentContext;
import org.broadinstitute.sting.gatk.contexts.ReferenceContext;
import org.broadinstitute.sting.playground.utils.report.tags.Analysis;
import org.broadinstitute.sting.playground.utils.report.tags.DataPoint;
import org.broadinstitute.sting.utils.exceptions.GATKException;
import org.broadinstitute.sting.utils.exceptions.ReviewedStingException;
import java.util.List;
import java.util.Arrays;
@ -138,7 +138,7 @@ public class MendelianViolationEvaluator extends VariantEvaluator {
label = "KidHomVar_ParentHomRef";
KidHomVar_ParentHomRef++;
} else {
throw new GATKException("BUG: unexpected child genotype class " + childG);
throw new ReviewedStingException("BUG: unexpected child genotype class " + childG);
}
return "MendelViolation=" + label;

View File

@ -8,7 +8,7 @@ import org.broadinstitute.sting.gatk.refdata.RefMetaDataTracker;
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.utils.TableType;
import org.broadinstitute.sting.utils.exceptions.GATKException;
import org.broadinstitute.sting.utils.exceptions.ReviewedStingException;
import java.util.ArrayList;
@ -74,7 +74,7 @@ public class SimpleMetricsByAC extends VariantEvaluator implements StandardEval
case 3: return String.valueOf(nTi + nTv);
case 4: return String.valueOf(ratio(nTi, nTv));
default:
throw new GATKException("Unexpected column " + i);
throw new ReviewedStingException("Unexpected column " + i);
}
}
}

View File

@ -45,7 +45,7 @@ import org.broadinstitute.sting.playground.utils.report.ReportMarshaller;
import org.broadinstitute.sting.playground.utils.report.VE2ReportFactory;
import org.broadinstitute.sting.playground.utils.report.templates.ReportFormat;
import org.broadinstitute.sting.playground.utils.report.utils.Node;
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.Utils;
import org.broadinstitute.sting.commandline.Argument;
@ -558,7 +558,7 @@ public class VariantEvalWalker extends RodWalker<Integer, Integer> {
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<Integer, Integer> {
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());

View File

@ -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++ ) {

View File

@ -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<Integer, Integer> {
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<Integer, Integer> {
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<Integer, Integer> {
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);

View File

@ -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 {

View File

@ -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<Integer,Long> {
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<Integer,Long> {
}
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;

View File

@ -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<MendelianViolation
} else if ( isOppositeHomozygote(varContext) ) {
violation = assessOppositeHomozygote(varContext,tracker,reference,context);
} else {
throw new GATKException("Mendelian violation that is neither deNovo nor opposite homozygote. Should never see this.");
throw new ReviewedStingException("Mendelian violation that is neither deNovo nor opposite homozygote. Should never see this.");
}
} else {
violation = new MendelianViolation(varContext,MendelianViolationType.NONE);
@ -464,7 +464,7 @@ public class MendelianViolationClassifier extends LocusWalker<MendelianViolation
if ( ! trio.isFiltered() ) {
Allele parental = trio.getGenotype(trioStructure.mom).getAllele(0); // guaranteed homozygous
if ( parental.getBases().length < 1 ) {
throw new GATKException("Parental bases have length zero at "+trio.toString());
throw new ReviewedStingException("Parental bases have length zero at "+trio.toString());
}
Map<String,StratifiedAlignmentContext> splitContext = StratifiedAlignmentContext.splitContextBySample(context.getBasePileup());

View File

@ -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]++;
}

View File

@ -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<Integer,Long> {
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)

Some files were not shown because too many files have changed in this diff Show More