Skip to content

Commit

Permalink
Removing quote symbols on both sides of value in parameter overriding…
Browse files Browse the repository at this point in the history
… mechanism.
  • Loading branch information
dbolotin committed Sep 4, 2015
1 parent a5484bf commit 30329d1
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CHANGELOG_CURRENT
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ Added export options -vHitsWithoutScores (same for J and D genes)
Added support for optional compression of .vdjca and .clns files (when specifying additional `.gz` extension: e.g. `mixcr align inut.fastq output.vdjca.gz` etc.)
Possible set of D genes is limited by loci of V and J genes in current rearrengement
Default output format for `exportAlignmentsPretty` changed for the new one which is more compact and vivid
Two new filtering options in `exportAlignmentsPretty`: `--cdr3-contains` and `--read-contains`
Two new filtering options in `exportAlignmentsPretty`: `--cdr3-contains` and `--read-contains`
Correct handling of quotes in paramters overriding
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ public static boolean override(JsonNode node, String command) {
String[] split = command.split("=", 2);
String path = split[0];
String value = split[1];
value = value.replaceAll("^[\'\"]", "").replaceAll("[\'\"]$", "");
return override(node, path, value);
}

Expand Down
13 changes: 13 additions & 0 deletions src/test/java/com/milaboratory/mixcr/cli/JsonOverriderTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,19 @@ public void test1() throws Exception {
Assert.assertEquals(expected, override);
}

@Test
public void test1a() throws Exception {
KAlignerParameters parameters = KAlignerParameters.getByName("default");
KAlignerParameters override = JsonOverrider.override(
parameters,
KAlignerParameters.class,
"floatingLeftBound=true",
"scoring.subsMatrix='simple(match=4,mismatch=-9)'");
KAlignerParameters expected = parameters.clone().setFloatingLeftBound(true)
.setScoring(new LinearGapAlignmentScoring(NucleotideSequence.ALPHABET, 4, -9, parameters.getScoring().getGapPenalty()));
Assert.assertEquals(expected, override);
}

@Test
public void test2() throws Exception {
KAlignerParameters parameters = KAlignerParameters.getByName("default");
Expand Down

0 comments on commit 30329d1

Please sign in to comment.