BrepPhylo

B-cell repertoire lineage trees with class-switch analysis

BrepPhylo vignette
Accepts:CSVTSV

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 typeWhat the framework does with it
TSVAIRR / rearrangement table (tab-separated). Columns for sequence, clone ID and germline allele are selected by name; clones below the size threshold are dropped.
CSVThe 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

FieldWhat it is / used forAllowed valuesDefaultMaps to method parameterVisible when
Sequence columnsequence_columnRequired
Column containing BCR nucleotide sequences (gapped or ungapped).textsequenceAlways
Clone ID columnclone_id_columnRequired
Column used to group sequences into clones.textclone_idAlways
Germline/allele columngermline_id_columnRequired
Column storing V germline IDs or alleles that BrepPhylo will map to its germline database.textV.GENE.and.alleleAlways
Label columnlabel_column
Optional human-readable label for tips; falls back to sequence order if empty.textAlways

Clone Selection

FieldWhat it is / used forAllowed valuesDefaultMaps to method parameterVisible when
Restrict to clone IDswhich_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.textAlways
Ignore clone IDsignore_clones
Optional list of clone IDs to exclude, as a comma/space/semicolon-separated string. Mutually exclusive with which_clones.textAlways
Minimum clone sizemin_clone_sizeRequired
Discard clones with fewer sequences than this threshold before tree building.integer (≥ 1)10Always

Input Preparation

FieldWhat it is / used forAllowed valuesDefaultMaps to method parameterVisible when
Input sequence modeinput_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_gappedraw_sequenceAlways
SpeciesspeciesRequired
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, customHomo_sapiensSelects the BrepPhylo germline reference set for the organism.Always
Custom germline setgermline_set_text
Copy file content of IMGT-format germline V-gene FASTA. Required when species = 'custom'.textCustom IMGT-format germline V-gene FASTA (used when species = custom).Shown when Species = custom
Alignment algorithmalgorithm
Multiple sequence aligner; only used when input_sequence_mode = 'raw_sequence'.ClustalOmega, ClustalWClustalOmegaMultiple-sequence aligner used for raw sequences (ClustalOmega or ClustalW).Shown when Input sequence mode = raw_sequence

Tree Inference

FieldWhat it is / used forAllowed valuesDefaultMaps to method parameterVisible when
Tree inference methodtree_typeRequired
Tree construction method passed to treeConstruction$type ('simple', 'dnapars', or 'igphyml').simple, dnapars, igphymldnaparsBrepPhylo 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 / NoYesDNAPARS collapse-identical-then-re-expand option (tree_type = dnapars).Shown when Tree inference method = dnapars
IgPhyML accuracy presetigphyml_accuracy
Accuracy preset passed to IgPhyML (basic, high, or extreme); only used when tree_type = 'igphyml'.basic, high, extremebasicIgPhyML accuracy preset (basic, high, extreme).Shown when Tree inference method = igphyml
Write alignment PDFmake_alignment_pdf
Generate alignment PDF per clone (makeAlignmentPDFConstruction). Requires LaTeX in the runtime environment.Yes / NoNoBrepPhylo makeAlignmentPDFConstruction (per-clone alignment PDF; needs LaTeX).Always

Output Plots

FieldWhat it is / used forAllowed valuesDefaultMaps to method parameterVisible when
Plot typeplot_typeRequired
Plot flavour used by BrepPhylo.phylogram, cladogram, fan, radialphylogramAlways
Plot formatplot_formatRequired
Output format for phylogeny plots.png, pdfpngAlways
Gather plotsgather_plots
Gather individual clone plots into a combined PDF where supported.Yes / NoYesAlways

CSR / Isotype Analysis

FieldWhat it is / used forAllowed valuesDefaultMaps to method parameterVisible when
Enable CSR / isotype analysisenable_csr_analysis
Run class-switch recombination and arborescence analysis after tree inference.Yes / NoYesAlways
Isotype/subclass columnisotype_column
Column containing isotype or subclass labels for CSR analysis. Required when enable_csr_analysis = true.textShown when Enable CSR / isotype analysis is enabled

Conditional fields & behaviour

Fields that appear or change based on other inputs
  • 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.