{"id":32157637,"url":"https://github.com/kchu25/motifs.jl","last_synced_at":"2025-10-21T12:51:47.325Z","repository":{"id":149229315,"uuid":"619948312","full_name":"kchu25/MOTIFs.jl","owner":"kchu25","description":"DNA Motif discovery that includes the discovery of flexible (long or gapped) motifs.","archived":false,"fork":false,"pushed_at":"2024-01-18T20:23:04.000Z","size":2512,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-21T12:51:45.638Z","etag":null,"topics":["bioinformatics","dna-sequences","machine-learning-algorithms","motifs","representation-learning","transcription-factor-binding-site"],"latest_commit_sha":null,"homepage":"https://academic.oup.com/bioinformatics/advance-article-abstract/doi/10.1093/bioinformatics/btad378/7192989?utm_source=advanceaccess\u0026utm_campaign=bioinformatics\u0026utm_medium=email","language":"Julia","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/kchu25.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,"governance":null}},"created_at":"2023-03-27T18:22:25.000Z","updated_at":"2025-08-20T16:57:11.000Z","dependencies_parsed_at":"2023-06-09T01:30:11.713Z","dependency_job_id":"c268a486-4099-49fa-9559-963e7992ed7b","html_url":"https://github.com/kchu25/MOTIFs.jl","commit_stats":{"total_commits":69,"total_committers":1,"mean_commits":69.0,"dds":0.0,"last_synced_commit":"4af73529b17f3a1277738d16083b3eb042b8c55f"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kchu25/MOTIFs.jl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kchu25%2FMOTIFs.jl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kchu25%2FMOTIFs.jl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kchu25%2FMOTIFs.jl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kchu25%2FMOTIFs.jl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kchu25","download_url":"https://codeload.github.com/kchu25/MOTIFs.jl/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kchu25%2FMOTIFs.jl/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280264177,"owners_count":26300771,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-21T02:00:06.614Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["bioinformatics","dna-sequences","machine-learning-algorithms","motifs","representation-learning","transcription-factor-binding-site"],"created_at":"2025-10-21T12:51:45.018Z","updated_at":"2025-10-21T12:51:47.318Z","avatar_url":"https://github.com/kchu25.png","language":"Julia","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Finding Motifs Using DNA Images Derived From Sparse Representations\n\n\u003c!-- [![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://kchu25.github.io/MOTIFs.jl/stable/)\n[![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://kchu25.github.io/MOTIFs.jl/dev/)\n[![Build Status](https://github.com/kchu25/MOTIFs.jl/actions/workflows/CI.yml/badge.svg?branch=main)](https://github.com/kchu25/MOTIFs.jl/actions/workflows/CI.yml?query=branch%3Amain) --\u003e\n\nGeneral purpose motif discovery package that includes the discovery of flexible (long or gapped) motifs. \n\nThis code repository corresponds to the paper [Finding Motifs Using DNA Images Derived From Sparse Representations](https://academic.oup.com/bioinformatics/advance-article-abstract/doi/10.1093/bioinformatics/btad378/7192989?utm_source=advanceaccess\u0026utm_campaign=bioinformatics\u0026utm_medium=email), which has been published in Oxford Bioinformatics.\n\n## Table of contents\n\n- [Motivation](#Motivation)\n- [Installation](#Installation)\n- [Usage](#Usage)\n- [Software requirements](#Software-requirements)\n- [Hardware requirements](#Hardware-requirements)\n- [Adjustable Hyperparameters](#Adjustable-Hyperparameters)\n- [Interpret the results](#Interpret-the-results)\n- [Cite this work](#Cite-this-work)\n- [Contact](#Contact)\n\n\n## Motivation\nTraditional methods such as [STREME](https://meme-suite.org/meme/doc/streme.html) and [HOMER](http://homer.ucsd.edu/homer/motif/) excel at efficiently finding the primary motifs of a transcription factor. This raises the question: why do we require an additional motif discovery method?\n\nBecause there may be more patterns in the datasets that aren't fully captured. This is especially evident for context-dependent binding sites, such as C2H2 zinc finger, and cooperative binding patterns observed in in-vivo datasets from ChIP-Seq.\n\nOur work reveals that over half of the ChIP-Seq datasets selected from the [JASPAR 2022](https://jaspar.genereg.net/) database contain transposable elements that overlap the primary binding sites. For instance, see [NFE2L2](https://en.wikipedia.org/wiki/NFE2L2), [YY1](https://en.wikipedia.org/wiki/YY1), [STAT1](https://en.wikipedia.org/wiki/STAT1), [SRF](https://en.wikipedia.org/wiki/Serum_response_factor), [AR](https://en.wikipedia.org/wiki/Androgen_receptor) ([Manuscript Figure 4](https://academic.oup.com/bioinformatics/advance-article-abstract/doi/10.1093/bioinformatics/btad378/7192989?utm_source=advanceaccess\u0026utm_campaign=bioinformatics\u0026utm_medium=email)):\n\n![image info](./imgs/long_1.png)\n\nThese long patterns present challenges for traditional k-mer-based methods due to their exponential time and space complexity.\n\nFurthermore, many datasets exhibit a large presence of gapped motifs. For example, we found that ChIP-Seq datasets from both [JASPAR](https://jaspar.genereg.net/) and [Factorbook](https://www.factorbook.org/) often contains gapped motifs ([Manuscript Figure 6](https://academic.oup.com/bioinformatics/advance-article-abstract/doi/10.1093/bioinformatics/btad378/7192989?utm_source=advanceaccess\u0026utm_campaign=bioinformatics\u0026utm_medium=email)):\n\n![image info](./imgs/gapped.png)\n\nand the spacers that characterized the gapped motifs [can be widely varied (Supplementary Material Figure 2)](./imgs/gaps.png).\n\nLast, there are cooperative binding patterns, e.g., ([Manuscript Figure 5](https://academic.oup.com/bioinformatics/advance-article-abstract/doi/10.1093/bioinformatics/btad378/7192989?utm_source=advanceaccess\u0026utm_campaign=bioinformatics\u0026utm_medium=email)):\n\n![image info](./imgs/avsec3.png)\n\n\nfor which we see consecutive occurrences of [Oct4](https://en.wikipedia.org/wiki/Oct-4) and cooccurrence of [Oct4](https://en.wikipedia.org/wiki/Oct-4) and [Zic3](https://en.wikipedia.org/wiki/ZIC3), in addition to the Oct4-Sox2 motif. The presence of gapped motifs and cooperative binding patterns presents challenges for k-mer-based methods as well, as these methods are primarily designed to detect ungapped motifs.\n\n\n## Installation\nTo install MOTIFs.jl use Julia's package manager:\n```\npkg\u003e add MOTIFs\n```\n\n## Usage\nIn Julia:\n````julia\nusing MOTIFs\n\n# Do motif discovery on a set of DNA sequences in a fasta file, \n# where the `\u003cfasta-path\u003e` and `\u003coutput-folder-path\u003e` are the \n# absolute filepaths as strings.\n\ndiscover_motifs(\u003cfasta-path\u003e, \u003coutput-folder-path\u003e)\n\n# for example\ndiscover_motifs(\"home/shane/mydata/fasta.fa\", \n                \"home/shane/mydata/out/\")\n````\n\n## Software requirements \n This package currectly requires [Weblogo](http://weblogo.threeplusone.com/manual.html#download) for PWM plotting. Install Weblogo by running the following command with python3 and pip3:\n ```bash\n pip install weblogo\n ```\n\n## Hardware requirements\nCurrently, a GPU is required for this package as it utilizes [CUDA.jl](https://github.com/JuliaGPU/CUDA.jl) to accelerate certain computations. However, I plan to implement a CPU extension in the future.\n\n\n## Adjustable Hyperparameters\n````julia\n\n# The user can adjust the number of epochs for training the network.\ndiscover_motifs(\u003cfasta-path\u003e, \u003coutput-folder-path\u003e; num_epochs=10)\n\n````\n## Interpret the results\n\n### Summary page\nOnce the motif discovery process is complete, a summary.html page is generated in the output folder, providing a comprehensive overview of the results.\n\nFor instance, here is an example result page showcasing data from the  [SP1 transcription factor from JASPAR](https://jaspar.genereg.net/matrix/MA0079.3/):\n\n\u003e ![image info](./imgs/re_top.png)\n\nThe top of the result page has\n- **Number of sequences**: The total number of DNA sequences in the dataset.\n- **Label**: A label assigned for each discovered motifs.\n    * Each label is hyperlinked to a text file in TRANSFAC format that can be parsed.\n- **P-value**: The satistical significance of the discovered motif using Fisher exact test ([Manuscript section 2.7.2](https://academic.oup.com/bioinformatics/advance-article-abstract/doi/10.1093/bioinformatics/btad378/7192989?utm_source=advanceaccess\u0026utm_campaign=bioinformatics\u0026utm_medium=email)).\n- **\\# instances**: An estimate of the number of occurrences in the dataset ([Manuscript section 2.7.3](https://academic.oup.com/bioinformatics/advance-article-abstract/doi/10.1093/bioinformatics/btad378/7192989?utm_source=advanceaccess\u0026utm_campaign=bioinformatics\u0026utm_medium=email)).\n- **Logo**: Position weight matricies.\n    * Press the `Reverse complement` button to view the logo in alternative orientation.\n\n\nNote that in in-vivo datasets, especially for zinc-finger proteins, a large number of motifs can be observed, often characterized by variable spacings in their binding sites.\n\n\u003e ![image info](./imgs/re_gap.png)\n\n### Statistically insignificant motifs \nSome of the motifs shown here have their p-values in grey, indicating that they have a relatively high p-value (p \u003e 0.01, Fisher exact test). This statistical result simply suggests that these motifs are not significantly enriched relative to the shuffled DNA strings ([Manuscript section 2.7.2](https://academic.oup.com/bioinformatics/advance-article-abstract/doi/10.1093/bioinformatics/btad378/7192989?utm_source=advanceaccess\u0026utm_campaign=bioinformatics\u0026utm_medium=email)); it does not imply that these motifs do not exist in the dataset.\n\n\u003e ![image info](./imgs/re_high_pval.png)\n\n## Cite this work\n\nYou can cite this work using the following BibTex entry:\n```\n@article{chu2023finding,\n  title={Finding Motifs Using DNA Images Derived From Sparse Representations},\n  author={Chu, Shane K and Stormo, Gary D},\n  journal={Bioinformatics},\n  pages={btad378},\n  year={2023},\n  publisher={Oxford University Press}\n}\n```\n\n## Contact\n\nIf you have any questions or suggestions regarding the usage or source code, please feel free to reach out to me at \u003cskchu@wustl.edu\u003e.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkchu25%2Fmotifs.jl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkchu25%2Fmotifs.jl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkchu25%2Fmotifs.jl/lists"}