# CDR3AAPhyschem

CDR3 AA physicochemical feature analysis

The idea is to perform a regression between two groups of cells
(e.g. Treg vs Tconv) at different length of CDR3 AA sequences.<br />
The regression will be performed for each physicochemical feature of the
AA (hydrophobicity, volume and isolectric point).<br />

## Input

- `scrfile`:
    The data loaded by `ScRepCombiningExpression`, saved in RDS or qs/qs2 format.<br />
    The data is actually generated by `scRepertiore::combineExpression()`.<br />
    The data must have both TRA and TRB chains.<br />

## Output

- `outdir`: *Default: `{{in.immdata | stem}}.cdr3aaphyschem`*. <br />
    The output directory

## Environment Variables

- `group`:
    The key of group in metadata to define the groups to
    compare. For example, `CellType`, which has cell types annotated
    for each cell in the combined object (immdata + Seurat metadata)
- `comparison` *(`type=auto`)*:
    A dict of two groups, with keys as the
    group names and values as the group labels. For example,
    ```toml
    Treg = ["CD4 CTL", "CD4 Naive", "CD4 TCM", "CD4 TEM"]
    Tconv = "Tconv"
    ```
    Or simply a list of two groups, for example, `["Treg", "Tconv"]` when
    they are both in the `group` column.<br />
- `target`:
    Which group to use as the target group. The target
    group will be labeled as 1, and the other group will be labeled as
    0 in the regression.<br />
    If not specified, the first group in `comparison` will be used as
    the target group.<br />
- `each` *(`auto`)*:
    A column, or a list of columns or a string of columns separated by comma.<br />
    The columns will be used to split the data into multiple groups and the regression will be
    applied to each group separately.<br />
    If not provided, all the cells will be used.<br />

## Reference

- [Stadinski, Brian D., et al. "Hydrophobic CDR3 residues promote the development of self-reactive T cells." Nature immunology 17.8 (2016): 946-955.](https://www.nature.com/articles/ni.3491)
- [Lagattuta, Kaitlyn A., et al. "Repertoire analyses reveal T cell antigen receptor sequence features that influence T cell fate." Nature immunology 23.3 (2022): 446-457.](https://www.nature.com/articles/s41590-022-01129-x)
- [Wimley, W. C. & White, S. H. Experimentally determined hydrophobicity scale for proteins at membrane - interfaces. Nat. Struct. Biol. 3, 842-848 (1996).](https://www.nature.com/articles/nsb1096-842)
- [Handbook of chemistry & physics 72nd edition. (CRC Press, 1991).](https://books.google.com/books?hl=en&lr=&id=bNDMBQAAQBAJ&oi=fnd&pg=PP1&dq=Hdbk+of+chemistry+%26+physics&ots=H9fzwhwz-C&sig=EXHI9N3q4OW9TYEBWlldqkvADfM#v=onepage&q=Hdbk%20of%20chemistry%20%26%20physics&f=false)
- [Zamyatnin, A. A. Protein volume in solution. Prog. Biophys. Mol. Biol. 24, 107-123 (1972).](https://www.sciencedirect.com/science/article/pii/0079610772900053)

