ClonalTree

Minimum-spanning-tree B-cell lineage reconstruction

github.com/julibinho/ClonalTree
Accepts:TSVCSV

What it does

ClonalTree reconstructs B-cell receptor lineage trees from clonally related sequences. It uses a minimum-spanning-tree algorithm combined with genotype abundance information to infer parsimonious trees representing the evolutionary relationships within a clone.

In this framework it runs an AIRR/IMGT processing pipeline — formatting and labelling, initial clustering, optional refinement, two-level clonotype grouping, and clonal-tree construction — and outputs trees in Newick format plus parent/cost tables.

  • Minimum-spanning-tree lineage reconstruction with abundance weighting
  • AIRR/IMGT formatting, clustering and refinement pipeline
  • Configurable distance methods (V, J, CDR3) and clonotype grouping (L1–L5)
  • Optional tree revision
  • Newick output plus parent-relationship / cost tables

Accepted input types

Input typeWhat the framework does with it
TSVAIRR / IMGT HighV-QUEST table (tab-separated), fed into the formatting and clustering pipeline. Enable column mapping if headers differ from the canonical keys.
CSVComma-separated table; converted to TSV when possible before the pipeline runs.

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 Mapping

FieldWhat it is / used forAllowed valuesDefaultMaps to method parameterVisible when
Enable input column mappingdoMapping
When true, map uploaded tabular headers to canonical ClonalTree AIRR keys before safe conversions.Yes / NoNoN/A (wrapper-specific)Always
Sequence ID columncolumn_map.sequence_id
textN/A (wrapper-specific)Shown when Enable input column mapping is enabled
Full sequence columncolumn_map.sequence
textN/A (wrapper-specific)Shown when Enable input column mapping is enabled
Productive columncolumn_map.productive
textN/A (wrapper-specific)Shown when Enable input column mapping is enabled
V call columncolumn_map.v_call
textN/A (wrapper-specific)Shown when Enable input column mapping is enabled
D call columncolumn_map.d_call
textN/A (wrapper-specific)Shown when Enable input column mapping is enabled
J call columncolumn_map.j_call
textN/A (wrapper-specific)Shown when Enable input column mapping is enabled
V identity columncolumn_map.v_identity
textN/A (wrapper-specific)Shown when Enable input column mapping is enabled
D identity columncolumn_map.d_identity
textN/A (wrapper-specific)Shown when Enable input column mapping is enabled
J identity columncolumn_map.j_identity
textN/A (wrapper-specific)Shown when Enable input column mapping is enabled
Sequence alignment columncolumn_map.sequence_alignment
textN/A (wrapper-specific)Shown when Enable input column mapping is enabled
J sequence alignment columncolumn_map.j_sequence_alignment
textN/A (wrapper-specific)Shown when Enable input column mapping is enabled and Run refinement step is enabled
V sequence alignment columncolumn_map.v_sequence_alignment
textN/A (wrapper-specific)Shown when Enable input column mapping is enabled and Run refinement step is enabled
J sequence alignment aa columncolumn_map.j_sequence_alignment_aa
textN/A (wrapper-specific)Shown when Enable input column mapping is enabled and Run refinement step is enabled
V sequence alignment aa columncolumn_map.v_sequence_alignment_aa
textN/A (wrapper-specific)Shown when Enable input column mapping is enabled and Run refinement step is enabled
Junction aa columncolumn_map.junction_aa
textN/A (wrapper-specific)Shown when Enable input column mapping is enabled
CDR3 aa columncolumn_map.cdr3_aa
textN/A (wrapper-specific)Shown when Enable input column mapping is enabled
CDR1 columncolumn_map.cdr1
textN/A (wrapper-specific)Shown when Enable input column mapping is enabled
CDR2 columncolumn_map.cdr2
textN/A (wrapper-specific)Shown when Enable input column mapping is enabled
CDR3 nucleotide columncolumn_map.cdr3
textN/A (wrapper-specific)Shown when Enable input column mapping is enabled
FWR1 columncolumn_map.fwr1
textN/A (wrapper-specific)Shown when Enable input column mapping is enabled
FWR2 columncolumn_map.fwr2
textN/A (wrapper-specific)Shown when Enable input column mapping is enabled
FWR3 columncolumn_map.fwr3
textN/A (wrapper-specific)Shown when Enable input column mapping is enabled
FWR4 columncolumn_map.fwr4
textN/A (wrapper-specific)Shown when Enable input column mapping is enabled
V germline alignment columncolumn_map.v_germline_alignment
textN/A (wrapper-specific)Shown when Enable input column mapping is enabled
D germline alignment columncolumn_map.d_germline_alignment
textN/A (wrapper-specific)Shown when Enable input column mapping is enabled
J germline alignment columncolumn_map.j_germline_alignment
textN/A (wrapper-specific)Shown when Enable input column mapping is enabled
NP1 columncolumn_map.np1
textN/A (wrapper-specific)Shown when Enable input column mapping is enabled
NP2 columncolumn_map.np2
textN/A (wrapper-specific)Shown when Enable input column mapping is enabled
V sequence start columncolumn_map.v_sequence_start
textN/A (wrapper-specific)Shown when Enable input column mapping is enabled
CDR1 start columncolumn_map.cdr1_start
textN/A (wrapper-specific)Shown when Enable input column mapping is enabled
CDR1 end columncolumn_map.cdr1_end
textN/A (wrapper-specific)Shown when Enable input column mapping is enabled
CDR2 start columncolumn_map.cdr2_start
textN/A (wrapper-specific)Shown when Enable input column mapping is enabled
CDR2 end columncolumn_map.cdr2_end
textN/A (wrapper-specific)Shown when Enable input column mapping is enabled
CDR3 start columncolumn_map.cdr3_start
textN/A (wrapper-specific)Shown when Enable input column mapping is enabled
CDR3 end columncolumn_map.cdr3_end
textN/A (wrapper-specific)Shown when Enable input column mapping is enabled
D sequence start columncolumn_map.d_sequence_start
textN/A (wrapper-specific)Shown when Enable input column mapping is enabled
D sequence end columncolumn_map.d_sequence_end
textN/A (wrapper-specific)Shown when Enable input column mapping is enabled

Run Selection

FieldWhat it is / used forAllowed valuesDefaultMaps to method parameterVisible when
Run labelrun_name
Optional label used as the output prefix; defaults to the uploaded file name without extension.textAlways
Unique sequence abundance thresholdabundance_threshold
Minimum count retained during AIRR formatting (format_labeling_imgt_airr.py -t).integer (≥ 1)3ClonalTree format_labeling_imgt_airr.py -t (minimum count retained during formatting).Always
Top clones for treestop_clonesRequired
Number of top clones to analyze (top_clones.py -s / setting NUMBER_TOP_CLONE).integer (≥ 1)5ClonalTree top_clones.py -s / NUMBER_TOP_CLONE (number of top clones analysed).Always
Clonotypes per cloneclonotypes_per_cloneRequired
Comma/space-separated clonotype counts per selected clone (e.g. "30, 200" or "all").text30, 200Always

Clone Clustering

FieldWhat it is / used forAllowed valuesDefaultMaps to method parameterVisible when
Initial clone CDR3 thresholdclone_cdr3_similarityRequired
Initial clustering threshold (initial_clustering.py -t).number (0–1)0.7ClonalTree initial_clustering.py -t (initial CDR3 clustering threshold).Always

Refinement

FieldWhat it is / used forAllowed valuesDefaultMaps to method parameterVisible when
Run refinement stepuse_refinement
Run refinement.py before two-level clonotype grouping.Yes / NoYesRuns ClonalTree refinement.py before clonotype grouping.Always
V distance methodv_distance
Refinement V-distance mode: 1=Binary, 2=Levenshtein, 3=GIANA, 4=K-mers.1, 2, 3, 41Refinement V-distance mode (1 = Binary, 2 = Levenshtein, 3 = GIANA, 4 = K-mers).Always
J distance methodj_distance
Refinement J-distance mode: 1=Binary, 2=Levenshtein, 3=GIANA, 4=K-mers.1, 2, 3, 42Refinement J-distance mode (1 = Binary, 2 = Levenshtein, 3 = GIANA, 4 = K-mers).Always
CDR3 distance methodcdr3_distance
Refinement CDR3-distance mode: 1=Binary, 2=Levenshtein, 3=GIANA, 4=K-mers.1, 2, 3, 42Refinement CDR3-distance mode (1 = Binary, 2 = Levenshtein, 3 = GIANA, 4 = K-mers).Always
Distance combine methodcombine_distance
Refinement combine mode: 1=Mean, 2=Weighted Mean, 3=Harmonic Mean.1, 2, 31Refinement combine mode (1 = Mean, 2 = Weighted Mean, 3 = Harmonic Mean).Always
Merge singleton clonesmerge_singleton
Allow refinement to merge singleton clusters (setting MERGE_SINGLETON).Yes / NoYesRefinement MERGE_SINGLETON setting.Always

Clonotype Grouping

FieldWhat it is / used forAllowed valuesDefaultMaps to method parameterVisible when
Clonotype definition methodclonotype_method
Two-level clonotype method: L1, L2, L3, L4, or L5.L1, L2, L3, L4, L5L3Two-level clonotype definition method (L1–L5).Always
Clonotype similarity thresholdclonotype_similarity_threshold
Similarity threshold used by methods L4 and L5.number (0–1)0.8Always

Tree Construction

FieldWhat it is / used forAllowed valuesDefaultMaps to method parameterVisible when
Weight trees by abundancetree_use_abundance
clonal_tree.py -a 0 enables abundance weighting.Yes / NoYesClonalTree clonal_tree.py -a (abundance weighting).Always
Enable tree revisiontree_revision
clonal_tree.py -r 0 enables revision.Yes / NoYesClonalTree clonal_tree.py -r (tree revision).Always

Conditional fields & behaviour

Fields that appear or change based on other inputs
  • The column-mapping fields appear only when the mapping toggle is on; several alignment-column mappings additionally require the refinement step to be enabled.
  • The clonotype similarity threshold is used by the L4 and L5 grouping methods.