{"id":42269159,"url":"https://github.com/kundajelab/chromdragonn","last_synced_at":"2026-01-27T07:11:02.222Z","repository":{"id":42563217,"uuid":"168777909","full_name":"kundajelab/ChromDragoNN","owner":"kundajelab","description":"Code for the paper \"Integrating regulatory DNA sequence and gene expression to predict genome-wide chromatin accessibility across cellular contexts\"","archived":false,"fork":false,"pushed_at":"2021-06-09T19:50:51.000Z","size":1327,"stargazers_count":44,"open_issues_count":0,"forks_count":11,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-12-09T11:43:24.216Z","etag":null,"topics":["chromatin-accessibiity","deep-learning","epigenetics","gene-regulation","genomics"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kundajelab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-02-02T00:35:33.000Z","updated_at":"2024-03-16T07:49:25.000Z","dependencies_parsed_at":"2022-08-24T08:20:32.761Z","dependency_job_id":null,"html_url":"https://github.com/kundajelab/ChromDragoNN","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kundajelab/ChromDragoNN","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kundajelab%2FChromDragoNN","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kundajelab%2FChromDragoNN/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kundajelab%2FChromDragoNN/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kundajelab%2FChromDragoNN/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kundajelab","download_url":"https://codeload.github.com/kundajelab/ChromDragoNN/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kundajelab%2FChromDragoNN/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28807474,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-27T06:25:51.065Z","status":"ssl_error","status_checked_at":"2026-01-27T06:25:50.640Z","response_time":168,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chromatin-accessibiity","deep-learning","epigenetics","gene-regulation","genomics"],"created_at":"2026-01-27T07:11:01.642Z","updated_at":"2026-01-27T07:11:02.216Z","avatar_url":"https://github.com/kundajelab.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ChromDragoNN: cis-trans Deep RegulAtory Genomic Neural Network for predicting Chromatin Accessibility\n\n\u003c!--- \n= TODO \n- describe all the data files in some detail\n- details on resuming training\n- add detail on evaluation\n- cell type as input \n---\u003e\n\nThis repository contains code for our paper \"Integrating regulatory DNA sequence and gene expression to predict genome-wide chromatin accessibility across cellular contexts\". The models are implemented in PyTorch.\n\n## Data\n\nAll associated data from our paper can be downloaded from [here](http://mitra.stanford.edu/kundaje/projects/seqxgene/) or [here](https://zenodo.org/record/2635744#.XjCuIC_MxTY).\n\nUntar the `dnase.chr.packbited.tar.gz` file (occupies ~30 Gb).\n\nIf you have your own data, you may use scripts in the `preprocess/` directory. \n\n### Preparing Accessibility Data\nFor the accessibility matrix, prepare your data in the following format as a tab-separated gzipped file. \n```\nchr    start  end    task1  task2  ...  taskM\nchr1   50     1050       0      0           0\nchr1   1000   2000       1      0           1\n...\nchr2   100    1100       1      0           1\n```\n\nChromDragoNN works on binary data and hence do ensure that the labels are all 0 or 1 only.\n\nThen use the following command to process the data (this may take a few hours depending on the size of your dataset):\n```bash\npython ./preprocess/make_accessibility_joblib.py --input /path/to/accessibility/file.tsv.gz --output_dir /path/to/dnase/packbited --genome_fasta /path/to/genome/fasta.fa\n``` \nMake sure the output directory exists!\n\nIf you wish to generate the binary matrix from peaks (e.g. narrowPeak), have a look at the [seqdataloader](https://github.com/kundajelab/seqdataloader) repo. \n\n### Preparing RNA Data\nFor the RNA matrix, prepare your data in the following format as a tab-separated file (NOT gzipped). \n```\ngene    task1   task2  ...  taskM\nMEOX1   3.5189  2.8237      3.7542\nSOX8    0.0     0.0         1.9623\n...\nZNF195  0.0     0.1232      0.0023\n```\nThe gene expression values must already be appropriately normalised. In our paper, we use the arcsinh(TPM) values for 1630 Transcription Factors. Do ensure the number and order of the tasks is the same as in the accessibility data.\n\nThen use the following command to process the data:\n```bash\npython ./preprocess/make_rna_joblib.py --input /path/to/rna/file.tsv --output_prefix /path/to/rna/prefix\n```\n\nThis will output `/path/to/rna/prefix.joblib` RNA quants file.\n\n\n## Model Training \n\n### Stage 1\n\nThe stage 1 models predict accessibility across all training cell types from only sequence, and does not utilise RNA-seq profiles.\n\nThe `model_zoo/stage1` directory contains models for the [Vanilla](./model_zoo/stage1/vanilla.py), [Factorized](./model_zoo/stage1/factorized.py) and our [ResNet](./model_zoo/stage1/resnet.py) models.\n\nTo start training any of these models (say, ResNet), from the `model_zoo/stage1` directory:\n\n```bash\npython resnet.py -cp /path/to/stage1/checkpoint/dir --dnase /path/to/dnase/packbited --rna_quants /path/to/rna_quants_1630tf.joblib\n```\n\nFor other inputs, such as hyperparameters, refer\n\n```bash\npython resnet.py --help\n```\n\n### Stage 2\n\nThe stage 2 models predict accessibility for each cell type, sequence pair and uses RNA-seq profiles.\n\nThe `model_zoo/stage2` directory contains models for the stage 2 models, which may be trained with or without mean accessibility feature as input (explained in more detail in the paper).\n\nTo start training any of these models (say, ResNet, with mean), from the `model_zoo/stage2` directory:\n\n```bash\npython simple.py -cp /path/to/stage2/checkpoint/dir --dnase /path/to/dnase/packbited --rna_quants /path/to/rna_quants_1630tf.joblib --stage1_file ../stage1/resnet.py --stage1_pretrained_model_path /path/to/stage1/checkpoint/dir --with_mean 1\n```\n\nThe model loads weights from the best model from the stage 1 checkpoint directory. You may resume training from a previous checkpoint by adding the argument ```-rb 1``` to the above command. To predict on the test set, add the arguments ```-rb 1 -ev 1``` to the above command. This will generate a report of performance on the test set and also produce precision-recall plots. \n\nFor other inputs, such as hyperparameters, refer\n\n```bash\npython simple.py --help\n```\n\n## Citation\n\nIf you use this code for your research, please cite our paper:\n\nSurag Nair, Daniel S Kim, Jacob Perricone, Anshul Kundaje, Integrating regulatory DNA sequence and gene expression to predict genome-wide chromatin accessibility across cellular contexts, Bioinformatics, Volume 35, Issue 14, July 2019, Pages i108–i116, https://doi.org/10.1093/bioinformatics/btz352\n\n\u003c!--- add citation ---\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkundajelab%2Fchromdragonn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkundajelab%2Fchromdragonn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkundajelab%2Fchromdragonn/lists"}