Skip to content

Commit

Permalink
Merge pull request #1664 from milaboratory/fix-downsample
Browse files Browse the repository at this point in the history
Fix downsample
  • Loading branch information
gnefedev committed May 16, 2024
2 parents 1a90bc5 + 9d98d2d commit 78c52a9
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 19 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ val toObfuscate: Configuration by configurations.creating {
val obfuscationLibs: Configuration by configurations.creating


val mixcrAlgoVersion = "4.6.0-104-optional-correction-of-tags"
val mixcrAlgoVersion = "4.6.0-106-develop"
// may be blank (will be inherited from mixcr-algo)
val milibVersion = ""
// may be blank (will be inherited from mixcr-algo or milib)
Expand Down
2 changes: 2 additions & 0 deletions changelogs/v4.6.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
- Fixed export of trees if data assembled by a feature with reference point having offset
- Export of `VJJunction gemline` in `shmTrees` exports now export `mrca` as most plausible content
- Fixed parsing and alignment of reads with length more than 30Kbase
- `downsample` now supports `molecule` variant in `--downsampling` option
- Fixed naming of output files of `downsample` command

## New Presets

Expand Down
6 changes: 3 additions & 3 deletions regression/cli-help/downsample.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ Downsample clonesets.
Paths to input files.
--downsampling <type> Choose downsampling applied to normalize the clonesets. Possible
values:
count-[reads|TAG]-[auto|min|fixed][-<number>]
top-[reads|TAG]-[<number>]
cumtop-[reads|TAG]-[percent]
count-[reads|TAG|molecule]-[auto|min|fixed-<number>]
top-[reads|TAG|molecule]-[<number>]
cumtop-[reads|TAG|molecule]-[percent]
-c, --chains <chains>[,<chains>...]
Specify chains
--only-productive Filter out-of-frame sequences and sequences with stop-codons.
Expand Down
6 changes: 3 additions & 3 deletions regression/cli-help/overlapScatterPlot.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ Plot overlap scatter-plot.

--downsampling (<type>|none)
Choose downsampling applied to normalize the clonesets. Possible values:
count-[reads|TAG]-[auto|min|fixed][-<number>]
top-[reads|TAG]-[<number>]
cumtop-[reads|TAG]-[percent]
count-[reads|TAG|molecule]-[auto|min|fixed-<number>]
top-[reads|TAG|molecule]-[<number>]
cumtop-[reads|TAG|molecule]-[percent]
--chains <chain>[,<chain>...]
Chains to export.
--only-productive Filter out-of-frame sequences and sequences with stop-codons.
Expand Down
6 changes: 3 additions & 3 deletions regression/cli-help/postanalysis/individual.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ Run postanalysis for CDR3 metrics, diversity, V/J/VJ-usage, CDR3/V-Spectratype m
--default-downsampling (<type>|none)
Default downsampling applied to normalize the clonesets. Possible
values:
count-[reads|TAG]-[auto|min|fixed][-<number>]
top-[reads|TAG]-[<number>]
cumtop-[reads|TAG]-[percent]
count-[reads|TAG|molecule]-[auto|min|fixed-<number>]
top-[reads|TAG|molecule]-[<number>]
cumtop-[reads|TAG|molecule]-[percent]
--default-weight-function (<read>|<Tag>|none)
Default clonotype weight function
--only-productive Filter out-of-frame sequences and sequences with stop-codons.
Expand Down
6 changes: 3 additions & 3 deletions regression/cli-help/postanalysis/overlap.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ Overlap analysis
--default-downsampling (<type>|none)
Default downsampling applied to normalize the clonesets. Possible
values:
count-[reads|TAG]-[auto|min|fixed][-<number>]
top-[reads|TAG]-[<number>]
cumtop-[reads|TAG]-[percent]
count-[reads|TAG|molecule]-[auto|min|fixed-<number>]
top-[reads|TAG|molecule]-[<number>]
cumtop-[reads|TAG|molecule]-[percent]
--default-weight-function (<read>|<Tag>|none)
Default clonotype weight function
--criteria <s> Overlap criteria. Defines the rules to treat clones as equal. It allows
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2014-2023, MiLaboratories Inc. All Rights Reserved
* Copyright (c) 2014-2024, MiLaboratories Inc. All Rights Reserved
*
* Before downloading or accessing the software, please read carefully the
* License Agreement available at:
Expand Down Expand Up @@ -103,12 +103,12 @@ class CommandDownsample : MiXCRCommandWithOutputs() {
val fileNameWithoutExtension = input.fileName.toString()
.replace(".clna", "")
.replace(".clns", "")
val suffix = when {
chains == null || chains!!.isEmpty() -> ""
chains!!.size == 1 -> "${chains!!.first()}."
else -> "$chains."
val secondSuffix = when {
chains == null || chains!!.isEmpty() -> null
chains!!.size == 1 -> "${chains!!.first()}"
else -> "$chains"
}
val outName = "$fileNameWithoutExtension.$suffix$suffix.clns"
val outName = listOfNotNull(fileNameWithoutExtension, suffix, secondSuffix, "clns").joinToString(".")
return (outPath?.resolve(outName) ?: Paths.get(outName)).toAbsolutePath()
}

Expand Down

0 comments on commit 78c52a9

Please sign in to comment.