Skip to content

mixcr findAlleles

By default, all build-it MiXCR reference libraries have a single 00 allele for each gene (e.g. IGHV7-4-100, IGHV3-4700 etc.). Because it is quite complicated to distinguish a true allelic variant from sample preparation errors or hypermutations (for B cells),including those in hot spot positions, MiXCR uses a dedicated algorithm that looks at the presence of certain gene sequence across multiple different clones from the same organism to validate allelic variants with sufficient statistical significance. mixcr findAlleles finds V- and J-gene allelic variants in a given sample(s), creates a new reference library and re-aligns clonotypes against it, inferring alleles in place of original 00.

Clonotypes passed as input must be assembled by the same gene feature. So, for example .clns files with contigs, must be assembled using assembleContigs with --assemble-contigs-by option. All input '.clns' files must have been generated using the same initial reference library, with the same scoring of V and J genes and the same features to align.

Note, that allelic inference requires presence of a substantial amount of clones for a given V/J gene to return a statistically significant result. If the information from the data was not enough to determine an allele for a certain gene, this gene will retain original *00 allele number.

Command line options

mixcr findAlleles 
   (--output-template <template.clns> | --no-clns-output) 
   [--export-library <path.(json|fasta)>] 
   [--export-alleles-mutations <path>] 
   [-O <key=value>]... 
   [--report <path>] 
   [--json-report <path>] 
   [--threads <n>] 

The command returns a highly-compressed, memory- and CPU-efficient binary .clns (clones) file that holds exhaustive information about clonotypes re-aligned to novelly discovered allelic variants. The resulting reference library is built-in in the .clns file but also may be exported directly with --export-library option. Clonotype tables can be further extracted in tabular form using exportClones or in human-readable form using exportClonesPretty. Additionally, MiXCR produces a comprehensive report which provides a detailed summary of allele search.

Basic command line options are:

Input files or directory with files for allele search.

In case of directory no filter by file type will be applied.

--output-template <template.clns>
Output template may contain {file_name} and {file_dir_path},

outputs for '-o /output/folder/{file_name}_with_alleles.clns input_file.clns input_file2.clns' will be /output/folder/input_file_with_alleles.clns and /output/folder/input_file2_with_alleles.clns,

outputs for '-o {file_dir_path}/{file_name}_with_alleles.clns /some/folder1/input_file.clns /some/folder2/input_file2.clns' will be /seme/folder1/input_file_with_alleles.clns and /some/folder2/input_file2_with_alleles.clns

Resulted outputs must be uniq

Command will not realign input clns files. Must be specified if --output-template is omitted.
--export-library <path.(json|fasta)>
Paths where to write library with found alleles and other genes that exits in inputs.

For .json library will be written in reqpseqio format.

For .fasta library will be written in FASTA format with gene name and reliable range in description. There will be several records for one gene if clnx were assembled by composite gene feature.

--export-alleles-mutations <path>
Path to write descriptions and stats (see below) for all result alleles, existed and new (see below).
-O <key=value>
Overrides default build SHM parameter values
-r, --report <path>
Report file (human-readable version, see -j / --json-report for machine-readable report).
-j, --json-report <path>
JSON formatted report file.
Put temporary files in the same folder as the output files.
-t, --threads <n>
Processing threads
-f, --force-overwrite
Force overwrite of output file(s).
-nw, --no-warnings
Suppress all warning messages.
do not remove genes that were not found in the sample(s) from the new library.
Verbose messages.
-h, --help
Show this help message and exit.
-r, --report <reportFile>
Report file (human readable version, see -j / --json-report for machine readable report)
-j, --json-report <jsonReport>
JSON formatted report file
-t, --threads <threads>
Specify number of processing threads
-O <String=String>
Overrides default find alleles parameter values (see below).


mixcr findAlleles \
    --output-template {file_name}.allelic.clns \
    --output-library alleles.repseqio.json \
    --export-alleles-mutations allele_stats.tsv \
    donor1_t1.clns donor1_t2.clns donor1_t3.clns

Allelic variants summary table

Summary table produced with --export-alleles-mutations contain the following columns:

allele name in a resulting library; for novel allelic variants will contain count of mutations from known allele and number of mutations in CDR3. Some alleles will still have *00 due to the lack of data for statistical significant identification.
gene name; the same for heterozygous
Variable or Joining gene segment.
DE_NOVO - new allelic variant aligned to the known one with mismatches FOUND_KNOWN_VARIANT - known allele from the database ALIGNED_ON_KNOWN_VARIANT - not enough info to search all present alleles. But the one found is a known variant from the library NOT_CHANGED_AFTER_SEARCH - the allele was originally identified correctly COULD_NOT_BE_ALIGNED_ON_KNOWN_VARIANT - the search was done, but there was not enough info to identify the allele correctly NO_CLONES_TO_SEARCH - not enough clones to perform the search REMOVED_BECAUSE_NO_TOP_HITS_IN_RESULT_FILES - there is no clone where this gene is the top hit REMOVED_BECAUSE_NOT_REPRESENTED_IN_SOURCE_FILES - this gene was not present in the original data
true or false value states if there was enough info to infer an allele.
gene features inside which allele was found (including CDR3 part that was used for search)
allele mutations from known other allelic variant
refers to the identifier of a known allelic variant from which the current variant has mutated.
count of clones with no hypermutations in V and J
lower bound of diversity of clones. The number of combinations of a J for V gene( and V for gene) with different CDR3 length.
clones count that was aligned to this allele
total clones count of this allele and its zygotes (the same geneName). Before realignment.
count of clones that align better on original library than on build one
counts of clones with no mutations in V and J after useClonesWithCountGreaterThen filter.
counts of clones after useClonesWithCountGreaterThen filter
count of clones that align better on original library than on build one after useClonesWithCountGreaterThen filter
stats of score change of clones after realignment (size, sum, min, max, avg, quadraticMean, stdDeviation)

Allele inference algorithm parameters

Below one can find parameters of inference algorithms that may be tuned.

If data has UMI tag then search alleles only by clones with count greater or equal to value (default 0).
If data has no UMI tag then search alleles only by clones with count greater or equal to value (default 1).
Percentage to get top of alleles by lower bound of diversity (default 0.25).
On decision about clone matching to allele will check relation between score penalties between the best and the next alleles (default 0.15).
After an allele is found, it will be enriched with mutations that exists in this portion of clones that aligned on the allele (default 0.95).
Alleles will be filtered by min count of clones that are naive by complementary gene (default 2).
Min percentage from max diversity (count of different CDR3 length multiply by count of uniq complementary genes) of mutation for it may be considered as a candidate for allele mutation (default 0.03).
Filter out allele candidates with percentage from max diversity (count of different CDR3 length multiply by count of uniq complementary genes) less than this parameter (default 0.03).
If percentage from max diversity (count of different CDR3 length multiply by count of uniq complementary genes) of zero allele greater or equal to this, than it will not be tested by diversity ratio (default 0.1).
Letter must be represented in not less than minClonesCount clones (default 5).
Portion of clones from group that must have the same letter (default 0.7).
Letter must be represented by not less than minDiversity percentage of diversity by complementary gene (default 0.5).
If searchMutationsInCDR3 set to null there will be no search for mutations in CDR3