Skip to content

Commit

Permalink
Merge pull request #1547 from milaboratory/allels-help
Browse files Browse the repository at this point in the history
Allels help
  • Loading branch information
gnefedev authored Feb 22, 2024
2 parents 4f60620 + 20aa8f6 commit 3a94f2d
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 25 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-50-rework_analyze"
val mixcrAlgoVersion = "4.6.0-52-alleles-help"
// may be blank (will be inherited from mixcr-algo)
val milibVersion = ""
// may be blank (will be inherited from mixcr-algo or milib)
Expand Down
42 changes: 21 additions & 21 deletions regression/cli-help/findAlleles.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Usage: mixcr findAlleles [--export-library <path.(json|fasta)>]... [--export-alleles-mutations
<path>] [--dont-remove-unused-genes] [-O <key=value>]... [--report <path>]
[--json-report <path>] [--use-local-temp] [--threads <n>]
<path.(t|c)sv>] [--dont-remove-unused-genes] [-O <key=value>]... [--report
<path>] [--json-report <path>] [--use-local-temp] [--threads <n>]
[--force-overwrite] [--no-warnings] [--verbose] [--help]
(--output-template <template.clns> | --no-clns-output) (input_file.
(clns|clna)|directory)...
Expand Down Expand Up @@ -28,33 +28,33 @@ of V and J genes and the same features to align.
For `.json` library will be written in reqpseqio format.
For `.fasta` library will be written in FASTA format with gene name
and feature name in description.
--export-alleles-mutations <path>
--export-alleles-mutations <path.(t|c)sv>
Path where to write descriptions and stats for all result alleles,
existed and new.
Available columns:
alleleName - result allele name. If it's de nova, then before `-M` is
nearest known variant, M{n} is how many mutations in it and CDR3-{n}
is how many mutations in CDR3, at the end uniq hash.
geneName - gene name, the same for zigotes
geneName - gene name, the same for zygotes
type - gene type (Variable or Joining)
status - DE_NOVO: De novo alleles
FOUND_KNOWN_VARIANT: Found allele identical to one of genes in the
library, but it's not a main variant. If enoughInfo is true, then it
was found by main algorithm. In some cases gene name could be
changed. If enoughInfo is false, then it was found by aligning
clones on known variants.
ALIGNED_ON_KNOWN_VARIANT: Not enough info for search, but aligned on
known allele
NOT_CHANGED_AFTER_SEARCH: Not changed after search
NO_CLONES_TO_SEARCH: No clones to search
status - DE_NOVO: New allelic variant, that doesn't match with any
from the library.
FOUND_KNOWN_VARIANT: Known variant from the library, found by main
algorithm.
ALIGNED_ON_KNOWN_VARIANT: Not enough info for main algorithm, but the
main bulk of clones aligns with a known allele from the database.
NOT_CHANGED_AFTER_SEARCH: The found allele variant is the same as was
used in `align` command (clones are not changed).
If enoughInfo is true, then it was found by main algorithm,
otherwise, by aligning clones on known variants.
NO_CLONES_TO_SEARCH: All clones were filtered out before search (there
are filters by productivity and reads/UMI count).
COULD_NOT_BE_ALIGNED_ON_KNOWN_VARIANT: Have clones to search, but not
enough info for search and can't be aligned on known variant
REMOVED_BECAUSE_NO_TOP_HITS_IN_RESULT_FILES: No top hits in result
files
REMOVED_BECAUSE_NO_TOP_HITS_IN_SOURCE_FILES: No top hits in source
files
enough info for search and can't be aligned on known variant.
REMOVED_BECAUSE_NO_TOP_HITS_IN_RESULT_FILES: Removed because no top
hits in any result clone.
REMOVED_BECAUSE_NOT_REPRESENTED_IN_SOURCE_FILES: Not represented in
source files
source clones.
.
enoughInfo - is there enough clones to search by the main algorithm.
mutations - list of mutations for de nova alleles.
Expand All @@ -76,7 +76,7 @@ of V and J genes and the same features to align.
filteredForAlleleSearchClonesCountWithNegativeScoreChange - how many
clones get lower score after aligned to this allele and was used in
searching before
scoreDelta - stats for score change of clones afeter aligning to this
scoreDelta - stats for score change of clones after aligning to this
allele.
--dont-remove-unused-genes
Don't remove genes that weren't used in clones in the result library
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ class CommandFindAlleles : MiXCRCommandWithOutputs() {
"Path where to write descriptions and stats for all result alleles, existed and new.",
"Available columns:",
"alleleName - result allele name. If it's de nova, then before `-M` is nearest known variant, M{n} is how many mutations in it and CDR3-{n} is how many mutations in CDR3, at the end uniq hash.",
"geneName - gene name, the same for zigotes",
"geneName - gene name, the same for zygotes",
"type - gene type (Variable or Joining)",
"status - ${AlleleSearchResult.Status.helpDescription}.",
"enoughInfo - is there enough clones to search by the main algorithm.",
Expand All @@ -165,10 +165,10 @@ class CommandFindAlleles : MiXCRCommandWithOutputs() {
"filteredForAlleleSearchNaivesCount - how many naive clones aligned to this allele and was used in searching.",
"filteredForAlleleSearchClonesCount - how many clones aligned to this allele and was used in searching.",
"filteredForAlleleSearchClonesCountWithNegativeScoreChange - how many clones get lower score after aligned to this allele and was used in searching before",
"scoreDelta - stats for score change of clones afeter aligning to this allele."
"scoreDelta - stats for score change of clones after aligning to this allele."
],
names = ["--export-alleles-mutations"],
paramLabel = "<path>",
paramLabel = "<path.(t|c)sv>",
order = OptionsOrder.main + 10_200
)
var allelesMutationsOutput: Path? = null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,13 @@
package com.milaboratory.mixcr.cli

import com.milaboratory.app.ValidationException
import com.milaboratory.mixcr.alleles.AlleleSearchResult
import com.milaboratory.util.TempFileDest
import com.milaboratory.util.TempFileManager
import io.kotest.assertions.asClue
import io.kotest.matchers.collections.shouldContainExactlyInAnyOrder
import io.kotest.matchers.string.shouldContain
import io.kotest.matchers.string.shouldNotContain
import io.kotest.matchers.string.shouldStartWith
import org.junit.Assert
import org.junit.Before
Expand All @@ -39,6 +43,20 @@ class CommandFindAllelesTest {
file3.toFile().createNewFile()
}

@Test
fun `check that help contains all not hidden statuses`() {
AlleleSearchResult.Status.values().filter { !it.hideInReport }.forEach { status ->
status.asClue {
AlleleSearchResult.Status.helpDescription shouldContain status.name
}
}
AlleleSearchResult.Status.values().filter { it.hideInReport }.forEach { status ->
status.asClue {
AlleleSearchResult.Status.helpDescription shouldNotContain status.name
}
}
}

@Test
fun outputsWrittenToCommonDirectory() {
val p = Main.parseArgs(
Expand Down

0 comments on commit 3a94f2d

Please sign in to comment.