Class CRAMBAIIndexer

    • Constructor Detail

      • CRAMBAIIndexer

        public CRAMBAIIndexer​(OutputStream output,
                              SAMFileHeader fileHeader)
        Create a CRAM indexer that writes BAI to a stream.
        Parameters:
        output - Index will be written here. output will be closed when finish() method is called.
        fileHeader - header for the corresponding bam file.
    • Method Detail

      • processContainer

        public void processContainer​(Container container,
                                     ValidationStringency validationStringency)
        Index a container, any of mapped, unmapped and multiple references are allowed. The only requirement is sort order by coordinate. For multiref containers the method reads the container through unpacking all reads. This is slower than single reference but should be faster than normal reading.
        Specified by:
        processContainer in interface CRAMIndexer
        Parameters:
        container - container to be indexed
        validationStringency - stringency for validating records (used when processing multi-reference slices, since creating an index on a multi-ref slices requires actually decoding the records in order to resove the constituent reference spans}
      • processBAIEntry

        public final void processBAIEntry​(BAIEntry baiEntry)
      • finish

        public void finish()
        After all the slices have been processed, finish is called. Writes any final information and closes the output file.
        Specified by:
        finish in interface CRAMIndexer
      • createIndex

        public static void createIndex​(SeekableStream stream,
                                       File output,
                                       Log log,
                                       ValidationStringency validationStringency)
        Generates a BAI index file from an input CRAM stream
        Parameters:
        stream - CRAM stream to index
        output - File for output index file
        log - optional Log to output progress