Package org.broadinstitute.gatk.utils.exceptions

Examples of org.broadinstitute.gatk.utils.exceptions.ReviewedGATKException


    public ProbabilityVector(double[] vec, boolean compressRange) {

        int maxValIdx = MathUtils.maxElementIndex(vec);
        double maxv = vec[maxValIdx];
        if (maxv > 0.0)
            throw new ReviewedGATKException("BUG: Attempting to create a log-probability vector with positive elements");

        if (compressRange) {
            minVal = getMinIdx(vec, maxValIdx);
            maxVal = getMaxIdx(vec, maxValIdx);
            probabilityArray = Arrays.copyOfRange(vec, minVal, maxVal+1);
View Full Code Here


     */
    public static Object getValue(Annotation annotation, String method) {
        try {
            return annotation.getClass().getMethod(method).invoke(annotation);
        } catch (Exception e) {
            throw new ReviewedGATKException("Unable to access method " + method + " on annotation " + annotation.getClass(), e);
        }
    }
View Full Code Here

                    result += cigarElement.getLength();
                    break;
                case I:
                    break;
                default:
                    throw new ReviewedGATKException("Unsupported cigar operator: " + cigarElement.getOperator());
            }
        }
        return result;
    }
View Full Code Here

     * Create the SAM writer, given the constituent parts accrued.
     * @return Newly minted SAM file writer.
     */
    public SAMFileReader build() {
        if( samFile == null )
            throw new ReviewedGATKException( "Filename for output sam file must be supplied.");
        if( validationStringency == null )
            throw new ReviewedGATKException( "Header for output sam file must be supplied.");

        SAMFileReader reader = new SAMFileReader( samFile );
        reader.setValidationStringency( validationStringency );

        return reader;
View Full Code Here

        for (SAMReaderID readerID : toolkit.getReadsDataSource().getReaderIDs()) {
            for (SAMReadGroupRecord rg : toolkit.getReadsDataSource().getHeader(readerID).getReadGroups()) {
                String sample = rg.getSample();
                if (sampleToWriterMap.containsKey(sample) && sampleToWriterMap.get(sample) != readerID) {
                    throw new ReviewedGATKException("The same sample appears in multiple files, this input cannot be multiplexed using the BySampleSAMFileWriter, try NWaySAMFileWriter instead.");
                }
                else {
                    sampleToWriterMap.put(sample, readerID);
                }
            }
View Full Code Here

     * @param containingObject The containing object.
     * @return An argument type descriptor for the custom derivative field.
     */
    public MultiplexArgumentTypeDescriptor createDependentTypeDescriptor(ParsingEngine parsingEngine,Object containingObject) {
        if(!isDependent())
            throw new ReviewedGATKException("Field " + field.getName() + " is independent; no dependent type descriptor can be derived.");
        return ((MultiplexArgumentTypeDescriptor)typeDescriptor).createCustomTypeDescriptor(parsingEngine,this,containingObject);
    }
View Full Code Here

        for( ArgumentDefinition definition: argumentDefinitionGroup ) {
            // Do some basic validation before adding the definition.
            if( definition.fullName.length() == 0 )
                throw new IllegalArgumentException( "Argument cannot have 0-length fullname." );
            if( hasArgumentDefinition( definition.fullName, FullNameDefinitionMatcher ) )
                throw new ReviewedGATKException("Duplicate definition of argument with full name: " + definition.fullName);
            if( definition.shortName != null && hasArgumentDefinition( definition.shortName, ShortNameDefinitionMatcher ) )
                throw new ReviewedGATKException("Duplicate definition of argument with short name: " + definition.shortName);

            argumentDefinitions.add( definition );
        }

        // Find an existing argument definition group with this name.
View Full Code Here

                }
                case N:
                case H:
                case P:
                default:
                    throw new ReviewedGATKException( "Unsupported cigar operator created during SW alignment: " + ce.getOperator() );
            }
        }

        for ( final VariantContext proposedEvent : proposedEvents )
            addVC(proposedEvent, true);
View Full Code Here

        int stop;

        // Determine the read coordinate to start and stop hard clipping
        if (refStart < 0) {
            if (refStop < 0)
                throw new ReviewedGATKException("Only one of refStart or refStop must be < 0, not both (" + refStart + ", " + refStop + ")");
            start = 0;
            stop = ReadUtils.getReadCoordinateForReferenceCoordinate(read, refStop, ReadUtils.ClippingTail.LEFT_TAIL);
        }
        else {
            if (refStop >= 0)
                throw new ReviewedGATKException("Either refStart or refStop must be < 0 (" + refStart + ", " + refStop + ")");
            start = ReadUtils.getReadCoordinateForReferenceCoordinate(read, refStart, ReadUtils.ClippingTail.RIGHT_TAIL);
            stop = read.getReadLength() - 1;
        }

        if (start < 0 || stop > read.getReadLength() - 1)
            throw new ReviewedGATKException("Trying to clip before the start or after the end of a read");

        if ( start > stop )
            throw new ReviewedGATKException(String.format("START (%d) > (%d) STOP -- this should never happen, please check read: %s (CIGAR: %s)", start, stop, read, read.getCigarString()));

        if ( start > 0 && stop < read.getReadLength() - 1)
            throw new ReviewedGATKException(String.format("Trying to clip the middle of the read: start %d, stop %d, cigar: %s", start, stop, read.getCigarString()));

        this.addOp(new ClippingOp(start, stop));
        GATKSAMRecord clippedRead = clipRead(ClippingRepresentation.HARDCLIP_BASES);
        this.ops = null;
        return clippedRead;
View Full Code Here

            keyGen.initialize(keyLength, randomnessSource);
            return keyGen.generateKeyPair();
        }
        catch ( NoSuchAlgorithmException e ) {
            throw new ReviewedGATKException(String.format("Could not find an implementation of the requested encryption algorithm %s", encryptionAlgorithm), e);
        }
        catch ( Exception e ) {
            throw new ReviewedGATKException("Error while generating key pair", e);
        }
    }
View Full Code Here

TOP

Related Classes of org.broadinstitute.gatk.utils.exceptions.ReviewedGATKException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.