Skip to content

chikinalab/InfluenceNet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

InfluenceNet

Overview

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.

Installation

git clone https://github.com/chikinalab/InfluenceNet.git
cd InfluenceNet
conda create -n influencenet python=3.9
conda activate influencenet
pip install -e .

Quick Example

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.

Usage

Below is a general workflow for training an InfluenceNet model to predict ChIP–nexus profiles for a single transcription factor.

Preparing Training Data

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_transform

bw_data_dir is a directory containing all bigwig profiles and corresponding peak bed file.

output_type options:

  1. benchmark - creates chromosome-based five-fold splits.
  2. 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).

Training the Model

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=$seed

train_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 architecture
  • basecnn - Baseline footprint-only model

Analysis and Visualization

All the codes for downstream analysis and generating figures in the paper can be found in notebooks/figures.

About

No description, website, or topics provided.

Resources

License

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors