Skip to content

This repo contains the sourcecode for the paper: Translational robustness of neural networks trained for transcription factor binding site classification.

Notifications You must be signed in to change notification settings

istvanmegyeri/tf_translational_robustness

Repository files navigation

Translational robustness of neural networks trained for transcription factor binding site classification

This repo contains the sourcecode for the paper: Translational robustness of neural networks trained for transcription factor binding site classification

Evironment setup

conda create -n env_name python=3.6
conda activate env_name
conda install tensorflow-gpu==2.1

Datasets

Data conversion from .mat to .npz can be done by:
python convert_data.py --in_fname path_to_mat --out_fname path_to_output_npz

Alternatively, you can download our converted data from here.

Model training

Our best models can be downloaded from here.

  • on Ds dataset:
python train_zeng.py --attack attacks.MiddleCrop --fname path_to_data  
python train_zeng.py --attack attacks.RandomCrop --fname path_to_data
python train_zeng.py --attack attacks.WorstCrop --fname path_to_data
  • on Dl dataset:
python train_tbinet.py --attack attacks.MiddleCrop --data_dir path_to_data_dir  
python train_tbinet.py --attack attacks.RandomCrop --data_dir path_to_data_dir
python train_tbinet.py --attack attacks.WorstCrop --data_dir path_to_data_dir

Model evaluation

  • on Ds dataset:
python eval_trans_attack.py --attack attacks.MiddleCrop --model_path path_to_model --data_path path_to_data --seq_length [75|90|95|101] --metric acc
python eval_trans_attack.py --attack attacks.RandomCrop --model_path path_to_model --data_path path_to_data --seq_length [75|90|95|101] --metric acc
python eval_trans_attack.py --attack attacks.WorstCrop --model_path path_to_model --data_path path_to_data --seq_length [75|90|95|101] --metric acc --loss xe
  • on Dl dataset:
python eval_trans_attack.py --attack attacks.MiddleCrop --model_path path_to_model --data_path path_to_test_set --seq_length [900|1000] --metric auc,aupr
python eval_trans_attack.py --attack attacks.RandomCrop --model_path path_to_model --data_path path_to_test_set --seq_length [900|1000] --metric auc,aupr
python eval_trans_attack.py --attack attacks.WorstCrop --model_path path_to_model --data_path path_to_test_set --seq_length [900|1000] --metric auc,aupr --loss bce --n_try 20

Results of the Evaluations: here

About

This repo contains the sourcecode for the paper: Translational robustness of neural networks trained for transcription factor binding site classification.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published