# ScRepCombiningExpression

Combine the scTCR/BCR data with the expression data

This process combines the scTCR/BCR data with the expression data using
`scRepertoire::combineExpression` function. The expression data should be
in `Seurat` format. The `scRepertoire` object should be a combined contig
object, usually generated by `scRepertoire::combineTCR` or
`scRepertoire::combineBCR`.<br />

See also: <https://www.borch.dev/uploads/screpertoire/reference/combineexpression>.<br />

## Input

- `screpfile`:
    The `scRepertoire` object in RDS/qs format
- `srtobj`:
    The `Seurat` object, saved in RDS/qs format

## Output

- `outfile`: *Default: `{{in.screpfile | stem}}.qs`*. <br />
    The `Seurat` object with the TCR/BCR data combined
    In addition to the meta columns added by
    `scRepertoire::combineExpression()`, a new column `VDJ_Presence` will be
    added to the metadata. It indicates whether the cell has a TCR/BCR
    sequence or not. The value is `TRUE` if the cell has a TCR/BCR sequence,
    and `FALSE` otherwise.<br />

## Environment Variables

- `cloneCall`: *Default: `aa`*. <br />
    How to call the clone - VDJC gene (gene), CDR3 nucleotide (nt),
    CDR3 amino acid (aa), VDJC gene + CDR3 nucleotide (strict) or
    a custom variable in the data.<br />
- `chain`: *Default: `both`*. <br />
    indicate if both or a specific chain should be used
    e.g. "both", "TRA", "TRG", "IGH", "IGL".<br />
- `group_by`: *Default: `Sample`*. <br />
    The column label in the combined clones in which clone frequency will
    be calculated. NULL or "none" will keep the format of input.data.<br />
- `proportion` *(`flag`)*: *Default: `True`*. <br />
    Whether to proportion (TRUE) or total frequency (FALSE) of
    the clone based on the group_by variable.<br />
- `filterNA` *(`flag`)*: *Default: `False`*. <br />
    Method to subset Seurat/SCE object of barcodes without clone
    information
- `cloneSize` *(`type=json`)*: *Default: `{'Rare': 0.0001, 'Small': 0.001, 'Medium': 0.01, 'Large': 0.1, 'Hyperexpanded': 1}`*. <br />
    The bins for the grouping based on proportion or
    frequency.<br />
    If proportion is FALSE and the cloneSizes are not set high enough based on
    frequency, the upper limit of cloneSizes will be automatically updated.<br />
- `addLabel` *(`flag`)*: *Default: `False`*. <br />
    This will add a label to the frequency header, allowing the
    user to try multiple group_by variables or recalculate frequencies after
    subsetting the data.<br />

