use of cc.redberry.pipe.blocks.FilteringPort in project mixcr by milaboratory.
the class ActionExportAlignments method go0.
@Override
public void go0() throws Exception {
try (VDJCAlignmentsReader reader = new VDJCAlignmentsReader(parameters.getInputFile(), VDJCLibraryRegistry.getDefault());
InfoWriter<VDJCAlignments> writer = new InfoWriter<>(parameters.getOutputFile())) {
SmartProgressReporter.startProgressReport("Exporting alignments", reader, System.err);
writer.attachInfoProviders((List) parameters.exporters);
writer.ensureHeader();
VDJCAlignments alignments;
long count = 0;
long limit = parameters.getLimit();
OutputPort<VDJCAlignments> alignmentsPort = new FilteringPort<>(reader, parameters.getFilter());
while ((alignments = alignmentsPort.take()) != null && count < limit) {
writer.put(alignments);
++count;
}
}
}
Aggregations