Examples of UnsignedIntPackedOutputStream


Examples of org.broadinstitute.gatk.engine.alignment.reference.packing.UnsignedIntPackedOutputStream

    /**
     * Write a BWT to the output stream.
     * @param bwt Transform to be written to the output stream.
     */
    public void write( BWT bwt ) {
        UnsignedIntPackedOutputStream intPackedOutputStream = new UnsignedIntPackedOutputStream(outputStream, ByteOrder.LITTLE_ENDIAN);
        BasePackedOutputStream basePackedOutputStream = new BasePackedOutputStream<Integer>(Integer.class, outputStream, ByteOrder.LITTLE_ENDIAN);

        try {
            intPackedOutputStream.write(bwt.inverseSA0);
            intPackedOutputStream.write(bwt.counts.toArray(true));

            for( SequenceBlock block: bwt.sequenceBlocks ) {
                intPackedOutputStream.write(block.occurrences.toArray(false));
                basePackedOutputStream.write(block.sequence);
            }

            // The last block is the last set of counts in the structure.
            intPackedOutputStream.write(bwt.counts.toArray(false));
        }
        catch( IOException ex ) {
            throw new ReviewedGATKException("Unable to read BWT from input stream.", ex);
        }
    }
View Full Code Here

Examples of org.broadinstitute.gatk.engine.alignment.reference.packing.UnsignedIntPackedOutputStream

    /**
     * Write a suffix array to the output stream.
     * @param suffixArray suffix array to write.
     */
    public void write(SuffixArray suffixArray) {
        UnsignedIntPackedOutputStream uintPackedOutputStream = new UnsignedIntPackedOutputStream(outputStream, ByteOrder.LITTLE_ENDIAN);

        try {
            uintPackedOutputStream.write(suffixArray.inverseSA0);
            uintPackedOutputStream.write(suffixArray.occurrences.toArray(true));
            // How frequently the suffix array entry is placed.
            uintPackedOutputStream.write(1);
            // Length of the suffix array.
            uintPackedOutputStream.write(suffixArray.length()-1);
            uintPackedOutputStream.write(suffixArray.sequence,1,suffixArray.sequence.length-1);
        }
        catch( IOException ex ) {
            throw new ReviewedGATKException("Unable to read BWT from input stream.", ex);
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.