diff --git a/.travis.yml b/.travis.yml index c2ab96149..cc030c408 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,7 +14,7 @@ before_install: - mv .cache ./repseqio/.cache - cd repseqio && mvn clean install -DskipTests -B && cd .. - mv ./repseqio/.cache .cache - + - ./ensure-test-data.sh script: - mvn test -B && ./itests.sh test diff --git a/CHANGELOG b/CHANGELOG index e3aa9954c..acf1dd2fa 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,4 +1,21 @@ +MiXCR 3.0.4 (15 Feb 2019) +======================== + +-- Fixed problem with possibly incorrect clone-to-alignment mapping and clonotype sorting. The + problem manifests itself in rare cercumstances, with `-OseparateByV/J/C=true` (special thanks to + Victor Greiff @GreiffLab for finding the bug and helping with testing) +-- Fixes exception while reading alignments from `clna` files (thanks to Dr. Ma @JohnMCMa for + finding the bug and providing the data to reproduce it) +-- Integration with new MiLib abstraction for CLI, to automatically infer when reanalysis is nedded + and when not (this mechanism extracts paramteres from the target files, and checks if current + command line sets the same options, if the options are the same, mixcr skips the step, otherwize + restarts the analysis) +-- Report for the `assemble` command now contains chain distribution statistics +-- `analyze` command now is case-insensitive for all options like `--starting-material` +-- Fixed exception arising in rare cases with sequence imputation on the export step + + MiXCR 3.0.3 (18 Nov 2018) ======================== diff --git a/README.md b/README.md index 63b7ac16d..73285832d 100644 --- a/README.md +++ b/README.md @@ -104,7 +104,7 @@ To build MiXCR from source: ## License -Copyright (c) 2014-2015, Bolotin Dmitry, Chudakov Dmitry, Shugay Mikhail +Copyright (c) 2014-2018, Bolotin Dmitry, Chudakov Dmitry, Shugay Mikhail (here and after addressed as Inventors) All Rights Reserved diff --git a/doc/install.rst b/doc/install.rst index d90af739b..6597c9a28 100644 --- a/doc/install.rst +++ b/doc/install.rst @@ -17,8 +17,15 @@ To install MiXCR using Homebrew just type the following commands: :: brew tap milaboratory/all + brew install mixcr3 + +To install the old MiXCR 2.x series you can use + +:: + brew install mixcr + Installation on Mac OS X / Linux / FreeBSD from zip distribution ---------------------------------------------------------------- diff --git a/itests.sh b/itests.sh index 65294f006..7194da324 100755 --- a/itests.sh +++ b/itests.sh @@ -1,7 +1,6 @@ #!/bin/bash -set -e -set -o pipefail +set -eo pipefail # "Integration" tests for MiXCR # Test standard analysis pipeline results @@ -49,6 +48,8 @@ case $os in ;; esac +tests=("case1" "case2" "case3" "case4" "case5") + create_standard_results=false run_tests=false while [[ $# > 0 ]] @@ -62,6 +63,9 @@ do test) run_tests=true ;; + case*) + tests=("$key") + ;; *) echo "Unknown option $key"; exit 1 @@ -75,6 +79,8 @@ mkdir ${dir}/test_target cp ${dir}/src/test/resources/sequences/*.fastq ${dir}/test_target/ cd ${dir}/test_target/ +ln -s ../src/test/resources/sequences/big/CD4M1_test_R1.fastq.gz ${dir}/test_target/CD4M1_test_R1.fastq.gz +ln -s ../src/test/resources/sequences/big/CD4M1_test_R2.fastq.gz ${dir}/test_target/CD4M1_test_R2.fastq.gz PATH=${dir}:${PATH} @@ -86,7 +92,7 @@ function go_assemble { mixcr assemble -r $1.clns.report $1.vdjca $1.clns for c in TCR IG TRB TRA TRG TRD IGH IGL IGK ALL do - mixcr exportClones -c ${c} -s $1.clns $1.clns.${c}.txt + mixcr exportClones -c ${c} $1.clns $1.clns.${c}.txt done } @@ -100,18 +106,33 @@ if [[ $create_standard_results == true ]]; then done fi -# UseCase 1 +function run_test() { + cd ${dir}/test_target + echo "========================" + echo "Running: $1" + echo "========================" + + if ../itests/${1}; then + echo "========================" + echo "$1 executed successfully" + else + echo "========================" + echo "$1 executed with error" + touch ${1}.error + fi + echo "========================" +} if [[ $run_tests == true ]]; then - echo "Running test case 1" - mixcr align -s hs -OvParameters.geneFeatureToAlign=VGeneWithP -OsaveOriginalReads=true test_R1.fastq test_R2.fastq case1.vdjca - mixcr assemble case1.vdjca case1.clns - - mixcr exportAlignments -nFeatureImputed VDJRegion -descrsR1 -descrsR2 case1.vdjca case1.alignments.txt - - echo "Running test case 2" - mixcr analyze shotgun -f --species hs --contig-assembly --impute-germline-on-export --starting-material rna test_R1.fastq test_R2.fastq case2 + for testName in ${tests[@]} ; do + run_test "${testName}.sh" + done - echo "Running test case 3" - 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 test_R1.fastq test_R2.fastq case3 + if ls ${dir}/test_target/*.error 1> /dev/null 2>&1; then + echo "There are tests with errors." + exit 1 + else + echo "All tests finished successfully." + exit 0 + fi fi diff --git a/itests/case1.sh b/itests/case1.sh new file mode 100755 index 000000000..f33e082f6 --- /dev/null +++ b/itests/case1.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +set -euxo pipefail + +mixcr align -s hs -OvParameters.geneFeatureToAlign=VGeneWithP -OsaveOriginalReads=true test_R1.fastq test_R2.fastq case1.vdjca +mixcr assemble case1.vdjca case1.clns diff --git a/itests/case2.sh b/itests/case2.sh new file mode 100755 index 000000000..ca722808d --- /dev/null +++ b/itests/case2.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +set -euxo pipefail + +mixcr analyze shotgun -f --species hs --contig-assembly --impute-germline-on-export --starting-material rna test_R1.fastq test_R2.fastq case2 diff --git a/itests/case3.sh b/itests/case3.sh new file mode 100755 index 000000000..6d53f1f32 --- /dev/null +++ b/itests/case3.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +set -euxo pipefail + +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 test_R1.fastq test_R2.fastq case3 \ No newline at end of file diff --git a/itests/case4.sh b/itests/case4.sh new file mode 100755 index 000000000..f7e3bfcfd --- /dev/null +++ b/itests/case4.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +set -euxo pipefail + +# Checking generic pipeline with relatively big input files +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 adapters-present CD4M1_test_R1.fastq.gz CD4M1_test_R2.fastq.gz case4 + +# Checking skip steps behaviour +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 adapters-present CD4M1_test_R1.fastq.gz CD4M1_test_R2.fastq.gz case4 diff --git a/itests/case5.sh b/itests/case5.sh new file mode 100755 index 000000000..d264ab7f1 --- /dev/null +++ b/itests/case5.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash + +set -euxo pipefail + +gzip -dc CD4M1_test_R1.fastq.gz CD4M1_test_R1.fastq.gz | tr 'N' 'A' > case5_R1.fastq +gzip -dc CD4M1_test_R2.fastq.gz CD4M1_test_R2.fastq.gz | tr 'N' 'A' > case5_R2.fastq + +mixcr analyze amplicon --assemble '-OseparateByC=true' --assemble '-OseparateByV=true' --assemble '-OseparateByJ=true' --impute-germline-on-export -s hs --starting-material rna --contig-assembly --5-end v-primers --3-end j-primers --adapters adapters-present case5_R1.fastq case5_R2.fastq case5 +#mixcr analyze amplicon --assemble '-OcloneClusteringParameters=null' --impute-germline-on-export -s hs --starting-material rna --contig-assembly --5-end v-primers --3-end j-primers --adapters adapters-present case5_R1.fastq case5_R2.fastq case5 + +mixcr exportAlignments -f -readIds -cloneIdWithMappingType case5.clna case5.als.txt + +sort -t $'\t' --key=1 -n case5.als.txt | tail -n +2 > case5.als.sorted.txt + +lines=$(cat case5.als.sorted.txt | wc -l) + +head -n $((lines/2)) case5.als.sorted.txt | cut -f2 > case5.als.sorted.1.txt +tail -n $((lines/2)) case5.als.sorted.txt | cut -f2 > case5.als.sorted.2.txt + +if cmp case5.als.sorted.1.txt case5.als.sorted.2.txt; then + echo "All good" +else + echo "Results are different" + diff case5.als.sorted.1.txt case5.als.sorted.2.txt +fi diff --git a/milib b/milib index 6b321c4e0..cd564d4bf 160000 --- a/milib +++ b/milib @@ -1 +1 @@ -Subproject commit 6b321c4e0a24e24e532ea4b4517394e7a33cb4d3 +Subproject commit cd564d4bf5c81be66d0bf168ad4e520e5c00a7c1 diff --git a/pom.xml b/pom.xml index b9c611f37..c81aeba1b 100644 --- a/pom.xml +++ b/pom.xml @@ -1,6 +1,6 @@