Package org.metagene.genestrip.match
Class FastqKMerMatcher.MatcherReadEntry
java.lang.Object
org.metagene.genestrip.fastq.AbstractFastqReader.ReadEntry
org.metagene.genestrip.match.FastqKMerMatcher.MatcherReadEntry
- Enclosing class:
- FastqKMerMatcher
Per-read working state used during matching: the candidate taxonomic paths and
their counts, the resolved classification node, and a growable byte buffer holding
the read's Kraken-style output.
-
Field Summary
FieldsModifier and TypeFieldDescriptionint[]Single-element scratch array receiving the position of a bad (non-CGAT) base.byte[]Growable byte buffer holding the read's Kraken-style output.intCurrent write position withinbuffer.The resolved classification node for this read, ornullif unclassified.int[]Vote counts associated with the candidate paths.long[]Single-element scratch array holding the store index of the last matched k-mer.The candidate taxonomic path nodes tracked for this read.intNumber of candidate taxonomic paths currently used.Fields inherited from class org.metagene.genestrip.fastq.AbstractFastqReader.ReadEntry
pooled, read, readDescriptor, readDescriptorSize, readNo, readProbs, readProbsSize, readSize -
Constructor Summary
ConstructorsConstructorDescriptionMatcherReadEntry(int maxReadSizeBytes, boolean withProbs, int paths) Creates a read entry with buffers sized for the given number of candidate paths. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidgrowPrintBuffer(int additionalSize) Ensures the output buffer has room for at leastadditionalSizemore bytes, allocating or doubling it as needed.voidprintChar(char c) Appends a single character (as a byte) to the output buffer.voidprintInt(int value) Appends the decimal representation of the given integer to the output buffer.voidAppends the bytes of the given string to the output buffer.voidWrites this read's Kraken-style classification line to the given stream: the classified/unclassified flag, read descriptor, assigned tax id, read length and the buffered per-segment output.Methods inherited from class org.metagene.genestrip.fastq.AbstractFastqReader.ReadEntry
growReadBuffer, write
-
Field Details
-
buffer
public byte[] bufferGrowable byte buffer holding the read's Kraken-style output. -
bufferPos
public int bufferPosCurrent write position withinbuffer. -
badPos
public int[] badPosSingle-element scratch array receiving the position of a bad (non-CGAT) base. -
usedPaths
public int usedPathsNumber of candidate taxonomic paths currently used. -
readTaxIdNode
The candidate taxonomic path nodes tracked for this read. -
counts
public int[] countsVote counts associated with the candidate paths. -
indexPos
public long[] indexPosSingle-element scratch array holding the store index of the last matched k-mer. -
classNode
The resolved classification node for this read, ornullif unclassified.
-
-
Constructor Details
-
MatcherReadEntry
public MatcherReadEntry(int maxReadSizeBytes, boolean withProbs, int paths) Creates a read entry with buffers sized for the given number of candidate paths.- Parameters:
maxReadSizeBytes- the initial read size in byteswithProbs- whether quality/probability information is processedpaths- the maximum number of candidate taxonomic paths
-
-
Method Details
-
printChar
public void printChar(char c) Appends a single character (as a byte) to the output buffer.- Parameters:
c- the character to append
-
printString
Appends the bytes of the given string to the output buffer.- Parameters:
s- the string to append
-
growPrintBuffer
protected void growPrintBuffer(int additionalSize) Ensures the output buffer has room for at leastadditionalSizemore bytes, allocating or doubling it as needed.- Parameters:
additionalSize- the number of additional bytes that must fit
-
printInt
public void printInt(int value) Appends the decimal representation of the given integer to the output buffer.- Parameters:
value- the integer value to append
-
writeMatchDetails
Writes this read's Kraken-style classification line to the given stream: the classified/unclassified flag, read descriptor, assigned tax id, read length and the buffered per-segment output.- Parameters:
out- the stream to write the classification line to- Throws:
IOException- if writing to the stream fails
-