Class BAMFileWriter

    • Constructor Detail

      • BAMFileWriter

        protected BAMFileWriter​(File path)
      • BAMFileWriter

        protected BAMFileWriter​(File path,
                                int compressionLevel)
      • BAMFileWriter

        protected BAMFileWriter​(OutputStream os,
                                File file,
                                int compressionLevel)
    • Method Detail

      • writeAlignment

        protected void writeAlignment​(SAMRecord alignment)
        Description copied from class: SAMFileWriterImpl
        Writes the record to disk. Sort order has been taken care of by the time this method is called. The record must hava a non-null SAMFileHeader.
        Specified by:
        writeAlignment in class SAMFileWriterImpl
      • writeHeader

        protected void writeHeader​(String textHeader)
        Description copied from class: SAMFileWriterImpl
        Write the header to disk. Header object is available via getHeader().
        Specified by:
        writeHeader in class SAMFileWriterImpl
        Parameters:
        textHeader - for convenience if the implementation needs it.
      • getFilename

        protected String getFilename()
        Description copied from class: SAMFileWriterImpl
        For producing error messages.
        Specified by:
        getFilename in class SAMFileWriterImpl
        Returns:
        absolute path in URI format, or null if this writer does not correspond to a file. To get a Path from this, use: IOUtil.getPath(getFilename())
      • writeHeader

        protected static void writeHeader​(BinaryCodec outputBinaryCodec,
                                          SAMFileHeader samFileHeader,
                                          String headerText)
        Writes a header to a BAM file. samFileHeader and headerText are redundant - one can be used to regenerate the other but in some instances we already have both so this allows us to save some cycles
      • writeHeader

        protected static void writeHeader​(BinaryCodec outputBinaryCodec,
                                          SAMFileHeader samFileHeader)
        Writes a header to a BAM file.
      • writeHeader

        public static void writeHeader​(OutputStream outputStream,
                                       SAMFileHeader samFileHeader)
        Write a BAM file header to an output stream in block compressed BAM format.
        Parameters:
        outputStream - the stream to write the BAM header to
        samFileHeader - the header to write