Package org.broadinstitute.gatk.engine.alignment.reference.packing

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


     * Read a BWT from the input stream.
     * @return The BWT stored in the input stream.
     */
    public BWT read() {
        UnsignedIntPackedInputStream uintPackedInputStream = new UnsignedIntPackedInputStream(inputStream, ByteOrder.LITTLE_ENDIAN);
        BasePackedInputStream basePackedInputStream = new BasePackedInputStream<Integer>(Integer.class, inputStream, ByteOrder.LITTLE_ENDIAN);

        long inverseSA0;
        long[] count;
        SequenceBlock[] sequenceBlocks;

        try {
            inverseSA0 = uintPackedInputStream.read();
            count = new long[PackUtils.ALPHABET_SIZE];
            uintPackedInputStream.read(count);

            long bwtSize = count[PackUtils.ALPHABET_SIZE-1];
            sequenceBlocks = new SequenceBlock[PackUtils.numberOfPartitions(bwtSize,BWT.SEQUENCE_BLOCK_SIZE)];
           
            for( int block = 0; block < sequenceBlocks.length; block++ ) {
                int sequenceStart = block* BWT.SEQUENCE_BLOCK_SIZE;
                int sequenceLength = (int)Math.min(BWT.SEQUENCE_BLOCK_SIZE,bwtSize-sequenceStart);

                long[] occurrences = new long[PackUtils.ALPHABET_SIZE];
                byte[] bwt = new byte[sequenceLength];

                uintPackedInputStream.read(occurrences);
                basePackedInputStream.read(bwt);

                sequenceBlocks[block] = new SequenceBlock(sequenceStart,sequenceLength,new Counts(occurrences,false),bwt);
            }
        }
        catch( IOException ex ) {
View Full Code Here

TOP

Related Classes of org.broadinstitute.gatk.engine.alignment.reference.packing.BasePackedInputStream

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.