Package org.broadinstitute.gatk.utils.exceptions

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


     * @param key    the key representing the dna sequence
     * @return the dna sequence represented by the key
     */
    public static String contextFromKey(final int key) {
        if (key < 0)
            throw new ReviewedGATKException("dna conversion cannot handle negative numbers. Possible overflow?");

        final int length = key & LENGTH_MASK; // the first bits represent the length (in bp) of the context
        int mask = 48; // use the mask to pull out bases
        int offset = LENGTH_BITS;

View Full Code Here


    private PreciseNonNegativeDouble matchHaplotypeScore(Haplotype hap) {
        PreciseNonNegativeDouble score = new PreciseNonNegativeDouble(1.0);

        int sz = this.bases.length;
        if (sz != hap.bases.length)
            throw new ReviewedGATKException("Read and Haplotype should have same length to be compared!");

        // Technically, this HAS NO EFFECT since it is multiplied in for ALL haplotype pairs, but do so for completeness:
        score.timesEqual(mappingProb);

        for (int i = 0; i < sz; i++) {
View Full Code Here

                generalReport = inputReport;
            else
                generalReport.combine(inputReport);
        }
        if (generalReport == null)
            throw new ReviewedGATKException(EMPTY_INPUT_LIST);

        generalReport.calculateQuantizedQualities();

        return generalReport.createGATKReport();
    }
View Full Code Here

    private Haplotype getConsensusHaplotype(final Haplotype haplotypeA, final Haplotype haplotypeB) {
        final byte[] a = haplotypeA.getBases();
        final byte[] b = haplotypeB.getBases();

        if (a.length != b.length) {
            throw new ReviewedGATKException("Haplotypes a and b must be of same length");
        }

        byte chA, chB;
        final byte wc = (byte) REGEXP_WILDCARD;
View Full Code Here

                    break;
                case H:
                case P:
                    break;
                default:
                    throw new ReviewedGATKException("Unsupported cigar operator: " + ce.getOperator());
            }
        }
        return snp;
    }
View Full Code Here

                case N:
                case H:
                case P:
                    break;
                default:
                    throw new ReviewedGATKException("Unsupported cigar operator: " + ce.getOperator());
            }
        }
        return indel;
    }
View Full Code Here

            indel[index] = 1;
    }

    protected static double[] calculateFractionalErrorArray( final int[] errorArray, final byte[] baqArray ) {
        if(errorArray.length != baqArray.length ) {
            throw new ReviewedGATKException("Array length mismatch detected. Malformed read?");
        }

        final int BLOCK_START_UNSET = -1;

        final double[] fractionalErrors = new double[baqArray.length];
        Arrays.fill(fractionalErrors, 0.0);
        boolean inBlock = false;
        int blockStartIndex = BLOCK_START_UNSET;
        int iii;
        for( iii = 0; iii < fractionalErrors.length; iii++ ) {
            if( baqArray[iii] == NO_BAQ_UNCERTAINTY ) {
                if( !inBlock ) {
                    fractionalErrors[iii] = (double) errorArray[iii];
                } else {
                    calculateAndStoreErrorsInBlock(iii, blockStartIndex, errorArray, fractionalErrors);
                    inBlock = false; // reset state variables
                    blockStartIndex = BLOCK_START_UNSET; // reset state variables
                }
            } else {
                inBlock = true;
                if( blockStartIndex == BLOCK_START_UNSET ) { blockStartIndex = iii; }
            }
        }
        if( inBlock ) {
            calculateAndStoreErrorsInBlock(iii-1, blockStartIndex, errorArray, fractionalErrors);
        }
        if( fractionalErrors.length != errorArray.length ) {
            throw new ReviewedGATKException("Output array length mismatch detected. Malformed read?");
        }
        return fractionalErrors;
    }
View Full Code Here

    public Haplotype(BaseArray baseArr) {
        super(baseArr.bases);

        if (baseArr.getNonNullIndices().length != baseArr.bases.length)
            throw new ReviewedGATKException("Should NEVER call Haplotype ctor with null bases!");
    }
View Full Code Here

            throw new ReviewedGATKException("Should NEVER call Haplotype ctor with null bases!");
    }

    public void updateBase(int index, Byte base) {
        if (base == null) {
            throw new ReviewedGATKException("Internal error: CANNOT have null for a missing Haplotype base!");
        }
        super.updateBase(index, base);
    }
View Full Code Here

        final int newPloidy = ploidy1 + ploidy2;

        // sanity check
        int totalAltK = set.getACsum();
        if (newPloidy != totalAltK)
            throw new ReviewedGATKException("BUG: inconsistent sizes of set.getACsum and passed ploidy values");

        totalAltK -= set.getACcounts().getCounts()[0];
        // totalAltK has sum of alt alleles of conformation now

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.