Package org.broadinstitute.gatk.utils.exceptions

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


    private void closeInputStream(final FileInputStream inputStream) {
        try {
            inputStream.close();
        }
        catch(IOException ex) {
            throw new GATKException("Unable to open input file");
        }
    }
View Full Code Here


        File indexFile = Tribble.indexFile(resultFile);
        //System.out.println("Putative index file is " + indexFile);
        if ( indexFile.exists() ) {
            if ( resultFile.getAbsolutePath().contains(".vcf") ) {
                // todo -- currently we only understand VCF files! Blow up since we can't test them
                throw new GATKException("Found an index created for file " + resultFile + " but we can only validate VCF files.  Extend this code!");
            }

            System.out.println("Verifying on-the-fly index " + indexFile + " for test " + name + " using file " + resultFile);
            Index indexFromOutputFile = IndexFactory.createDynamicIndex(resultFile, new VCFCodec());
            Index dynamicIndex = IndexFactory.loadIndex(indexFile.getAbsolutePath());
View Full Code Here

        for (String name : sampleNameList) {
            try {
                samples.add(getSample(name));
            }
            catch (Exception e) {
                throw new GATKException("Could not get sample with the following ID: " + name, e);
            }
        }
        return samples;
    }
View Full Code Here

            }

            return sampleContamination;

        } catch (IOException e) {
            throw new GATKException("I/O Error while reading sample-contamination file " + ContaminationFractionFile.getName() + ": " + e.getMessage());
        }

    }
View Full Code Here

            } else if ( otherGenotypes != null && otherGenotypes.containsSample(sample) ) {
                genotype = otherGenotypes.get(sample);
                isValidation = ! isValidationSite;
            } else {
                // there is magically no genotype for this sample.
                throw new GATKException("Sample "+sample+" arose with no genotype in variant or validation VCF. This should never happen.");
            }

            /*
             * Use likelihoods if: is validation, prior is negative; or: is not validation, has genotype key
             */
 
View Full Code Here

                    vs.setVariantEvalWalker(variantEvalWalker);
                    vs.initialize();

                    strats.add(vs);
                } catch (InstantiationException e) {
                    throw new GATKException("Unable to instantiate stratification module '" + c.getSimpleName() + "'");
                } catch (IllegalAccessException e) {
                    throw new GATKException("Illegal access error when trying to instantiate stratification module '" + c.getSimpleName() + "'");
                }
            }
        }

        return new ArrayList<VariantStratifier>(strats);
View Full Code Here

                        // this is an atomic value, add a column for it
                        final String format = field.getValue().format();
                        table.addColumn(field.getKey().getName(), format);
                    } catch (SecurityException e) {
                        throw new GATKException("SecurityException: " + e);
                    }
                }
            }
        }
View Full Code Here

        super.initialize();    //To change body of overridden methods use File | Settings | File Templates.
        uncachedRef = getToolkit().getReferenceDataSource().getReference();
    }

    private final void throwError(ReferenceContext ref, String message) {
        throw new GATKException(String.format("Site %s failed: %s", ref.getLocus(), message));
    }
View Full Code Here

                        bread.append('-');
                        match.append('D');
                    }
                    break;
                default:
                    throw new GATKException("Unexpected Cigar element:" + e.getOperator());
            }
        }
        for ( ; i < ref.length; i++ ) bref.append((char)ref[i]);
        for ( ; j < read.length; j++ ) bread.append((char)read[j]);
View Full Code Here

        } else if (type instanceof WildcardType) {
            throw new RuntimeException("We don't support wildcards in arguments: " + type);
        } else if (type instanceof Class<?>) {
            return ((Class) type).getSimpleName();
        } else {
            throw new GATKException("Unknown type: " + type);
        }
    }
View Full Code Here

TOP

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

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.