From 3eb3aa50efc4da294e7a82de75dbf50724199489 Mon Sep 17 00:00:00 2001 From: Bolotin Dmitriy Date: Mon, 22 Jul 2019 19:37:18 +0100 Subject: [PATCH 1/9] Next development cycle v3.0.9 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 596f5e7d4..d8e3a0c11 100644 --- a/pom.xml +++ b/pom.xml @@ -33,7 +33,7 @@ com.milaboratory mixcr - 3.0.8 + 3.0.9-SNAPSHOT jar MiXCR From c77d6ef97e4a3cafbf3395695772b770b8572c47 Mon Sep 17 00:00:00 2001 From: Bolotin Dmitriy Date: Tue, 30 Jul 2019 14:28:03 +0100 Subject: [PATCH 2/9] Chain usage statistics in `align` and `assemble` json reports. --- .../milaboratory/mixcr/cli/AlignerReport.java | 5 ++ .../mixcr/cli/ChainUsageStats.java | 27 ++++++++++- .../mixcr/cli/CloneAssemblerReport.java | 5 ++ .../mixcr/cli/ChainUsageStatsTest.java | 47 +++++++++++++++++++ 4 files changed, 83 insertions(+), 1 deletion(-) create mode 100644 src/test/java/com/milaboratory/mixcr/cli/ChainUsageStatsTest.java diff --git a/src/main/java/com/milaboratory/mixcr/cli/AlignerReport.java b/src/main/java/com/milaboratory/mixcr/cli/AlignerReport.java index d1cb57fd6..78b279a6b 100644 --- a/src/main/java/com/milaboratory/mixcr/cli/AlignerReport.java +++ b/src/main/java/com/milaboratory/mixcr/cli/AlignerReport.java @@ -165,6 +165,11 @@ public long getJChimeras() { return jChimeras.get(); } + @JsonProperty("chainUsage") + public ChainUsageStats getChainUsage() { + return chainStats; + } + @JsonProperty("realignedWithForcedNonFloatingBound") public long getRealignedWithForcedNonFloatingBound() { return realignedWithForcedNonFloatingBound.get(); diff --git a/src/main/java/com/milaboratory/mixcr/cli/ChainUsageStats.java b/src/main/java/com/milaboratory/mixcr/cli/ChainUsageStats.java index 32a6286b2..c3f9ff7bd 100644 --- a/src/main/java/com/milaboratory/mixcr/cli/ChainUsageStats.java +++ b/src/main/java/com/milaboratory/mixcr/cli/ChainUsageStats.java @@ -29,9 +29,15 @@ */ package com.milaboratory.mixcr.cli; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.JsonSerializer; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.milaboratory.mixcr.basictypes.VDJCObject; import io.repseq.core.Chains; +import java.io.IOException; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.atomic.AtomicLong; @@ -39,7 +45,8 @@ /** * Created by poslavsky on 08/11/2016. */ -final class ChainUsageStats implements Report { +@JsonSerialize(using = ChainUsageStats.Serializer.class) +public final class ChainUsageStats implements Report { final AtomicLong chimeras = new AtomicLong(0); final AtomicLong total = new AtomicLong(0); final ConcurrentHashMap counters = new ConcurrentHashMap<>(); @@ -80,4 +87,22 @@ public void writeReport(ReportHelper helper) { for (Map.Entry ch : counters.entrySet()) helper.writePercentAndAbsoluteField(ch.getKey().toString() + " chains", ch.getValue(), total); } + + public static final class Serializer extends JsonSerializer { + @Override + public void serialize(ChainUsageStats value, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingException { + jgen.writeStartObject(); + jgen.writeNumberField("total", value.total.longValue()); + jgen.writeNumberField("chimeras", value.chimeras.longValue()); + jgen.writeObjectFieldStart("chains"); + for (Map.Entry entry : value.counters.entrySet()) { + String chains = entry.getKey().toString(); + if (chains.isEmpty()) + chains = "X"; + jgen.writeNumberField(chains, entry.getValue().longValue()); + } + jgen.writeEndObject(); + jgen.writeEndObject(); + } + } } diff --git a/src/main/java/com/milaboratory/mixcr/cli/CloneAssemblerReport.java b/src/main/java/com/milaboratory/mixcr/cli/CloneAssemblerReport.java index 1a053856d..66eb02d40 100644 --- a/src/main/java/com/milaboratory/mixcr/cli/CloneAssemblerReport.java +++ b/src/main/java/com/milaboratory/mixcr/cli/CloneAssemblerReport.java @@ -146,6 +146,11 @@ public long getReadsDroppedWithClones() { return readsDroppedWithClones.get(); } + @JsonProperty("clonalChainUsage") + public ChainUsageStats getClonalChainUsage() { + return chainStats; + } + @Override public void onNewCloneCreated(CloneAccumulator accumulator) { clonesCreated.incrementAndGet(); diff --git a/src/test/java/com/milaboratory/mixcr/cli/ChainUsageStatsTest.java b/src/test/java/com/milaboratory/mixcr/cli/ChainUsageStatsTest.java new file mode 100644 index 000000000..46f7eea72 --- /dev/null +++ b/src/test/java/com/milaboratory/mixcr/cli/ChainUsageStatsTest.java @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2014-2019, Bolotin Dmitry, Chudakov Dmitry, Shugay Mikhail + * (here and after addressed as Inventors) + * All Rights Reserved + * + * Permission to use, copy, modify and distribute any part of this program for + * educational, research and non-profit purposes, by non-profit institutions + * only, without fee, and without a written agreement is hereby granted, + * provided that the above copyright notice, this paragraph and the following + * three paragraphs appear in all copies. + * + * Those desiring to incorporate this work into commercial products or use for + * commercial purposes should contact MiLaboratory LLC, which owns exclusive + * rights for distribution of this program for commercial purposes, using the + * following email address: licensing@milaboratory.com. + * + * IN NO EVENT SHALL THE INVENTORS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, + * SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, + * ARISING OUT OF THE USE OF THIS SOFTWARE, EVEN IF THE INVENTORS HAS BEEN + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * THE SOFTWARE PROVIDED HEREIN IS ON AN "AS IS" BASIS, AND THE INVENTORS HAS + * NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR + * MODIFICATIONS. THE INVENTORS MAKES NO REPRESENTATIONS AND EXTENDS NO + * WARRANTIES OF ANY KIND, EITHER IMPLIED OR EXPRESS, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A + * PARTICULAR PURPOSE, OR THAT THE USE OF THE SOFTWARE WILL NOT INFRINGE ANY + * PATENT, TRADEMARK OR OTHER RIGHTS. + */ +package com.milaboratory.mixcr.cli; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.milaboratory.util.GlobalObjectMappers; +import io.repseq.core.Chains; +import org.junit.Test; + +public class ChainUsageStatsTest { + @Test + public void serializationTest() throws JsonProcessingException { + ChainUsageStats stats = new ChainUsageStats(); + stats.total.incrementAndGet(); + stats.total.incrementAndGet(); + stats.chimeras.incrementAndGet(); + stats.getCounter(Chains.TRB).incrementAndGet(); + System.out.println(GlobalObjectMappers.PRETTY.writeValueAsString(stats)); + } +} \ No newline at end of file From 0989c2b2766b77b2d9c83dab0f2e49ff3f71aa49 Mon Sep 17 00:00:00 2001 From: Bolotin Dmitriy Date: Tue, 30 Jul 2019 14:36:51 +0100 Subject: [PATCH 3/9] Shortcut for --json-report option. --- CHANGELOG_CURRENT | 2 ++ src/main/java/com/milaboratory/mixcr/cli/CommandAlign.java | 2 +- src/main/java/com/milaboratory/mixcr/cli/CommandAssemble.java | 2 +- .../java/com/milaboratory/mixcr/cli/CommandAssembleContigs.java | 2 +- .../mixcr/cli/CommandAssemblePartialAlignments.java | 2 +- src/main/java/com/milaboratory/mixcr/cli/CommandExtend.java | 2 +- .../java/com/milaboratory/mixcr/cli/CommonDescriptions.java | 2 +- 7 files changed, 8 insertions(+), 6 deletions(-) diff --git a/CHANGELOG_CURRENT b/CHANGELOG_CURRENT index e69de29bb..36905b16c 100644 --- a/CHANGELOG_CURRENT +++ b/CHANGELOG_CURRENT @@ -0,0 +1,2 @@ +Chain usage statistics added to `align` and `assemble` JSON reports +Added shortcut for `--json-report` = `-j` \ No newline at end of file diff --git a/src/main/java/com/milaboratory/mixcr/cli/CommandAlign.java b/src/main/java/com/milaboratory/mixcr/cli/CommandAlign.java index 66470207b..34e744f78 100644 --- a/src/main/java/com/milaboratory/mixcr/cli/CommandAlign.java +++ b/src/main/java/com/milaboratory/mixcr/cli/CommandAlign.java @@ -117,7 +117,7 @@ protected List getOutputFiles() { public String reportFile = null; @Option(description = CommonDescriptions.JSON_REPORT, - names = {"--json-report"}) + names = {"-j", "--json-report"}) public String jsonReport = null; @Option(description = "V/D/J/C gene library", diff --git a/src/main/java/com/milaboratory/mixcr/cli/CommandAssemble.java b/src/main/java/com/milaboratory/mixcr/cli/CommandAssemble.java index 4afecbaa4..8a76cd44f 100644 --- a/src/main/java/com/milaboratory/mixcr/cli/CommandAssemble.java +++ b/src/main/java/com/milaboratory/mixcr/cli/CommandAssemble.java @@ -76,7 +76,7 @@ public void setThreads(int threads) { public String reportFile; @Option(description = CommonDescriptions.JSON_REPORT, - names = {"--json-report"}) + names = {"-j", "--json-report"}) public String jsonReport; @Option(description = "Show buffer statistics.", diff --git a/src/main/java/com/milaboratory/mixcr/cli/CommandAssembleContigs.java b/src/main/java/com/milaboratory/mixcr/cli/CommandAssembleContigs.java index 3d88a7da2..740a95091 100644 --- a/src/main/java/com/milaboratory/mixcr/cli/CommandAssembleContigs.java +++ b/src/main/java/com/milaboratory/mixcr/cli/CommandAssembleContigs.java @@ -92,7 +92,7 @@ public void setThreads(int threads) { public String debugReportFile; @Option(description = CommonDescriptions.JSON_REPORT, - names = {"--json-report"}) + names = {"-j", "--json-report"}) public String jsonReport = null; public FullSeqAssemblerParameters getFullSeqAssemblerParameters() { diff --git a/src/main/java/com/milaboratory/mixcr/cli/CommandAssemblePartialAlignments.java b/src/main/java/com/milaboratory/mixcr/cli/CommandAssemblePartialAlignments.java index d2f1febf2..f773e9422 100644 --- a/src/main/java/com/milaboratory/mixcr/cli/CommandAssemblePartialAlignments.java +++ b/src/main/java/com/milaboratory/mixcr/cli/CommandAssemblePartialAlignments.java @@ -60,7 +60,7 @@ public class CommandAssemblePartialAlignments extends ACommandWithSmartOverwrite public String reportFile; @Option(description = CommonDescriptions.JSON_REPORT, - names = {"--json-report"}) + names = {"-j", "--json-report"}) public String jsonReport = null; @Option(description = "Write only overlapped sequences (needed for testing).", diff --git a/src/main/java/com/milaboratory/mixcr/cli/CommandExtend.java b/src/main/java/com/milaboratory/mixcr/cli/CommandExtend.java index a43b16f60..37ff51e7d 100644 --- a/src/main/java/com/milaboratory/mixcr/cli/CommandExtend.java +++ b/src/main/java/com/milaboratory/mixcr/cli/CommandExtend.java @@ -71,7 +71,7 @@ public class CommandExtend extends ACommandWithSmartOverwriteWithSingleInputMiXC public String reportFile; @Option(description = CommonDescriptions.JSON_REPORT, - names = {"--json-report"}) + names = {"-j", "--json-report"}) public String jsonReport = null; @Option(description = "Quality score value to assign imputed sequences", diff --git a/src/main/java/com/milaboratory/mixcr/cli/CommonDescriptions.java b/src/main/java/com/milaboratory/mixcr/cli/CommonDescriptions.java index 9fa6b171e..852099618 100644 --- a/src/main/java/com/milaboratory/mixcr/cli/CommonDescriptions.java +++ b/src/main/java/com/milaboratory/mixcr/cli/CommonDescriptions.java @@ -37,7 +37,7 @@ private CommonDescriptions() { "Species (organism), as specified in library file or taxon id.%n" + "Possible values: hs, HomoSapiens, musmusculus, mmu, hsa, 9606, 10090 etc."; - public static final String REPORT = "Report file (human readable version, see --json-report for machine readable report)"; + public static final String REPORT = "Report file (human readable version, see -j / --json-report for machine readable report)"; public static final String JSON_REPORT = "JSON formatted report file"; From 885a1e9d9ffceefa9f88d0ba2b580272199b88d0 Mon Sep 17 00:00:00 2001 From: Stanislav Poslavsky Date: Fri, 2 Aug 2019 16:24:40 +0300 Subject: [PATCH 4/9] fix VDJCObject#getIncompleteFeature --- .../java/com/milaboratory/mixcr/basictypes/VDJCObject.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/com/milaboratory/mixcr/basictypes/VDJCObject.java b/src/main/java/com/milaboratory/mixcr/basictypes/VDJCObject.java index 7f43808cf..0dac74755 100644 --- a/src/main/java/com/milaboratory/mixcr/basictypes/VDJCObject.java +++ b/src/main/java/com/milaboratory/mixcr/basictypes/VDJCObject.java @@ -552,6 +552,9 @@ public CaseSensitiveNucleotideSequence getIncompleteFeature(GeneFeature geneFeat if (lLast.begin > rLast.end) return null; + if (lLast.germline || rLast.germline) + return null; + // assert lHit.getGene().getGeneType() == GeneType.Variable; // if (!lHit // .getPartitioningForTarget(lLast.iTarget) From d68ba6ddf24767fed1057be82989c0d5f137a9a6 Mon Sep 17 00:00:00 2001 From: Bolotin Dmitriy Date: Fri, 2 Aug 2019 14:28:10 +0100 Subject: [PATCH 5/9] Changelog --- CHANGELOG_CURRENT | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG_CURRENT b/CHANGELOG_CURRENT index 36905b16c..ebce1ff2b 100644 --- a/CHANGELOG_CURRENT +++ b/CHANGELOG_CURRENT @@ -1,2 +1,3 @@ Chain usage statistics added to `align` and `assemble` JSON reports +This fixes rare IndexOutOfBounds exception in `-nFeatureImputed ...` Added shortcut for `--json-report` = `-j` \ No newline at end of file From 65900c47027a3cf46236990166f7aa3983d7747b Mon Sep 17 00:00:00 2001 From: Stanislav Poslavsky Date: Fri, 2 Aug 2019 16:30:07 +0300 Subject: [PATCH 6/9] possible fix for nan count --- .../mixcr/assembler/fullseq/FullSeqAssembler.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/milaboratory/mixcr/assembler/fullseq/FullSeqAssembler.java b/src/main/java/com/milaboratory/mixcr/assembler/fullseq/FullSeqAssembler.java index 82459c0c3..4d2587930 100644 --- a/src/main/java/com/milaboratory/mixcr/assembler/fullseq/FullSeqAssembler.java +++ b/src/main/java/com/milaboratory/mixcr/assembler/fullseq/FullSeqAssembler.java @@ -321,10 +321,11 @@ private void clusterizeBranches(int[] points, List branches) { sumWeight += weights[j - i - 1]; } - for (int j = i + 1; j < branches.size(); ++j) { - VariantBranch cluster = branches.get(j); - cluster.count += branch.count * weights[j - i - 1] / sumWeight; - } + if (sumWeight != 0.0) + for (int j = i + 1; j < branches.size(); ++j) { + VariantBranch cluster = branches.get(j); + cluster.count += branch.count * weights[j - i - 1] / sumWeight; + } if (report != null) report.onVariantClustered(branch); From dcee49e9ff3fc5278fea29d85a23ff846ae068b9 Mon Sep 17 00:00:00 2001 From: Bolotin Dmitriy Date: Fri, 2 Aug 2019 17:19:14 +0100 Subject: [PATCH 7/9] Fixes V/J alignment score-based pre-filtering behaviour. --- CHANGELOG_CURRENT | 3 ++- .../mixcr/assembler/CloneAssembler.java | 4 ++++ .../mixcr/assembler/CloneAssemblerParameters.java | 13 ++++++++++++- .../resources/parameters/assembler_parameters.json | 1 + .../assembler/CloneAssemblerParametersTest.java | 4 ++-- .../mixcr/assembler/CloneAssemblerRunnerTest.java | 4 ++-- .../milaboratory/mixcr/cli/JsonOverriderTest.java | 6 +++--- 7 files changed, 26 insertions(+), 9 deletions(-) diff --git a/CHANGELOG_CURRENT b/CHANGELOG_CURRENT index ebce1ff2b..a2393486f 100644 --- a/CHANGELOG_CURRENT +++ b/CHANGELOG_CURRENT @@ -1,3 +1,4 @@ Chain usage statistics added to `align` and `assemble` JSON reports -This fixes rare IndexOutOfBounds exception in `-nFeatureImputed ...` +Fixed wrong behaviour with score-based pre-filtering in `split-by-V/J=true` cases +Fixed rare IndexOutOfBounds exception in `-nFeatureImputed ...` Added shortcut for `--json-report` = `-j` \ No newline at end of file diff --git a/src/main/java/com/milaboratory/mixcr/assembler/CloneAssembler.java b/src/main/java/com/milaboratory/mixcr/assembler/CloneAssembler.java index 82cc431ae..d601bbcb1 100644 --- a/src/main/java/com/milaboratory/mixcr/assembler/CloneAssembler.java +++ b/src/main/java/com/milaboratory/mixcr/assembler/CloneAssembler.java @@ -629,6 +629,7 @@ public List build() { final TIntObjectHashMap reversePreClustered = new TIntObjectHashMap<>(); Arrays.sort(accs, CLONE_ACCUMULATOR_COMPARATOR); + double minCountForMaxScore = accs[0].getCount() / parameters.preClusteringCountFilteringRatio; int deleted = 0; for (int i = 0; i < accs.length - 1; i++) { @@ -677,10 +678,13 @@ public List build() { // Score filtering step // Calculation + float[] maxScores = new float[2]; for (CloneAccumulator acc : accs) { if (acc == null) continue; + if (acc.getCount() < minCountForMaxScore) + continue; for (int i = 0; i < 2; i++) { // Only for V and J GeneType gt = GeneType.VJC_REFERENCE[i]; maxScores[i] = diff --git a/src/main/java/com/milaboratory/mixcr/assembler/CloneAssemblerParameters.java b/src/main/java/com/milaboratory/mixcr/assembler/CloneAssemblerParameters.java index b6ccfb62b..4ec3a4e26 100644 --- a/src/main/java/com/milaboratory/mixcr/assembler/CloneAssemblerParameters.java +++ b/src/main/java/com/milaboratory/mixcr/assembler/CloneAssemblerParameters.java @@ -56,6 +56,7 @@ public final class CloneAssemblerParameters implements java.io.Serializable { boolean separateByV, separateByJ, separateByC; double maximalPreClusteringRatio; double preClusteringScoreFilteringRatio; + double preClusteringCountFilteringRatio; boolean addReadsCountOnClustering; byte badQualityThreshold; double maxBadPointsPercent; @@ -75,6 +76,7 @@ public CloneAssemblerParameters(@JsonProperty("assemblingFeatures") GeneFeature[ @JsonProperty("separateByC") boolean separateByC, @JsonProperty("maximalPreClusteringRatio") double maximalPreClusteringRatio, @JsonProperty("preClusteringScoreFilteringRatio") double preClusteringScoreFilteringRatio, + @JsonProperty("preClusteringCountFilteringRatio") double preClusteringCountFilteringRatio, @JsonProperty("addReadsCountOnClustering") boolean addReadsCountOnClustering, @JsonProperty("badQualityThreshold") byte badQualityThreshold, @JsonProperty("maxBadPointsPercent") double maxBadPointsPercent, @@ -90,6 +92,7 @@ public CloneAssemblerParameters(@JsonProperty("assemblingFeatures") GeneFeature[ this.separateByC = separateByC; this.maximalPreClusteringRatio = maximalPreClusteringRatio; this.preClusteringScoreFilteringRatio = preClusteringScoreFilteringRatio; + this.preClusteringCountFilteringRatio = preClusteringCountFilteringRatio; this.addReadsCountOnClustering = addReadsCountOnClustering; this.badQualityThreshold = badQualityThreshold; this.maxBadPointsPercent = maxBadPointsPercent; @@ -264,6 +267,11 @@ public CloneAssemblerParameters setPreClusteringScoreFilteringRatio(double preCl return this; } + public CloneAssemblerParameters setPreClusteringCountFilteringRatio(double preClusteringCountFilteringRatio) { + this.preClusteringCountFilteringRatio = preClusteringCountFilteringRatio; + return this; + } + public CloneAssemblerParameters setAddReadsCountOnClustering(boolean addReadsCountOnClustering) { this.addReadsCountOnClustering = addReadsCountOnClustering; @@ -289,7 +297,7 @@ public CloneAssemblerParameters clone() { qualityAggregationType, cloneClusteringParameters == null ? null : cloneClusteringParameters.clone(), cloneFactoryParameters.clone(), separateByV, separateByJ, separateByC, - maximalPreClusteringRatio, preClusteringScoreFilteringRatio, addReadsCountOnClustering, badQualityThreshold, maxBadPointsPercent, + maximalPreClusteringRatio, preClusteringScoreFilteringRatio, preClusteringCountFilteringRatio, addReadsCountOnClustering, badQualityThreshold, maxBadPointsPercent, mappingThreshold, minimalQuality); } @@ -307,6 +315,7 @@ public boolean equals(Object o) { if (separateByC != that.separateByC) return false; if (Double.compare(that.maximalPreClusteringRatio, maximalPreClusteringRatio) != 0) return false; if (Double.compare(that.preClusteringScoreFilteringRatio, preClusteringScoreFilteringRatio) != 0) return false; + if (Double.compare(that.preClusteringCountFilteringRatio, preClusteringCountFilteringRatio) != 0) return false; if (addReadsCountOnClustering != that.addReadsCountOnClustering) return false; if (badQualityThreshold != that.badQualityThreshold) return false; if (Double.compare(that.maxBadPointsPercent, maxBadPointsPercent) != 0) return false; @@ -338,6 +347,8 @@ public int hashCode() { result = 31 * result + (int) (temp ^ (temp >>> 32)); temp = Double.doubleToLongBits(preClusteringScoreFilteringRatio); result = 31 * result + (int) (temp ^ (temp >>> 32)); + temp = Double.doubleToLongBits(preClusteringCountFilteringRatio); + result = 31 * result + (int) (temp ^ (temp >>> 32)); result = 31 * result + (addReadsCountOnClustering ? 1 : 0); result = 31 * result + (int) badQualityThreshold; temp = Double.doubleToLongBits(maxBadPointsPercent); diff --git a/src/main/resources/parameters/assembler_parameters.json b/src/main/resources/parameters/assembler_parameters.json index 5f0554efb..92366e5a4 100644 --- a/src/main/resources/parameters/assembler_parameters.json +++ b/src/main/resources/parameters/assembler_parameters.json @@ -9,6 +9,7 @@ "separateByC": false, "maximalPreClusteringRatio": 1.0, "preClusteringScoreFilteringRatio": 2.0, + "preClusteringCountFilteringRatio": 2.0, "cloneClusteringParameters": { "searchDepth": 2, "allowedMutationsInNRegions": 1, diff --git a/src/test/java/com/milaboratory/mixcr/assembler/CloneAssemblerParametersTest.java b/src/test/java/com/milaboratory/mixcr/assembler/CloneAssemblerParametersTest.java index e92155a3c..9bef6cb80 100644 --- a/src/test/java/com/milaboratory/mixcr/assembler/CloneAssemblerParametersTest.java +++ b/src/test/java/com/milaboratory/mixcr/assembler/CloneAssemblerParametersTest.java @@ -54,7 +54,7 @@ null, new DClonalAlignerParameters(0.85f, 30.0f, 3, AffineGapAlignmentScoring.ge CloneAssemblerParameters params = new CloneAssemblerParameters(new GeneFeature[]{GeneFeature.FR1, GeneFeature.CDR3}, 12, QualityAggregationType.Average, new CloneClusteringParameters(2, 1, TreeSearchParameters.ONE_MISMATCH, new RelativeConcentrationFilter(1.0E-6)), - factoryParameters, true, true, false, 0.4, 2.0, true, (byte) 20, .8, "2", (byte) 15); + factoryParameters, true, true, false, 0.4, 2.0, 2.0, true, (byte) 20, .8, "2", (byte) 15); String str = GlobalObjectMappers.PRETTY.writeValueAsString(params); //System.out.println(str); @@ -82,7 +82,7 @@ null, new DClonalAlignerParameters(0.85f, 30.0f, 3, AffineGapAlignmentScoring.ge CloneAssemblerParameters params = new CloneAssemblerParameters(new GeneFeature[]{GeneFeature.FR1, GeneFeature.CDR3}, 12, QualityAggregationType.Average, new CloneClusteringParameters(2, 1, TreeSearchParameters.ONE_MISMATCH, new RelativeConcentrationFilter(1.0E-6)), - factoryParameters, true, true, false, 0.4, 2.0, true, (byte) 20, .8, "2of6", (byte) 15); + factoryParameters, true, true, false, 0.4, 2.0, 2.0, true, (byte) 20, .8, "2of6", (byte) 15); String str = GlobalObjectMappers.PRETTY.writeValueAsString(params); //System.out.println(str); diff --git a/src/test/java/com/milaboratory/mixcr/assembler/CloneAssemblerRunnerTest.java b/src/test/java/com/milaboratory/mixcr/assembler/CloneAssemblerRunnerTest.java index 3d2df0364..ea38d6a47 100644 --- a/src/test/java/com/milaboratory/mixcr/assembler/CloneAssemblerRunnerTest.java +++ b/src/test/java/com/milaboratory/mixcr/assembler/CloneAssemblerRunnerTest.java @@ -118,7 +118,7 @@ private static CloneSet runFullPipeline(String... fastqFiles) throws IOException new GeneFeature[]{GeneFeature.CDR3}, 12, QualityAggregationType.Average, new CloneClusteringParameters(2, 1, TreeSearchParameters.ONE_MISMATCH, new RelativeConcentrationFilter(1.0E-6)), - factoryParameters, true, true, false, 0.4,2.0, true, (byte) 20, .8, "2 of 6", (byte) 15); + factoryParameters, true, true, false, 0.4, 2.0, 2.0, true, (byte) 20, .8, "2 of 6", (byte) 15); System.out.println(GlobalObjectMappers.toOneLine(assemblerParameters)); @@ -130,7 +130,7 @@ private static CloneSet runFullPipeline(String... fastqFiles) throws IOException CloneSet cloneSet = assemblerRunner.getCloneSet(null); ByteArrayOutputStream bos = new ByteArrayOutputStream(); - try(ClnsWriter writer = new ClnsWriter(null, cloneSet, bos)){ + try (ClnsWriter writer = new ClnsWriter(null, cloneSet, bos)) { writer.write(); } diff --git a/src/test/java/com/milaboratory/mixcr/cli/JsonOverriderTest.java b/src/test/java/com/milaboratory/mixcr/cli/JsonOverriderTest.java index 97420c8a8..6df9c0904 100644 --- a/src/test/java/com/milaboratory/mixcr/cli/JsonOverriderTest.java +++ b/src/test/java/com/milaboratory/mixcr/cli/JsonOverriderTest.java @@ -98,7 +98,7 @@ null, new DClonalAlignerParameters(0.85f, 30.0f, 3, AffineGapAlignmentScoring.ge CloneAssemblerParameters params = new CloneAssemblerParameters(new GeneFeature[]{GeneFeature.FR1, GeneFeature.CDR3}, 12, QualityAggregationType.Average, new CloneClusteringParameters(2, 1, TreeSearchParameters.ONE_MISMATCH, new RelativeConcentrationFilter(1.0E-6)), - factoryParameters, true, true, false, 0.4,2.0, true, (byte) 20, .8, "2of6", (byte) 15); + factoryParameters, true, true, false, 0.4, 2.0, 2.0, true, (byte) 20, .8, "2of6", (byte) 15); CloneAssemblerParameters override = JsonOverrider.override( params, @@ -108,7 +108,7 @@ null, new DClonalAlignerParameters(0.85f, 30.0f, 3, AffineGapAlignmentScoring.ge CloneAssemblerParameters expected = new CloneAssemblerParameters(new GeneFeature[]{new GeneFeature(GeneFeature.CDR1, -5, +6), GeneFeature.CDR2}, 12, QualityAggregationType.Average, new CloneClusteringParameters(2, 1, TreeSearchParameters.ONE_MISMATCH, new RelativeConcentrationFilter(1.0E-6)), - factoryParameters, true, true, false, 0.4,2.0, true, (byte) 20, .8, "2of6", (byte) 15); + factoryParameters, true, true, false, 0.4, 2.0, 2.0, true, (byte) 20, .8, "2of6", (byte) 15); Assert.assertEquals(expected, override); @@ -127,7 +127,7 @@ null, new DClonalAlignerParameters(0.85f, 30.0f, 3, AffineGapAlignmentScoring.ge CloneAssemblerParameters params = new CloneAssemblerParameters(new GeneFeature[]{GeneFeature.FR1, GeneFeature.CDR3}, 12, QualityAggregationType.Average, new CloneClusteringParameters(2, 1, TreeSearchParameters.ONE_MISMATCH, new RelativeConcentrationFilter(1.0E-6)), - factoryParameters, true, true, false, 0.4,2.0, true, (byte) 20, .8, "2of6", (byte) 15); + factoryParameters, true, true, false, 0.4, 2.0, 2.0, true, (byte) 20, .8, "2of6", (byte) 15); CloneAssemblerParameters override = JsonOverrider.override( params, From 299285c66a44ad972a9c53b811dcd8295a785b6a Mon Sep 17 00:00:00 2001 From: Bolotin Dmitriy Date: Fri, 2 Aug 2019 17:35:14 +0100 Subject: [PATCH 8/9] `analyze` params sanity check --- CHANGELOG_CURRENT | 3 ++- src/main/java/com/milaboratory/mixcr/cli/CommandAnalyze.java | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG_CURRENT b/CHANGELOG_CURRENT index a2393486f..530a06692 100644 --- a/CHANGELOG_CURRENT +++ b/CHANGELOG_CURRENT @@ -1,4 +1,5 @@ Chain usage statistics added to `align` and `assemble` JSON reports Fixed wrong behaviour with score-based pre-filtering in `split-by-V/J=true` cases Fixed rare IndexOutOfBounds exception in `-nFeatureImputed ...` -Added shortcut for `--json-report` = `-j` \ No newline at end of file +Added shortcut for `--json-report` = `-j` +Sanity check for common mistake in `analyze` parameters \ No newline at end of file diff --git a/src/main/java/com/milaboratory/mixcr/cli/CommandAnalyze.java b/src/main/java/com/milaboratory/mixcr/cli/CommandAnalyze.java index 007a986f3..38f7990f9 100644 --- a/src/main/java/com/milaboratory/mixcr/cli/CommandAnalyze.java +++ b/src/main/java/com/milaboratory/mixcr/cli/CommandAnalyze.java @@ -42,6 +42,7 @@ import picocli.CommandLine.Option; import picocli.CommandLine.Parameters; +import java.io.File; import java.lang.reflect.Field; import java.util.*; import java.util.stream.Collectors; @@ -623,6 +624,9 @@ public void validate() { super.validate(); if (report == null) warn("NOTE: report file is not specified, using " + getReport() + " to write report."); + if (new File(outputNamePattern()).exists()) + throwValidationException("Output file name prefix, matches the existing file name. Most probably you " + + "specified paired-end file names but forgot to specify output file name prefix.", false); } @Override From 80a6afd7bcc383753e6d127b328c70bbee00cb8b Mon Sep 17 00:00:00 2001 From: Bolotin Dmitriy Date: Tue, 6 Aug 2019 19:23:34 +0100 Subject: [PATCH 9/9] Release v3.0.9 --- CHANGELOG | 10 ++++++++++ CHANGELOG_CURRENT | 5 ----- pom.xml | 2 +- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 59f09b128..92bf238e4 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,4 +1,14 @@ +MiXCR 3.0.9 ( 6 Aug 2019) +======================== + +-- Chain usage statistics added to `align` and `assemble` JSON reports +-- Fixed wrong behaviour with score-based pre-filtering in `split-by-V/J=true` cases +-- Fixed rare IndexOutOfBounds exception in `-nFeatureImputed ...` +-- Added shortcut for `--json-report` = `-j` +-- Sanity check for common mistake in `analyze` parameters + + MiXCR 3.0.8 (22 Jul 2019) ======================== diff --git a/CHANGELOG_CURRENT b/CHANGELOG_CURRENT index 530a06692..e69de29bb 100644 --- a/CHANGELOG_CURRENT +++ b/CHANGELOG_CURRENT @@ -1,5 +0,0 @@ -Chain usage statistics added to `align` and `assemble` JSON reports -Fixed wrong behaviour with score-based pre-filtering in `split-by-V/J=true` cases -Fixed rare IndexOutOfBounds exception in `-nFeatureImputed ...` -Added shortcut for `--json-report` = `-j` -Sanity check for common mistake in `analyze` parameters \ No newline at end of file diff --git a/pom.xml b/pom.xml index d8e3a0c11..40e311a4a 100644 --- a/pom.xml +++ b/pom.xml @@ -33,7 +33,7 @@ com.milaboratory mixcr - 3.0.9-SNAPSHOT + 3.0.9 jar MiXCR