Skip to content

ChromBPNet

Georgia Goddard edited this page Jul 2, 2026 · 1 revision

Once an accurate Tn5 bias model has been generated, we can move on to training the individual bias-factorised ChromBPNet models. For generating models aligned with the cell types of the pituitary, an iterative function was designed to allow for the generation of each model without the need to manually run each one.

All models generated within this research are available on HuggingFace.

The respective bias model used for each cohort are as follows:

Bias Model Cohort for ChromBPNet Model
Tn5_bias_model_fold_0_mm10_adult_0.5 scATAC-seq adult mm10 cell types: corticotrophs, gonadotrophs, lactotrophs, melanotrophs, somatotrophs, stem cells, thyrotrophs
scATAC-seq adult mm10 KO cell types: gonadotrophs Gata2-KO, gonadotrophs Nr5a1-KO
Tn5_bias_model_fold_0_mm10_neonatal_0.9 scATAC-seq neonatal mm10 cell types: corticotrophs, gonadotrophs, lactotrophs, melanotrophs, somatotrophs, stem cells, thyrotrophs
scATAC-seq neonatal mm10 stem cell to gonadotroph pseudotime points: 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0
Tn5_bias_model_fold_0_rn6_GH3_0.9 Bulk ATAC-seq GH3 lines: CTRL, AB, ABS, SOX2
Tn5_bias_model_fold_0_mm10_AtT20_1.5 Bulk ATAC-seq AtT-20 lines: Neo, Pax7
Tn5_bias_model_fold_0_mm10_Lbt2_0.9 Bulk ATAC-seq Lbt2 line
Tn5_bias_model_fold_0_mm10_TaT1_0.9 Bulk ATAC-seq TaT1 line

Model Training

First make a directory for the trained ChromBPNet models:

mkdir ~/ChromBPNet/Models

The following function requires a list of cell types that are associated to a generated fragment file from the MergeCelltype function. The function will then run through each cell type iteratively and generate a ChromBPNet model for each.

Note: The name of the cell type must match exactly the format written within the merged fragment file.

First make a directory for the cohort specific to the models:

mkdir ~/ChromBPNet/Models/mouse

Then the function can be run:

fragment_list=("Corticotrophs" "Gonadotrophs" "Lactotrophs" "Melanotrophs" "Somatotrophs" "Stem_cells" "Thyrotrophs")

for cell in "${fragment_list[@]}"
do
        ChromBPnet \
                "$bias_model" \
                "$genome" \
                "$cell" \
                "$merged_fragments" \
                "$output_directory"
done

The function runs through each cell type, identifies whether a model has already been generated, and then runs the chrombpnet pipeline function designed by the original publication (see ChromBPNet repository)

If the model has already been generated, the script skips the cell type and runs the next. If the model was not run to completion, the function deletes all temporary files and starts the run again.

Input Format

bias_model        # Respective bias model trained (e.g., ~/ChromBPNet/Bias_Models/Tn5_bias_model_fold_0_mm10_adult_0.5)
genome            # Genome associated with the cohort studied (e.g., "mm10", "rn6", "hg38")
cell              # Cell type for the model, as defined in the fragment_list
merged_fragments  # Directory that contains all of the merged fragment files (e.g., ~/atac_seq_data/mouse_merged)
output_directory  # Output directory previously generated (e.g., ~/ChromBPNet/Models/mouse)

Output Format

As taken from the ChromBPNet repository

models\
	bias_model_scaled.h5
	chrombpnet.h5          # Final ChromBPNet model - used in all downstream analyses
	chrombpnet_nobias.h5   # TF-Model i.e model to predict bias corrected accessibility profile
logs\
	chrombpnet.log (loss per epoch)
	chrombpnet.log.batch (loss per batch per epoch)
	(..other hyperparameters used in training)
	
auxilary\
	filtered.peaks
	filtered.nonpeaks
	...

evaluation\
	overall_report.pdf    # Summary of the training and motifs learnt by the bias model with quality check guidance.
	overall_report.html   # Summary in HTML format
	bw_shift_qc.png 
	bias_metrics.json 
	chrombpnet_metrics.json
	chrombpnet_only_peaks.counts_pearsonr.png
	chrombpnet_only_peaks.profile_jsd.png
	chrombpnet_nobias_profile_motifs.pdf
	chrombpnet_nobias_counts_motifs.pdf
	chrombpnet_nobias_max_bias_response.txt
	chrombpnet_nobias.....footprint.png
	...

Evaluating the models

Model performance is assessed jointly for Tn5 bias and ChromBPNet predicted accessibility (Fig. 1A). To evaluate accurate bias removal, a low Pearson r between predicted and observed log-transformed counts in non-peaks is expected, confirming the model does not capture biological accessibility signals at non-peak regions (Fig. 1B). Neonatal models, in particular, exhibited values approaching the lower -0.3 threshold, which is attributed to the lower sequencing depth of the neonatal datasets and considered a technical consequence of data sparsity rather than model inaccuracy.

For the ChromBPNet model evaluated in peaks, a Pearson r greater than 0.5 is required, with higher values reflecting greater predictive accuracy of the accessibility profile. This component should accurately model cell-type-specific chromatin accessibility, and the correlation is therefore expected to be substantially positive (Fig. 1C).

Further model evaluation was performed using the same DeepLIFT and TF-MoDISco pipeline across all models, and the returned motifs were consistent with known regulators of the respective cell type, with no Tn5 bias motifs detected. Marginal footprinting was automatically applied in the model pipeline to the Tn5 bias reference motifs. A maximum probability response below 0.003 confirms that the model does not associate these signals with accessible chromatin. This condition was satisfied by all models (Fig. 1D).

FIG0_chrombpnet_metric_evaluations

Clone this wiki locally