Package picard

Examples of picard.PicardException


        final long[] errorsByGc = new long[101];

        final SAMFileReader sam = new SAMFileReader(INPUT);

        if (!ASSUME_SORTED && sam.getFileHeader().getSortOrder() != SAMFileHeader.SortOrder.coordinate) {
            throw new PicardException("Header of input file " + INPUT.getAbsolutePath() + " indicates that it is not coordinate sorted.  " +
            "If you believe the records are in coordinate order, pass option ASSUME_SORTED=true.  If not, sort the file with SortSam.");
        }
        final PeekableIterator<SAMRecord> iterator = new PeekableIterator<SAMRecord>(sam.iterator());
        final ReferenceSequenceFile referenceFile = ReferenceSequenceFileFactory.getReferenceSequenceFile(REFERENCE_SEQUENCE);
View Full Code Here


        if (filesMatchingRegexp == null || filesMatchingRegexp.length == 0) {
            dataFile = null;
        } else if (filesMatchingRegexp.length == 1) {
            dataFile = filesMatchingRegexp[0];
        } else {
            throw new PicardException("More than one filter file found in " + base.getAbsolutePath());
        }
    }
View Full Code Here

            if (filesMatchingRegexp == null || filesMatchingRegexp.length == 0) {
                dataFile = null;
            } else if (filesMatchingRegexp.length == 1) {
                dataFile = filesMatchingRegexp[0];
            } else {
                throw new PicardException("More than one filter file found in " + base.getAbsolutePath());
            }
        } catch (final IOException e) {
            return Collections.singletonList("Could not create tile index file: " + bci.getAbsolutePath());
        }
        return tileIndex.verify(expectedTiles);
View Full Code Here

                    String.valueOf( Histogram_WIDTH ) ); //Histogram_WIDTH is passed because R automatically sets Histogram width to the last
                                                         //bin that has data, which may be less than Histogram_WIDTH and confuse the user.
            }

            if (rResult != 0) {
                throw new PicardException("R script " + Histogram_R_SCRIPT + " failed with return code " + rResult);
            }
        }
    }
View Full Code Here

     * @param expectedTiles  A list of tiles that should be in this map
     * @param expectedCycles The total number of files(cycles) that should be in each CycledFilesIterator
     */
    public void assertValid(final List<Integer> expectedTiles, final int[] expectedCycles) {
        if (size() != expectedCycles.length) {
            throw new PicardException("Expected CycledIlluminaFileMap to contain " + expectedCycles.length + " cycles but only " + size() + " were found!");
        }
        if (this.firstEntry().getValue().size() != expectedTiles.size()) {
            throw new PicardException("Expected CycledIlluminaFileMap to contain " + expectedTiles.size()
                    + " tiles but only " + this.firstEntry().getValue().size() + " were found!");
        }
    }
View Full Code Here

            if (sort != SortOrder.coordinate) {
                if (assumeSorted) {
                    log.warn("File reports sort order '" + sort + "', assuming it's coordinate sorted anyway.");
                }
                else {
                    throw new PicardException("File " + input.getAbsolutePath() + " should be coordinate sorted but " +
                                              "the header says the sort order is " + sort + ". If you believe the file " +
                                              "to be coordinate sorted you may pass ASSUME_SORTED=true");
                }
            }
        }
View Full Code Here

     */
    synchronized public int write(final byte[] bytes, final int start, final int size) {
        if (closed) throw new IllegalStateException("Cannot write to closed buffer.");

        try { if (this.bytesAvailableToWrite == 0) wait(); }
        catch (final InterruptedException ie) {throw new PicardException("Interrupted while waiting to write to fifo.", ie); }

        final int writePos      = this.nextWritePos;
        final int distanceToEnd = this.capacity - writePos;
        final int available     = distanceToEnd < this.bytesAvailableToWrite ? distanceToEnd : this.bytesAvailableToWrite;
        final int length        = available < size ? available : size;
View Full Code Here

     *
     * @return the number of bytes read from the buffer and copied into the input array
     */
    synchronized public int read(final byte[] bytes, final int start, final int size) {
        try { if (this.bytesAvailableToRead == 0 && !closed) wait(); }
        catch (final InterruptedException ie) {throw new PicardException("Interrupted while waiting to read from fifo.", ie); }

        final int readPos       = this.nextReadPos;
        final int distanceToEnd = this.capacity - readPos;
        final int available     = distanceToEnd < this.bytesAvailableToRead ? distanceToEnd : this.bytesAvailableToRead;
        final int length        = available < size ? available : size;
View Full Code Here

    @Override
    public void seekToTile(final int oneBasedTileNumber) {
        while (tileIndexIterator.hasNext()) {
            final TileIndex.TileIndexRecord next = tileIndexIterator.next();
            if (next.tile > oneBasedTileNumber) {
                throw new PicardException(
                        String.format("Cannot seek backwards: next tile %d > tile sought %d", next.tile, oneBasedTileNumber));
            } else if (next.tile == oneBasedTileNumber) {
                currentTile = next;
                break;
            }
        }
        if (nextRecordIndex > currentTile.indexOfFirstClusterInTile) {
            throw new PicardException(
                    String.format("Seem to be in wrong position %d > %d", nextRecordIndex, currentTile.indexOfFirstClusterInTile));
        }
        skipRecords(currentTile.indexOfFirstClusterInTile - nextRecordIndex);
        nextRecordIndex = currentTile.indexOfFirstClusterInTile;
        nextClusterInTile = 0;
View Full Code Here

    }

    @Override
    public void verifyData(final List<Integer> tiles, final int[] cycles) {
        final List<String> tileErrors = tileIndex.verify(tiles);
        if (!tileErrors.isEmpty()) throw new PicardException(tileErrors.get(0));
        //No need to validate cycles until such time as this class is used for cycle-oriented data types
    }
View Full Code Here

TOP

Related Classes of picard.PicardException

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.