[[alignment-commands-summary]]
Alignment commands summary
^^^^^^^^^^^^^^^^^^^^^^^^^^

Alignment of the sequences is performed upon detection of the `-align`
switch in the command line. For each gene, alignment parameters can be
set using `--V`,`--D` or `--J`. *Specifying any of those three argument
will cause to align only the specified genes*. In order to specify a set
of parameters for all genes or force to align all genes the argument
`--all` should be passed.

The complementarity-determining region (CDR3) of the aligned sequences is
by default written on a file <batchname>_indexed_CDR3.csv in the aligns
directory when `--all` is used. In case of separated alignments the CDR3 file
can be generated by using the `--feature ---ntCDR3` option.

The arguments for setting the different
parameters are given in the table below.
If the considered sequences are nucleotide CDR3 sequences (delimited by 
its anchors on 3' and 5' sides) using the command `--ntCDR3` alignments will
be performed using gene anchors information as offset bounds.


[width="99%",cols="<32%,<68%",options="header",]
|=======================================================================
|Command line argument |Description
|`---thresh X` |Sets the score threshold for the considered gene
alignments to _X_. Default is 50.0 for V, 15.0 for D and 15.0 for J

|`---matrix path/to/file` |Sets the substitution matrix to the one given
in the file. Must be _','_ delimited. Default is a NUC44 matrix with
stronger penalty on errors (5,-14)

|`---gap_penalty X` |Sets the alignment gap penalty to X. Default is
50.0

|`---best_align_only` |If _true_ only keep the best alignment for each gene/allele.
If _false_ outputs all alignments above the score threshold. Default is
_true_ for V and J, and _false_ for D.

|`---best_gene_only` |If _true_ only keep alignments for best scoring gene candidate
 (or candidates if several genes have the same maximum score).
If _false_ outputs alignments for every aligned gene/allele. Default is
_false_ for V, D and J.

|`---offset_bounds M N` |Constrains the possible positions of the
alignments. The offset is defined as the position on the read to which
the first nucleotide of the genomic template aligns (can be negative,
e.g for V for which most of the V is on the 5' of the read and cannot be
seen). Default values are -inf and +inf. If the `--ntCDR3` command has been given 
provided offset bounds values will be used for genes with missing CDR3 anchors positions.

|`---template_spec_offset_bounds path/to/file` |Constrains the possible positions of the
alignments differently for each genomic template. The file should be a semi colon separated
file formated as follows: `gene_name;min_offset;max_offset`.
If entries are missing for some genes, values given with the `---offset_bounds` command 
will be used. If the `--ntCDR3` command has been given provided template specific offset bounds
 values will be used for genes with missing CDR3 anchors positions. If non template specific entry
 is given for the considered gene, general offset bounds values will be used.


|`---reversed_offsets` |If _true_ provided offsets are accounted for reversed offsets.
Reversed offsets are defined relative to the last nucleotide of the read instead of the first. Reversed offsets must be <=0 by construction.
|=======================================================================

