Skip to content
Permalink
Browse files

Additional fix for empty block.

  • Loading branch information...
dbolotin committed Feb 26, 2019
1 parent 956ed4c commit d9f85bc91a0e35c23414fe35c914189e200b3638
Showing with 16 additions and 6 deletions.
  1. +1 −1 itests.sh
  2. +12 −0 itests/case7.sh
  3. +3 −5 src/main/java/com/milaboratory/mixcr/basictypes/ClnAWriter.java
@@ -48,7 +48,7 @@ case $os in
;;
esac

tests=("case1" "case2" "case3" "case4" "case5" "case6")
tests=("case1" "case2" "case3" "case4" "case5" "case6" "case7")

create_standard_results=false
run_tests=false
@@ -0,0 +1,12 @@
#!/usr/bin/env bash

# Zero unaligned alignments

set -e

gzip -dc CD4M1_test_R1.fastq.gz | head -n 1012 | tail -n 4 >> case7_R1.fastq
gzip -dc CD4M1_test_R2.fastq.gz | head -n 1012 | tail -n 4 >> case7_R2.fastq

mixcr analyze amplicon --receptor-type tra --impute-germline-on-export -s hs \
--starting-material rna --contig-assembly --5-end v-primers --3-end j-primers \
--adapters no-adapters case7_R1.fastq case7_R2.fastq case7
@@ -60,8 +60,8 @@
* writeAlignmentsAndIndex() 5. close()
*/
public final class ClnAWriter implements PipelineConfigurationWriter,
AutoCloseable,
CanReportProgressAndStage {
AutoCloseable,
CanReportProgressAndStage {
static final String MAGIC_V3 = "MiXCR.CLNA.V03";
static final String MAGIC_V4 = "MiXCR.CLNA.V04";
static final String MAGIC = MAGIC_V4;
@@ -294,19 +294,17 @@ public synchronized void writeAlignmentsAndIndex() {
List<VDJCAlignments> block = new ArrayList<>();
// Writing alignments and writing indices
for (VDJCAlignments alignments : CUtils.it(sortedAlignments)) {
boolean blockFlushed = false;

// Block is full
if (block.size() == AlignmentsIO.DEFAULT_ALIGNMENTS_IN_BLOCK) {
writer.writeAsync(block);
block = new ArrayList<>();
blockFlushed = true;
}

// End of clone
if (currentCloneIndex != alignments.cloneIndex) {

if (!blockFlushed) {
if (!block.isEmpty()) {
// This will also wait for the previous block (if async write was issued) to be flushed to the stream
writer.writeSync(block);
block = new ArrayList<>();

0 comments on commit d9f85bc

Please sign in to comment.
You can’t perform that action at this time.