Search in sources :

Example 1 with OutputPortCloseable

use of cc.redberry.pipe.OutputPortCloseable in project mixcr by milaboratory.

the class RunMiXCR method assemble.

public static AssembleResult assemble(final AlignResult align, boolean close) {
    CloneAssembler assembler = null;
    try {
        RunMiXCRAnalysis parameters = align.parameters;
        assembler = new CloneAssembler(parameters.cloneAssemblerParameters, false, align.usedGenes, align.parameters.alignerParameters);
        CloneAssemblerReport report = new CloneAssemblerReport();
        assembler.setListener(report);
        CloneAssemblerRunner assemblerRunner = new CloneAssemblerRunner(new AlignmentsProvider() {

            @Override
            public OutputPortCloseable<VDJCAlignments> create() {
                return opCloseable(CUtils.asOutputPort(align.alignments));
            }

            @Override
            public long getTotalNumberOfReads() {
                return align.alignments.size();
            }
        }, assembler, parameters.threads);
        // start progress reporting
        SmartProgressReporter.startProgressReport(assemblerRunner);
        assemblerRunner.run();
        CloneSet cloneSet = assemblerRunner.getCloneSet(align.parameters.alignerParameters);
        return new AssembleResult(cloneSet, report, assembler);
    } finally {
        if (close)
            assembler.close();
    }
}
Also used : CloneSet(com.milaboratory.mixcr.basictypes.CloneSet) CloneAssemblerReport(com.milaboratory.mixcr.cli.CloneAssemblerReport) OutputPortCloseable(cc.redberry.pipe.OutputPortCloseable)

Aggregations

OutputPortCloseable (cc.redberry.pipe.OutputPortCloseable)1 CloneSet (com.milaboratory.mixcr.basictypes.CloneSet)1 CloneAssemblerReport (com.milaboratory.mixcr.cli.CloneAssemblerReport)1