public abstract class IterateSortedAlignments<T> extends Object
| Modifier and Type | Field and Description |
|---|---|
protected int[] |
alignmentToGenomeTargetIndices
Maps target indices in alignment to target indices in the genome.
|
protected int |
endPosition |
protected int |
endReferenceIndex |
protected int |
lastRemovedPosition |
int |
maxThreshold
Maximum of half a million bases per position.
|
protected int |
startPosition |
protected int |
startReferenceIndex |
protected boolean |
useWindow
True when the iterator is visiting a window defined by startPosition, endPosition
on startReferenceIndex and endReferenceIndex.
|
| Constructor and Description |
|---|
IterateSortedAlignments() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
checkGenomeMatchAlignment(ConcatSortedAlignmentReader sortedReaders,
RandomAccessSequenceInterface genome) |
RandomAccessSequenceInterface |
getGenome() |
int |
getNumAlignmentEntries() |
CharSequence |
getReferenceId(int targetIndex)
Return the reference sequence id given its index.
|
protected boolean |
isValidOffsetArgument(String offsetArgument) |
boolean |
isWithinStartFlap(int referenceIndex,
int position)
Determine if a position is within the start flap (defined by startFlapLength and the slice start position).
|
void |
iterate(String... basenames)
Iterate through a set of alignments.
|
void |
observeIndel(PositionToBasesMap<T> positionToBases,
int referenceIndex,
int startPosition,
String from,
String to,
int sampleIndex,
int readIndex,
Alignments.AlignmentEntry alignmentEntry)
Implement this call-back method to observe a candidate indel that begins at startPosition.
|
abstract void |
observeReferenceBase(ConcatSortedAlignmentReader sortedReaders,
Alignments.AlignmentEntry alignmentEntry,
PositionToBasesMap<T> positionToBases,
int currentReferenceIndex,
int currentRefPosition,
int currentReadIndex)
Implement this call-back method to observe reference bases.
|
abstract void |
observeVariantBase(ConcatSortedAlignmentReader sortedReaders,
Alignments.AlignmentEntry alignmentEntry,
PositionToBasesMap<T> positionToBases,
Alignments.SequenceVariation var,
char toChar,
char fromChar,
byte toQual,
int currentReferenceIndex,
int currentRefPosition,
int currentReadIndex)
Implement this call-back method to observe variant bases.
|
void |
parseIncludeReferenceArgument(com.martiansoftware.jsap.JSAPResult jsapResult)
Parse the string of reference sequences to process during the iteration.
|
void |
parseIncludeReferenceArgument(String includeReferenceNameCommas)
Parse the string of reference sequences to include the iteration.
|
void |
processNumberOfReferences(int numberOfReferences)
Will be called to let the client know how many references will be processed.
|
abstract void |
processPositions(int referenceIndex,
int intermediatePosition,
T positionBaseInfos) |
void |
setAlignmentProcessorFactory(AlignmentProcessorFactory alignmentProcessorFactory)
Configure the alignment factory used by this class.
|
void |
setAlignmentReaderFactory(AlignmentReaderFactory factory)
Set the factory that should be used when creating alignment readers.
|
void |
setEndPositionArgument(String arg)
Set the end position argument.
|
void |
setMaxThreshold(int maxThreshold)
Set the maximum number of variants that will be analyzed at a given position.
|
void |
setStartFlapLength(int length)
Set the length of the start flap.
|
void |
setStartPositionArgument(String arg)
Set the start position argument.
|
protected int lastRemovedPosition
public int maxThreshold
protected int[] alignmentToGenomeTargetIndices
protected boolean useWindow
protected int startPosition
protected int endPosition
protected int startReferenceIndex
protected int endReferenceIndex
public void setMaxThreshold(int maxThreshold)
maxThreshold - public void setAlignmentProcessorFactory(AlignmentProcessorFactory alignmentProcessorFactory)
alignmentProcessorFactory - what to set the factory to.public void setStartFlapLength(int length)
length - Length of the start flap.public void parseIncludeReferenceArgument(com.martiansoftware.jsap.JSAPResult jsapResult)
jsapResult - The jsapResult available to the mode.public void setStartPositionArgument(String arg)
arg - start position argumentpublic void setAlignmentReaderFactory(AlignmentReaderFactory factory)
factory - alignment reader factory.public void setEndPositionArgument(String arg)
arg - end position argumentpublic void parseIncludeReferenceArgument(String includeReferenceNameCommas)
includeReferenceNameCommas - names of references, separated by commas, to include in the iteration.public int getNumAlignmentEntries()
public boolean isWithinStartFlap(int referenceIndex,
int position)
referenceIndex - Index of the reference sequence for the position.position - Position within the sequence identified by referenceIndexpublic void iterate(String... basenames) throws IOException
basenames - Basenames of the alignments to iterate over.IOException - If an error occured reading the input alignment.protected boolean isValidOffsetArgument(String offsetArgument)
protected void checkGenomeMatchAlignment(ConcatSortedAlignmentReader sortedReaders, RandomAccessSequenceInterface genome)
public abstract void observeReferenceBase(ConcatSortedAlignmentReader sortedReaders, Alignments.AlignmentEntry alignmentEntry, PositionToBasesMap<T> positionToBases, int currentReferenceIndex, int currentRefPosition, int currentReadIndex)
sortedReaders - The concat read that contains the variation.alignmentEntry - The alignment entry that contains the variationpositionToBases - Map keyed by reference position, used to accumulate information for each position.currentReferenceIndex - Index of the reference sequence where the variant occurs.currentRefPosition - Position where the variant occurs in the reference.currentReadIndex - Index in the read where the variant occurs.public abstract void observeVariantBase(ConcatSortedAlignmentReader sortedReaders, Alignments.AlignmentEntry alignmentEntry, PositionToBasesMap<T> positionToBases, Alignments.SequenceVariation var, char toChar, char fromChar, byte toQual, int currentReferenceIndex, int currentRefPosition, int currentReadIndex)
sortedReaders - The concat read that contains the variation.alignmentEntry - The alignment entry that contains the variationpositionToBases - Map keyed by reference position, used to accumulate information for each position.var - The sequence variation from the alignment entry that triggered emiting this observation.toChar - The base character in the readfromChar - The base character in the reference.toQual - The base quality value in the read (if it exists, otherwise 0)currentReferenceIndex - Index of the reference sequence where the variant occurs.currentRefPosition - Position where the variant occurs in the reference.currentReadIndex - Index in the read where the variant occurs.public abstract void processPositions(int referenceIndex,
int intermediatePosition,
T positionBaseInfos)
public void observeIndel(PositionToBasesMap<T> positionToBases, int referenceIndex, int startPosition, String from, String to, int sampleIndex, int readIndex, Alignments.AlignmentEntry alignmentEntry)
positionToBases - map from eir start positions to info about indels whose eir start at the location.referenceIndex - The reference sequence where the indel candidate is observed.startPosition - The position where the indel start, according to pair-wise sequence alignment (before eir calculation)from - from bases (before eir calculation)to - to bases (before eir calculation)sampleIndex - Index of the sample where the indel was observed.readIndex - Index of the base in the read at the left of where the indel is observed.alignmentEntry - public void processNumberOfReferences(int numberOfReferences)
throws IOException
numberOfReferences - The number of references in this alignment.IOException - If an error occcurs.public CharSequence getReferenceId(int targetIndex)
targetIndex - The index of the desired reference sequencepublic RandomAccessSequenceInterface getGenome()
Copyright © 2018 Campagne Laboratory. All rights reserved.