Search in sources :

Example 1 with BufferedLineReader

use of htsjdk.samtools.util.BufferedLineReader in project gatk by broadinstitute.

the class ReferenceUtils method loadFastaDictionary.

/**
     * Given an InputStream connected to a fasta dictionary, returns its sequence dictionary
     *
     * Note: does not close the InputStream it's passed
     *
     * @param fastaDictionaryStream InputStream connected to a fasta dictionary
     * @return the SAMSequenceDictionary from the fastaDictionaryStream
     */
public static SAMSequenceDictionary loadFastaDictionary(final InputStream fastaDictionaryStream) {
    // Don't close the reader when we're done, since we don't want to close the client's InputStream for them
    final BufferedLineReader reader = new BufferedLineReader(fastaDictionaryStream);
    final SAMTextHeaderCodec codec = new SAMTextHeaderCodec();
    final SAMFileHeader header = codec.decode(reader, fastaDictionaryStream.toString());
    return header.getSequenceDictionary();
}
Also used : SAMTextHeaderCodec(htsjdk.samtools.SAMTextHeaderCodec) BufferedLineReader(htsjdk.samtools.util.BufferedLineReader) SAMFileHeader(htsjdk.samtools.SAMFileHeader)

Example 2 with BufferedLineReader

use of htsjdk.samtools.util.BufferedLineReader in project gatk by broadinstitute.

the class BasicInputParser method advanceFile.

protected void advanceFile() {
    currentFileName = !fileNames.isEmpty() ? fileNames.remove(0) : null;
    nextLineNumber = 0;
    nextLine = null;
    reader = new BufferedLineReader(inputs.remove(0));
}
Also used : BufferedLineReader(htsjdk.samtools.util.BufferedLineReader)

Aggregations

BufferedLineReader (htsjdk.samtools.util.BufferedLineReader)2 SAMFileHeader (htsjdk.samtools.SAMFileHeader)1 SAMTextHeaderCodec (htsjdk.samtools.SAMTextHeaderCodec)1