InfluenceNet is a transparent convolutional neural network designed for accurate prediction and mechanistic interpretation of cis-regulatory grammar. Unlike traditional deep learning approaches that require extensive post-hoc analysis, InfluenceNet directly encodes motif influence — a position- and motif-specific profile quantifying how one motif modulates binding at another.
See our preprint for more information.
git clone https://github.com/chikinalab/InfluenceNet.git
cd InfluenceNet
conda create -n influencenet python=3.9
conda activate influencenet
pip install -e .We provide a quick-start notebook example/example.ipynb that demonstrates a minimal example of training InfluenceNet model on a subset dataset and visualizing interpretable parameters.
Below is a general workflow for training an InfluenceNet model to predict ChIP–nexus profiles for a single transcription factor.
Required input data:
- Genome fasta file, e.g.
mm10.fa - BigWig profiles together with a BED file of all the peak summits.
In our study, we used data from BPNet including ChIP-nexus profiles for Oct4, Sox2, Nanog and Klf4.
We also did smoothing on the bigwig tracks by running influencenet/data_preprocessing/smoothBW.py.
Generate training datasets:
python influencenet/data_preprocessing/prepare_data.py \
--bw_data_dir data/bigwig \
--TFs Sox2 Oct4 Klf4 Nanog \
--strands pos neg \
--output_type=benchmark \
--arcsinh_transformbw_data_dir is a directory containing all bigwig profiles and corresponding peak bed file.
output_type options:
benchmark- creates chromosome-based five-fold splits.interpret- generates reverse complement (RC) inputs and targets. Used for training models for inspecting learned parameters e.g. influence.
This will generate five-folds data for each TF (each saved as a .pt file).
As an example,
factor="Oct4"
experiment="interpret"
fold=0
seed=0
influencenet_train \
--train_data_path=data/training_data/${experiment}/${factor}__pos_neg__arcsinh/fold${fold}.pt \
--genome_file=data/genome/mm10.fa \
--pfm_dir=data/PFMs \
--model_savedir=res/checkpoints/influencenet/${experiment}/${factor} \
--model=influencenet \
--n_epochs=50 \
--seed=$seedtrain_data_path - with dataset generated from the previous step
pfm_dir - contains motif PFM matrixes that will be learned by the model
model options:
influencenet- InfluenceNet architecturebasecnn- Baseline footprint-only model
All the codes for downstream analysis and generating figures in the paper can be found in notebooks/figures.
