use of au.edu.wehi.idsv.debruijn.positional.PositionalAssembler in project gridss by PapenfussLab.
the class AssemblyEvidenceSource method getAllAssemblies_single_threaded.
@SuppressWarnings("unused")
private Iterator<SAMRecord> getAllAssemblies_single_threaded() {
ProgressLogger progressLog = new ProgressLogger(log);
List<Iterator<SAMRecord>> list = new ArrayList<>();
for (BreakendDirection direction : BreakendDirection.values()) {
CloseableIterator<DirectedEvidence> it = mergedIterator(source, false);
Iterator<DirectedEvidence> throttledIt = throttled(it);
ProgressLoggingDirectedEvidenceIterator<DirectedEvidence> loggedIt = new ProgressLoggingDirectedEvidenceIterator<>(getContext(), throttledIt, progressLog);
Iterator<SAMRecord> evidenceIt = new PositionalAssembler(getContext(), this, new SequentialIdGenerator("asm"), loggedIt, direction);
list.add(evidenceIt);
}
return Iterators.concat(list.iterator());
}
use of au.edu.wehi.idsv.debruijn.positional.PositionalAssembler in project gridss by PapenfussLab.
the class AssemblyEvidenceSource method assembleChunk.
private void assembleChunk(SAMFileWriter writer, SAMFileWriter filteredWriter, int chunkNumber, QueryInterval[] intervals, BreakendDirection direction, AssemblyIdGenerator assemblyNameGenerator) {
QueryInterval[] expanded = getExpanded(intervals);
try (CloseableIterator<DirectedEvidence> input = mergedIterator(source, expanded)) {
Iterator<DirectedEvidence> throttledIt = throttled(input);
PositionalAssembler assembler = new PositionalAssembler(getContext(), AssemblyEvidenceSource.this, assemblyNameGenerator, throttledIt, direction);
if (telemetry != null) {
assembler.setTelemetry(telemetry.getTelemetry(chunkNumber, direction));
}
while (assembler.hasNext()) {
SAMRecord asm = assembler.next();
// transform before chunk bounds checking as the position may have moved
asm = transformAssembly(asm);
if (QueryIntervalUtil.overlaps(intervals, asm.getReferenceIndex(), asm.getAlignmentStart())) {
// only output assemblies that start within our chunk
if (shouldFilterAssembly(asm)) {
if (filteredWriter != null) {
filteredWriter.addAlignment(asm);
}
} else {
writer.addAlignment(asm);
}
}
}
}
}
Aggregations