(FastxFilePair[] fastxPairs,
String[] forwardReadPaths,
String[] reverseReadPaths,
FragmentPaths fragPaths,
int bound,
int minOverlap,
int sampleSize,
int numThreads,
int maxErrCorrIterations,
boolean extendFragments,
int minKmerCov,
boolean keepArtifact)
| 4463 | */ |
| 4464 | |
| 4465 | public Quartiles assembleFragmentsMultiThreaded(FastxFilePair[] fastxPairs, |
| 4466 | String[] forwardReadPaths, |
| 4467 | String[] reverseReadPaths, |
| 4468 | FragmentPaths fragPaths, |
| 4469 | int bound, |
| 4470 | int minOverlap, |
| 4471 | int sampleSize, |
| 4472 | int numThreads, |
| 4473 | int maxErrCorrIterations, |
| 4474 | boolean extendFragments, |
| 4475 | int minKmerCov, |
| 4476 | boolean keepArtifact) throws FileFormatException, IOException, InterruptedException { |
| 4477 | |
| 4478 | if (dbgFPR <= 0) { |
| 4479 | dbgFPR = graph.getDbgbf().getFPR(); |
| 4480 | } |
| 4481 | |
| 4482 | if (covFPR <= 0) { |
| 4483 | covFPR = graph.getCbf().getFPR(); |
| 4484 | } |
| 4485 | |
| 4486 | int shortestFragmentLengthAllowed = k; |
| 4487 | int leftReadLengthThreshold = k; |
| 4488 | int rightReadLengthThreshold = k; |
| 4489 | |
| 4490 | boolean assemblePolyaTails = this.minPolyATailLengthRequired > 0; |
| 4491 | |
| 4492 | FastxPairSequenceIterator rin = new FastxPairSequenceIterator(fastxPairs, seqPattern, qualPattern, minAvgBaseQual); |
| 4493 | |
| 4494 | ArrayBlockingQueue<Fragment> fragments = new ArrayBlockingQueue<>(sampleSize); |
| 4495 | |
| 4496 | FragmentAssembler[] workers = new FragmentAssembler[numThreads]; |
| 4497 | Thread[] threads = new Thread[numThreads]; |
| 4498 | for (int i=0; i<numThreads; ++i) { |
| 4499 | workers[i] = new FragmentAssembler(rin, |
| 4500 | fragments, |
| 4501 | bound, |
| 4502 | minOverlap, |
| 4503 | false, // do not store paired kmers |
| 4504 | maxErrCorrIterations, |
| 4505 | leftReadLengthThreshold, |
| 4506 | rightReadLengthThreshold, |
| 4507 | extendFragments, |
| 4508 | minKmerCov, |
| 4509 | keepArtifact |
| 4510 | ); |
| 4511 | threads[i] = new Thread(workers[i]); |
| 4512 | threads[i].start(); |
| 4513 | } |
| 4514 | |
| 4515 | while (true) { |
| 4516 | if (fragments.remainingCapacity() == 0) { |
| 4517 | break; |
| 4518 | } |
| 4519 | |
| 4520 | int numDone = 0; |
| 4521 | for (FragmentAssembler w : workers) { |
| 4522 | if (w.done) { |
no test coverage detected