BrepPhylo
B-cell repertoire lineage trees with class-switch analysis
What it does
BrepPhylo is an R package that reconstructs evolutionary lineages of B-cell clonotypes from high-throughput immunoglobulin sequencing data. It wraps established phylogenetic tools so researchers can build lineage trees, identify Class-Switch Recombination (CSR) events, and generate interpretable outputs.
It accepts AIRR / rearrangement tables, supports simple-parsimony, DNAPARS and IgPhyML tree construction, uses species-specific germline V(D)J references, and can process either raw sequences (with alignment) or IMGT-gapped alignments.
- Tree construction via simple parsimony, DNAPARS or IgPhyML
- Class-Switch Recombination (CSR) / arborescence analysis
- Species-specific germline reference handling (with custom germline sets)
- Handles both raw sequences (MSA) and IMGT-gapped alignments
- Per-clone and gathered phylogeny plots in several styles
Accepted input types
| Input type | What the framework does with it |
|---|---|
| TSV | AIRR / rearrangement table (tab-separated). Columns for sequence, clone ID and germline allele are selected by name; clones below the size threshold are dropped. |
| CSV | The same rearrangement table in comma-separated form. |
Form fields
Every field shown in this method's form, generated from the package's field definitions so it always matches the live form. The mapping column is filled only where a field corresponds clearly to a native method parameter.
Input Columns
| Field | What it is / used for | Allowed values | Default | Maps to method parameter | Visible when |
|---|---|---|---|---|---|
Sequence column sequence_columnRequired | Column containing BCR nucleotide sequences (gapped or ungapped). | text | sequence | — | Always |
Clone ID column clone_id_columnRequired | Column used to group sequences into clones. | text | clone_id | — | Always |
Germline/allele column germline_id_columnRequired | Column storing V germline IDs or alleles that BrepPhylo will map to its germline database. | text | V.GENE.and.allele | — | Always |
Label column label_column | Optional human-readable label for tips; falls back to sequence order if empty. | text | — | — | Always |
Clone Selection
| Field | What it is / used for | Allowed values | Default | Maps to method parameter | Visible when |
|---|---|---|---|---|---|
Restrict to clone IDs which_clones | Optional list of clone IDs to include, as a comma/space/semicolon-separated string (e.g. 'c1, c2 c3'). Empty means all clones. Mutually exclusive with ignore_clones. | text | — | — | Always |
Ignore clone IDs ignore_clones | Optional list of clone IDs to exclude, as a comma/space/semicolon-separated string. Mutually exclusive with which_clones. | text | — | — | Always |
Minimum clone size min_clone_sizeRequired | Discard clones with fewer sequences than this threshold before tree building. | integer (≥ 1) | 10 | — | Always |
Input Preparation
| Field | What it is / used for | Allowed values | Default | Maps to method parameter | Visible when |
|---|---|---|---|---|---|
Input sequence mode input_sequence_modeRequired | raw_sequence: sequences are not assumed IMGT-gapped; BrepPhylo may run MSA. aligned_imgt_gapped: sequences are already IMGT-gapped/aligned; alignment algorithm is not used. | raw_sequence, aligned_imgt_gapped | raw_sequence | — | Always |
Species speciesRequired | Species identifier for selecting BrepPhylo germline references. Use 'custom' to supply a germline FASTA via the textarea below. | Homo_sapiens, Mus_musculus, Bos_taurus, Gallus_gallus, Oryctolagus_cuniculus, Sus_scrofa, custom | Homo_sapiens | Selects the BrepPhylo germline reference set for the organism. | Always |
Custom germline set germline_set_text | Copy file content of IMGT-format germline V-gene FASTA. Required when species = 'custom'. | text | — | Custom IMGT-format germline V-gene FASTA (used when species = custom). | Shown when Species = custom |
Alignment algorithm algorithm | Multiple sequence aligner; only used when input_sequence_mode = 'raw_sequence'. | ClustalOmega, ClustalW | ClustalOmega | Multiple-sequence aligner used for raw sequences (ClustalOmega or ClustalW). | Shown when Input sequence mode = raw_sequence |
Tree Inference
| Field | What it is / used for | Allowed values | Default | Maps to method parameter | Visible when |
|---|---|---|---|---|---|
Tree inference method tree_typeRequired | Tree construction method passed to treeConstruction$type ('simple', 'dnapars', or 'igphyml'). | simple, dnapars, igphyml | dnapars | BrepPhylo treeConstruction$type (simple, dnapars or igphyml). | Always |
Collapse identical sequences (dnapars) collapse_and_replace | If true, collapse identical sequences before parsimony reconstruction and re-expand afterwards (tree_type = 'dnapars'). | Yes / No | Yes | DNAPARS collapse-identical-then-re-expand option (tree_type = dnapars). | Shown when Tree inference method = dnapars |
IgPhyML accuracy preset igphyml_accuracy | Accuracy preset passed to IgPhyML (basic, high, or extreme); only used when tree_type = 'igphyml'. | basic, high, extreme | basic | IgPhyML accuracy preset (basic, high, extreme). | Shown when Tree inference method = igphyml |
Write alignment PDF make_alignment_pdf | Generate alignment PDF per clone (makeAlignmentPDFConstruction). Requires LaTeX in the runtime environment. | Yes / No | No | BrepPhylo makeAlignmentPDFConstruction (per-clone alignment PDF; needs LaTeX). | Always |
Output Plots
| Field | What it is / used for | Allowed values | Default | Maps to method parameter | Visible when |
|---|---|---|---|---|---|
Plot type plot_typeRequired | Plot flavour used by BrepPhylo. | phylogram, cladogram, fan, radial | phylogram | — | Always |
Plot format plot_formatRequired | Output format for phylogeny plots. | png, pdf | png | — | Always |
Gather plots gather_plots | Gather individual clone plots into a combined PDF where supported. | Yes / No | Yes | — | Always |
CSR / Isotype Analysis
| Field | What it is / used for | Allowed values | Default | Maps to method parameter | Visible when |
|---|---|---|---|---|---|
Enable CSR / isotype analysis enable_csr_analysis | Run class-switch recombination and arborescence analysis after tree inference. | Yes / No | Yes | — | Always |
Isotype/subclass column isotype_column | Column containing isotype or subclass labels for CSR analysis. Required when enable_csr_analysis = true. | text | — | — | Shown when Enable CSR / isotype analysis is enabled |
Conditional fields & behaviour
- The collapse option appears only for DNAPARS; the IgPhyML accuracy preset only for IgPhyML.
- The alignment algorithm appears only for raw-sequence input; the custom germline textarea only when species = custom; the isotype column only when CSR analysis is enabled.
- Restrict-to-clone-IDs and ignore-clone-IDs are mutually exclusive.
Conditionally required
- Custom germline set is required when species is 'custom'.
- Isotype/subclass column is required when CSR analysis is enabled.
Mutually exclusive
- Restrict to clone IDs and Ignore clone IDs are mutually exclusive.