use of com.milaboratory.mixcr.info.AlignmentInfoCollector in project mixcr by milaboratory.
the class ActionAlignmentsStat method go.
@Override
public void go(ActionHelper helper) throws Exception {
long[] geneFeatureCounters = new long[targetFeatures.length];
AlignmentInfoCollector[] collectors = new AlignmentInfoCollector[targetFeatures.length + targetReferencePoints.length];
int i = 0;
for (GeneFeature targetFeature : targetFeatures) collectors[i++] = new GeneFeatureCoverageCollector(targetFeature);
for (ReferencePoint targetReferencePoint : targetReferencePoints) collectors[i++] = new ReferencePointCoverageCollector(targetReferencePoint, 40, 40);
final Collector collector = new Collector(collectors);
try (VDJCAlignmentsReader reader = new VDJCAlignmentsReader(actionParameters.getInputFileName());
PrintStream output = actionParameters.getOutputFileName().equals("-") ? System.out : new PrintStream(new BufferedOutputStream(new FileOutputStream(actionParameters.getOutputFileName()), 32768))) {
SmartProgressReporter.startProgressReport("Analysis", reader);
CUtils.processAllInParallel(reader, collector, Math.min(4, Runtime.getRuntime().availableProcessors()));
collector.end();
if (output == System.out)
output.println();
collector.write(output);
}
}
Aggregations