{"id":23940500,"url":"https://github.com/pockerman/hmmtuf_app","last_synced_at":"2026-04-16T10:01:27.288Z","repository":{"id":48683302,"uuid":"288225555","full_name":"pockerman/hmmtuf_app","owner":"pockerman","description":"hmmtuf is a simple mapping tool that uses hidden Markov models in order to label DNA regions.","archived":false,"fork":false,"pushed_at":"2021-11-30T11:27:26.000Z","size":17916,"stargazers_count":0,"open_issues_count":5,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-12-08T11:06:17.574Z","etag":null,"topics":["bioinformatics","biology","celery","dash","django","django-application","dna","hidden-markov-model","pomegranate","python3","spark"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pockerman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-08-17T16:05:49.000Z","updated_at":"2022-05-13T09:31:41.000Z","dependencies_parsed_at":"2022-09-03T16:51:15.057Z","dependency_job_id":null,"html_url":"https://github.com/pockerman/hmmtuf_app","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/pockerman/hmmtuf_app","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pockerman%2Fhmmtuf_app","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pockerman%2Fhmmtuf_app/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pockerman%2Fhmmtuf_app/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pockerman%2Fhmmtuf_app/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pockerman","download_url":"https://codeload.github.com/pockerman/hmmtuf_app/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pockerman%2Fhmmtuf_app/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31880882,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-16T09:23:21.276Z","status":"ssl_error","status_checked_at":"2026-04-16T09:23:15.028Z","response_time":69,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["bioinformatics","biology","celery","dash","django","django-application","dna","hidden-markov-model","pomegranate","python3","spark"],"created_at":"2025-01-06T03:17:24.527Z","updated_at":"2026-04-16T10:01:27.263Z","avatar_url":"https://github.com/pockerman.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# hmmtuf\n\nThermodynamically ultra-fastened (TUF) regions are stretches of the DNA which fail to denature\neven after the application of extreme melting conditions [1]. This behavior effectively reduces the amplification efficiency in these regions. \nIt has also been reported that  TUF regions contain a core sequence which exhibits an increased GC concentration relative to the surrounding DNA. \nIt is in fact these locally concentrated spikes of GC content which is believed to remain duplexed despite the application of denaturation processes [1].\n\nComputational modelling and analysis of TUF regions requires the ability to somehow identify these in the \nDNA strand. However, visually, identifying and labeling TUF regions, although feasible, is time consuming to say the least. \n\n```hmmtuf``` is an simple mapping tool that uses \u003ca href=\"https://en.wikipedia.org/wiki/Hidden_Markov_model\"\u003ehidden Markov models\u003c/a\u003e in order to label regions of DNA. Users can load\ntheir own developed models. The application uses \u003ca href=\"https://pomegranate.readthedocs.io/en/latest/\"\u003epomegranate\u003c/a\u003e for\nrepresenting a hidden Markov model. We provide a default Markov model which can be found at ```hmmtuf_app/hmm_files/HMM1.json```. \nThe report in ```hmmtuf_app/notes/hmmtuf_model_report.pdf``` describes how this model was developed.\n\nThe application currently supports the following computations\n\n- Compute the \u003ca href=\"https://en.wikipedia.org/wiki/Viterbi_algorithm\"\u003eViterbi path\u003c/a\u003e of a single region\n- Compute the Viterbi path over all regions of a chromosome\n- Compute the repeats over a computed Viterbi path\n- Compute distances between repeats\n- Visualize distances distributions\n\nThe following image displays the marked windows accoding to the computed Viterbi path in the IGV browser.\n\n\u003cimg src=\"imgs/img_group.png\" style=\"width:60%\" /\u003e\n\n\nThe following schematic displays approximately the role of the various component.\n\n\u003cimg src=\"imgs/architecture_diagram.png\" style=\"width:60%\" /\u003e\n\n## Dependencies\n\n- \u003ca href=\"https://www.djangoproject.com/\"\u003edjango\u003c/a\u003e\n- \u003ca href=\"https://docs.celeryproject.org/en/stable/getting-started/introduction.html\"\u003ecelery\u003c/a\u003e\n- \u003ca href=\"https://pomegranate.readthedocs.io/en/latest/\"\u003epomegranate\u003c/a\u003e\n- \u003ca href=\"https://www.sqlite.org/index.html\"\u003eSQLite\u003c/a\u003e or \u003ca href=\"#\"\u003eMySQL\u003c/a\u003e\n- \u003ca href=\"https://pysam.readthedocs.io/en/latest/api.html\"\u003epysam\u003c/a\u003e\n- \u003ca href=\"https://biopython.org/\"\u003ebiopython\u003c/a\u003e\n- \u003ca href=\"https://pypi.org/project/textdistance/\"\u003etextdistance\u003c/a\u003e\n\n\n\n#### Note\n\nYou also need to install one of the backends supported by Celery. For more\ninformation see \u003ca href=\"https://docs.celeryproject.org/en/stable/getting-started/introduction.html#installation\"\u003ehere\u003c/a\u003e.\n\nA Dockerize version of the project can be found \u003ca href=\"https://github.com/pockerman/hmmtuf_docker\"\u003ein this repository\u003c/a\u003e.\n\n## Configuration \n\nThe general configuration is controlled by the ```config.py``` script in the ```hmmtuf/```\napplication directory. The following variables can be configured\n\n- ```DEBUG``` \n- ```LOCAL_DEPLOY```\n- ```SESSION_COOKIE_SECURE```\n- ```CSRF_COOKIE_SECURE```\n- ```USE_CELERY```\n- ```ENABLE_SPADE```\n- ```SPADE_PATH```\n- ```DATA_PATH```\n- ```USE_DJANGO_EXTENSIONS```\n\n## Setup the project locally\n\n1. ```cd``` to the top-level directory of the project i.e. where the ```manage.py``` file is located\n2. Issue: ```python manage.py makemigrations```\n3. Issue: ```python manage.py migrate```\n\nThe last two commands will setup the needed DB tables. You can now launch the development server.\n\nAlternatively, you can apply migrations only for a specific application:\n\n2. ```python manage.py makemigrations app_name```\n3. ```python manage.py migrate app_name```\n\n```\npython manage.py runserver\n```\n\n## Setup ```admin``` site\n\n1. Make sure that you have applied the migrations from ```admin``` and ```auth``` applications\n2. Issue: ```python manage.py createsuperuser```\n3. Fill in the details asked\n4. Fire up the development server and visit ```http://127.0.0.1:8000/admin``` to login\n\n## DB Handling\n\nCurrently, the project uses SQLite the default backend \nin Django. The following are some commands we can use during the\ndevelopment\n\n- Launch the ```dbshell```\n\n```python manage.py dbshell```\n\n- View tables and databases\n\n```.tables```\n```.databases```\n\n- Drop all model tables\n\n```python manage.py migrate zero``` \n\n## Monitoring Celery\n\nYou can use \u003ca href=\"https://flower.readthedocs.io/en/latest/\"\u003eflower\u003c/a\u003e in order to monitor Celery\n\n## Deploy with Apache with ```mod_wsgi```\n\nSome instructions on how to deploy with Apache and ```mod_wsgi``` can be found \u003ca href=\"https://pockerman.github.io/qubit_opus/programming/django/python/apache/web-development/2021/07/15/django-apache.html\"\u003ehere\u003c/a\u003e.\n\n## Deploy with Gunicorn\n\nThere are several tools that can be used for deployment. A common scenario is using \n\u003ca href=\"https://gunicorn.org/\"\u003eGunicorn\u003c/a\u003e a Python WSGI HTTP Server for UNIX and \n\u003ca href=\"https://nginx.org/en/\"\u003enginx\u003c/a\u003e an HTTP and reverse proxy server. \n\nYou can find instructions how to deploy the application using Gunicorn and \nnginx \u003ca href=\"https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-18-04\"\u003ehere\u003c/a\u003e.\nA minimum configuration that most likely is only suitable for local development/testing, can be:\n\n#### gunicorn configuration\n\n**gunicorn.socket** \n\n```\n[Unit]\nDescription=gunicorn socket\n\n[Socket]\nListenStream=/run/gunicorn.sock\n\n[Install]\nWantedBy=multi-user.target\n```\n\n**gunicorn.service**\n\n```\n[Unit]\nDescription=gunicorn daemon\nRequires=gunicorn.socket\nAfter=network.target\n\n[Service]\nUser=alex\nGroup=www-data\nWorkingDirectory=/path/to/hmmtuf\nExecStart=gunicorn --access-logfile - \\\n\t\t  --workers 3 \\\n          --bind unix:/run/gunicorn.sock \\\n          hmmtuf.wsgi:application\n\n[Install]\nWantedBy=multi-user.target\n```\n\n\n#### nginx configuration\n\n```\nupstream app_server { \nserver unix:/run/gunicorn.sock fail_timeout=0;\n}\n\nserver {\n\tlisten 80 default_server;\n\tlisten [::]:80 default_server ipv6only=on;\n\n\t# set the correct hosts\n\tserver_name localhost;\n\n    access_log /path/to/where/logs/should/go/nginx-access.log;\n    error_log /path/to/where/logs/should/go/nginx-error.log;\n\n\tlocation  /favicon.ico {\n\t\t\taccess_log off; log_not_found off;\n\t}\n\n\tlocation /static {\n\t\tautoindex on;\n        # this should point to where collectstatic\n        # appends the files\n\t\talias /path/to/hmmtuf/static;\n\t}\n\n\tlocation /viterbi_paths {\n\t\tautoindex on;\n\t\talias /path/to/hmmtuf/viterbi_paths/;\n\t}\n\n\tlocation / {\n\t\tproxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n\t\tproxy_set_header Host $http_host;\n\t\tproxy_pass http://app_server;\n\t}\n}\n```\n\nProvided that everything has worked, you can access the application at: ```http://localhost/```\n\n## References\n\n1. Colin D. Veal and Peter J. Freeman and  Kevin Jacobs and Owen Lancaster and Stéphane Jamain and Marion Leboyer and Demetrius Albanes and Reshma R. Vaghela and Ivo Gut and Stephen J. Chanock and Anthony J. Brookes, ```A mechanistic basis for amplification differences between samples and between genome regions```, BMC Genomics, 2012\n2. Rabiner L. R., ```A tutorial on Hidden Markov Models and selected applications in speech recognition```,\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpockerman%2Fhmmtuf_app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpockerman%2Fhmmtuf_app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpockerman%2Fhmmtuf_app/lists"}