a2z-regulatory

Cross-species angiosperm chromatin state models

https://github.com/twrightsman/a2z-regulatory

Science Score: 67.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 2 DOI reference(s) in README
  • Academic publication links
    Links to: ncbi.nlm.nih.gov, zenodo.org
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (11.6%) to scientific vocabulary
Last synced: 10 months ago · JSON representation ·

Repository

Cross-species angiosperm chromatin state models

Basic Info
  • Host: GitHub
  • Owner: twrightsman
  • License: mit
  • Language: Python
  • Default Branch: main
  • Size: 209 KB
Statistics
  • Stars: 0
  • Watchers: 2
  • Forks: 0
  • Open Issues: 1
  • Releases: 0
Created over 4 years ago · Last pushed about 3 years ago
Metadata Files
Readme License Citation

README.md

Cross-species chromatin state prediction

Citation

If you use the a2z model in your work, please cite the following article:

Wrightsman, T., Marand, A. P., Crisp, P. A., Springer, N. M., & Buckler, E. S. (2022). Modeling chromatin state from sequence across angiosperms using recurrent convolutional neural networks. The Plant Genome, 15, e20249. https://doi.org/10.1002/tpg2.20249

Dependencies

The authors recommend mambaforge as a faster alternative to conda. If using mambaforge, use the mamba create command instead of conda create.

Environment Setup

git clone https://github.com/twrightsman/a2z-regulatory cd a2z-regulatory conda env create -f envs/a2z.yml conda activate a2z pip install src/python/a2z

After setting up the environment, you can then use the scripts in data/ to download all the necessary data for the experiments in the results/ folder.

Developer Setup (optional)

This is only useful for better git-diff output on Jupyter Notebooks.

git config --local --add diff.jupyternotebook.command "git-nbdiffdriver diff" git config --local --add merge.jupyternotebook.command "git-nbmergedriver merge %O %A %B %L %P" echo "*.ipynb diff=jupyternotebook merge=jupyternotebook" >> .git/info/attributes

Predicting on your own sequences

Running predictions using a2z

Use predict_genome.py -h to see all available options.

(base)$ curl 'https://zenodo.org/record/5724562/files/model-accessibility-full.h5?download=1' > model-accessibility-full.h5 (base)$ conda activate a2z (a2z)$ src/python/scripts/predict_genome.py --stride 50 model-accessibility-full.h5 genome.fa > preds.bed

Now you will have a BED3+1 file with predictions in 600bp windows sliding 50bp at a time. You can do simple "peak-calling" with bedtools.

(a2z)$ samtools faidx genome.fa (a2z)$ bedtools slop -g genome.fa.fai -b -150 < preds.bed > preds.trimmed.bed (a2z)$ bedtools map -a <(bedtools makewindows -g genome.fa.fai -w 50) -b preds.trimmed.bed -c 4 -o max | awk '$4 >= 0.9' | bedtools merge > preds.gte90.merged.bed

The above will trim 150bp off each end of the predictions and take the max prediction of all overlapping windows every 50bp and then merge touching 50bp chunks with predictions greater than or equal to 0.90 into whole regions. Trimming is optional but recommended because the size of true accessible regions called from the ATAC-seq data is close to 300bp.

You can also mask out repeats with bedtools and an annotation.

(a2z)$ grep -v '^#' repeats.gff3 | awk -v 'OFS=\t' '{print $1, $4 - 1, $5}' > repeats.bed (a2z)$ bedtools subtract -A -f 0.5 -a preds.gte90.merged.bed -b repeats.bed > preds.gte90.merged.masked.bed

Running predictions using Kipoi

The a2z leaf chromatin and DNA methylation models are also available in the Kipoi model zoo.

The following will make leaf chromatin accessibility predictions on 600bp sliding windows with a stride of 50bp. You can adjust the window stride by modifying the -s parameter to bedtools.

(base)$ ls a2z-regulatory (base)$ mkdir work (base)$ cd work (base)$ curl https://ftp.ncbi.nlm.nih.gov/genomes/all/GCF/000/001/735/GCF_000001735.4_TAIR10.1/GCF_000001735.4_TAIR10.1_genomic.fna.gz | gzip -cd > tair.fa (base)$ conda activate a2z (a2z)$ samtools faidx tair.fa (a2z)$ bedtools makewindows -g tair.fa.fai -w 600 -s 50 | awk '$3-$2 == 600' > windows.bed (a2z)$ conda env create -f ../a2z-regulatory/envs/kipoi.yml (a2z)$ conda activate a2z-kipoi (a2z-kipoi)$ kipoi env export a2z-chromatin/a2z-accessibility -o env.yml (a2z-kipoi)$ conda env create -f env.yml (a2z-kipoi)$ conda activate kipoi-a2z-chromatin__a2z-accessibility (kipoi-a2z-chromatin__a2z-accessibility)$ kipoi predict a2z-chromatin/a2z-accessibility -n 8 --batch_size=128 --dataloader_args='{"intervals_file": "windows.bed", "fasta_file": "tair.fa", "num_chr_fasta": true}' -o a2z.acc.preds.tsv

Owner

  • Name: Travis Wrightsman
  • Login: twrightsman
  • Kind: user

Citation (CITATION.cff)

cff-version: 1.2.0
message: "If you use this software, please cite the article describing it."
authors:
- family-names: "Wrightsman"
  given-names: "Travis"
  orcid: "https://orcid.org/0000-0002-0904-6473"
title: "a2z-regulatory"
version: 1.3.0
doi: 10.5281/zenodo.6970423
date-released: 2021-11-15
url: "https://github.com/twrightsman/a2z-regulatory"
preferred-citation:
  authors:
    - family-names: "Wrightsman"
      given-names: "Travis"
      orcid: "https://orcid.org/0000-0002-0904-6473"
    - family-names: "Marand"
      given-names: "Alexandre P."
      orcid: "https://orcid.org/0000-0001-9100-8320"
    - family-names: "Crisp"
      given-names: "Peter A."
      orcid: "https://orcid.org/0000-0002-3655-0130"
    - family-names: "Springer"
      given-names: "Nathan M."
      orcid: "https://orcid.org/0000-0002-7301-4759"
    - family-names: "Buckler"
      given-names: "Edward S."
      orcid: "https://orcid.org/0000-0002-3100-371X"
  title: "Modeling chromatin state from sequence across angiosperms using recurrent convolutional neural networks"
  type: article
  journal: "The Plant Genome"
  month: 09
  year: 2022
  volume: "15"
  issue: "3"
  page: "e20249"
  doi: "10.1002/tpg2.20249"
  date-released: 2022-08-03
  url: "https://doi.org/10.1002/tpg2.20249"

GitHub Events

Total
Last Year

Dependencies

src/python/a2z/setup.py pypi
docs/manuscript/build/environment.yml conda
  • cairo 1.16.0.*
  • cairocffi 1.2.0.*
  • ghp-import 2.0.2.*
  • jinja2 3.0.3.*
  • jsonschema 4.2.1.*
  • pandoc 2.17.0.1.*
  • pango 1.48.10.*
  • pip 21.3.1.*
  • python 3.10.0.*
  • requests 2.26.0.*
  • requests-cache 0.8.1.*
  • toml 0.10.2.*
  • watchdog 2.1.6
  • weasyprint 53.4.*
  • yamllint 1.26.3.*