Search in sources :

Example 1 with FilteringPort

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;
        }
    }
}
Also used : InfoWriter(com.milaboratory.mixcr.export.InfoWriter) VDJCAlignmentsReader(com.milaboratory.mixcr.basictypes.VDJCAlignmentsReader) FilteringPort(cc.redberry.pipe.blocks.FilteringPort) VDJCAlignments(com.milaboratory.mixcr.basictypes.VDJCAlignments)

Aggregations

FilteringPort (cc.redberry.pipe.blocks.FilteringPort)1 VDJCAlignments (com.milaboratory.mixcr.basictypes.VDJCAlignments)1 VDJCAlignmentsReader (com.milaboratory.mixcr.basictypes.VDJCAlignmentsReader)1 InfoWriter (com.milaboratory.mixcr.export.InfoWriter)1