{"id":18189943,"url":"https://github.com/kullrich/quickhla","last_synced_at":"2025-04-07T14:50:15.924Z","repository":{"id":86806823,"uuid":"340040310","full_name":"kullrich/quickhla","owner":"kullrich","description":null,"archived":false,"fork":false,"pushed_at":"2021-02-22T10:22:33.000Z","size":132,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-13T17:29:10.025Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kullrich.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-02-18T12:16:47.000Z","updated_at":"2021-02-22T10:22:35.000Z","dependencies_parsed_at":"2023-07-12T10:00:12.939Z","dependency_job_id":null,"html_url":"https://github.com/kullrich/quickhla","commit_stats":{"total_commits":29,"total_committers":1,"mean_commits":29.0,"dds":0.0,"last_synced_commit":"da9fc31d4348684f0992f1a258ff3ec9908e773a"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kullrich%2Fquickhla","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kullrich%2Fquickhla/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kullrich%2Fquickhla/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kullrich%2Fquickhla/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kullrich","download_url":"https://codeload.github.com/kullrich/quickhla/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247675627,"owners_count":20977376,"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","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":[],"created_at":"2024-11-03T04:04:38.328Z","updated_at":"2025-04-07T14:50:15.894Z","avatar_url":"https://github.com/kullrich.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# quickhla\n\n## About\n\n`quickhla` is inspired by [https://github.com/ExpressionAnalysis/HLAProfiler](https://github.com/ExpressionAnalysis/HLAProfiler)\nand [https://sourceforge.net/projects/targt-pipeline/](https://sourceforge.net/projects/targt-pipeline/)\nto use k-mer content of next generation sequencing reads and subsequent mapping to classify HLA types in a sample.\n\n`quickhla` heavily relies on the data from the [IPD-IMGT/HLA](https://www.ebi.ac.uk/ipd/imgt/hla/) database.\n\n![quickhla workflow](quickhla.png)\n\n## Usage\n\nFirst, the HLA k-mer databases need to be build (can take up to 30 minutes):\n\n```bash\n# download hla fasta files from ftp://ftp.ebi.ac.uk/pub/databases/ipd/imgt/hla/fasta/\nwget ftp://ftp.ebi.ac.uk/pub/databases/ipd/imgt/hla/fasta/hla_gen.fasta\nwget ftp://ftp.ebi.ac.uk/pub/databases/ipd/imgt/hla/fasta/hla_nuc.fasta\n# build databases with k-mer length of 35\nquickhla build -gen hla_gen.fasta -nuc hla_nuc.fasta\n# build databases with k-mer length of 35 using 12 threads\nquickhla build -gen hla_gen.fasta -nuc hla_nuc.fasta -t 12\n```\n\nsee help\n\n```\nquickhla build -h\n\nusage: quickhla \u003csub-script\u003e [options] [\u003carguments\u003e...] build\n       [-h] [-gen GEN] [-nuc NUC] [-o O] [-kb KB] [-bb BB] [-hb HB] [-kl KL]\n       [-ml ML] [-ms MS]\n\noptional arguments:\n  -h, --help  show this help message and exit\n  -gen GEN    input gen file [mandatory]\n  -nuc NUC    input nuc file [mandatory]\n  -o O        output kraken2 database directory [default: hla.db]\n  -kb KB      specify kraken2-build binary [if not given assumes to be in\n              PATH]\n  -bb BB      specify bowtie2-build binary [if not given assumes to be in\n              PATH]\n  -hb HB      specify hisat2-build binary [if not given assumes to be in PATH]\n  -kl KL      kraken2 kmer-len array [default: 35] can be an array of values\n              and needs to be same length as -ml and -ms\n  -ml ML      kraken2 minimizer-len array [default: 31] if array needs to be\n              same length as -kl and -ms\n  -ms MS      kraken2 minimizer-space array [default: 7] if array needs to be\n              same length as -kl and -ml\n  -t T        specify number threads [default: 1]\n```\n\nOne can also create the consensus sequences for the different digit levels `2d`, `4d`, `6d` and subsequently use these files to build the database.\n\n```\nmkdir msf\ncd msf\nwget -A msf -l 1 -r -nd --no-parent ftp://ftp.ebi.ac.uk/pub/databases/ipd/imgt/hla/msf/\nquickhla msf -i .\ncd ..\n# 2d\nquickhla build -gen msf/gen_2d.consensus.fasta -nuc msf/nuc_2d.consensus.fasta -t 12 -o msf.2d.db\n# 4d\nquickhla build -gen msf/gen_4d.consensus.fasta -nuc msf/nuc_4d.consensus.fasta -t 12 -o msf.4d.db\n# 6d\nquickhla build -gen msf/gen_6d.consensus.fasta -nuc msf/nuc_6d.consensus.fasta -t 12 -o msf.6d.db\n```\n\nFor paired reads `FORWARD.fq` and `REVERSE.fq` using the standard `nuc` database created for four-digits `4d` , the basic usage is:\n\n```bash\nquickhla classify -f FORWARD.fq -r REVERSE.fq -d hla.db -db hla.nuc.4d.35 -n 4 -t 12\n```\n\nsee help\n\n```\nquickhla classify -h\n\nusage: quickhla \u003csub-script\u003e [options] [\u003carguments\u003e...] classify\n       [-h] [-f F] [-r R] [-d D] [-db DB] [-o O] [-t T] [-kb KB] [-alg ALG]\n       [-bb BB] [-bo BO] [-hb HB] [-ho HO] [-n N]\n\noptional arguments:\n  -h, --help  show this help message and exit\n  -f F        specify forward fastq [mandatory]\n  -r R        specify reverse fastq [mandatory]\n  -d D        specify db directory [mandatory]\n  -db DB      specify db for classification [mandatory]\n  -o O        specify output prefix [default: out]\n  -t T        specify number threads [default: 1]\n  -kb KB      specify kraken2 binary [if not given assumes to be in PATH]\n  -alg ALG    specify aligner [default: hisat2]\n  -w          apply weights on read counts [default: False]\n  -bb BB      specify bowtie2 binary [if not given assumes to be in PATH]\n  -bo BO      specify bowtie2 options [default: --very-fast --no-unal\n              -k 1000]\n  -hb HB      specify hisat2 binary [if not given assumes to be in PATH]\n  -ho HO      specify hisat2 options [default: --fast -k 1000]\n  -n N        specify number of top hits to report [default: show all]\n```\n\n## Output\n\nquickhla outputs two plain text files with the HLA classifications (1. from k-mer and 2. from mapping)\n\nThe output are:\n\n1. k-mer results (number of fragments per class)\n\nExample shows the top 2 hits per HLA class `out.hla.nuc.4d.35.report`\n\n```\n#quickhla classify -f SRR099966_1.filt.fastq.gz -r SRR099966_2.filt.fastq.gz -d hla.db -db hla.nuc.4d.35 -n 4 -t 12\n 99.90  99117470        99117470        U       0       unclassified\n  0.10  98293   10992   R       1       hlaroot\n  0.01  10824   2831    K       2         A\n  0.00  2464    196     P       1424        A*02\n  0.00  356     356     C       1425          A*02:01\n  0.00  276     276     C       4832          A*02:874\n  0.00  944     13      P       8499        A*24\n  0.00  212     212     C       8500          A*24:02\n  0.00  56      56      C       9843          A*24:371\n\n  0.01  10476   3261    K       16304     B\n  0.00  1155    91      P       29130       B*44\n  0.00  471     471     C       29320         B*44:03\n  0.00  75      75      C       30293         B*44:329\n  0.00  821     9       P       16305       B*07\n  0.00  133     133     C       16306         B*07:02\n  0.00  87      87      C       17422         B*07:338\n\n  0.01  10549   2352    K       36025     C\n  0.00  2833    388     P       43684       C*07\n  0.00  455     455     C       43984         C*07:02\n  0.00  135     135     C       43685         C*07:01\n  0.00  1274    70      P       37661       C*03\n  0.00  254     254     C       39237         C*03:418\n  0.00  196     196     C       37885         C*03:04 \n\n  0.01  8596    1785    K       68214     DQB1\n  0.00  2114    247     P       68874       DQB1*03\n  0.00  206     206     C       68875         DQB1*03:01\n  0.00  117     117     C       70083         DQB1*03:369\n  0.00  1602    297     P       70844       DQB1*05\n  0.00  205     205     C       70943         DQB1*05:02\n  0.00  165     165     C       70845         DQB1*05:01\n\n  0.01  6789    2058    K       51886     DRB1\n  0.00  592     14      P       58657       DRB1*15\n  0.00  85      85      C       58889         DRB1*15:114\n  0.00  68      68      C       58832         DRB1*15:08\n  0.00  543     107     P       53018       DRB1*04\n  0.00  44      44      C       53163         DRB1*04:05\n  0.00  34      34      C       53892         DRB1*04:286N  \n```\n\n2. mapping results (number of reads per class)\n\nExample shows the top 4 hits per HLA class and digit level `out.hla.nuc.4d.35.class.txt`\n\n```\n#quickhla classify -f SRR099966_1.filt.fastq.gz -r SRR099966_2.filt.fastq.gz -d hla.db -db hla.nuc.4d.35 -n 4 -t 12\nA\t311503\n        A*01\t122814\n        A*11\t77905\n        A*03\t73636\n        A*30\t31114\n        \tA*01:01\t48306\n        \tA*03:01\t27812\n        \tA*11:01\t27718\n        \tA*30:02\t5378\n        \t\tA*01:01:01      24741\n        \t\tA*03:01:01      16294\n        \t\tA*11:01:01      14110\n        \t\tA*30:02:01      3309\n        \t\t\tA*01:01:71:NA   488\n        \t\t\tA*01:251:NA:NA  343\n        \t\t\tA*01:01:01:24   342\n        \t\t\tA*01:342:NA:NA  341\nB       143234\n        B*15    27971\n        B*08    22800\n        B*57    16677\n        B*44    9919\n        \tB*08:01 7046\n        \tB*57:01 5946\n        \tB*15:01 4297\n        \tB*18:01 3710\n        \t\tB*08:01:01      3665\n        \t\tB*18:01:01      2500\n        \t\tB*57:01:01      2434\n        \t\tB*15:01:01      2236\n        \t\t\tB*57:03:04:NA   144\n        \t\t\tB*57:01:01:14   127\n        \t\t\tB*57:01:01:20   127\n        \t\t\tB*57:99:NA:NA   127\nC       280304\n        C*07    193392\n        C*06    33631\n        C*12    18817\n        C*05    10718\n        \tC*07:01 37102\n        \tC*07:02 36435\n        \tC*06:02 11190\n        \tC*07:04 5048\n        \t\tC*07:01:01      21353\n        \t\tC*07:02:01      20340\n        \t\tC*06:02:01      4978\n        \t\tC*05:01:01      2533\n        \t\t\tC*07:02:01:17N  230\n        \t\t\tC*07:777:NA:NA  223\n        \t\t\tC*07:01:01:47   222\n        \t\t\tC*07:109:02:NA  222\nDQB1    92545\n        DQB1*03 43277\n        DQB1*02 27180\n        DQB1*04 10886\n        DQB1*06 10320\n        \tDQB1*02:01      5047\n        \tDQB1*03:02      4872\n        \tDQB1*03:03      4636\n        \tDQB1*03:01      3725\n        \t\tDQB1*03:02:01   1718\n        \t\tDQB1*03:01:01   1535\n        \t\tDQB1*04:02:01   1409\n        \t\tDQB1*02:02:01   1081\n        \t\t\tDQB1*02:59:NA:NA        254\n        \t\t\tDQB1*02:01:01:01        253\n        \t\t\tDQB1*02:01:01:04        250\n        \t\t\tDQB1*02:01:01:02        249\nDRB1    272859\n        DRB1*13 48947\n        DRB1*11 47441\n        DRB1*03 36771\n        DRB1*14 36447\n        \tDRB1*07:01      8146\n        \tDRB1*03:01      7646\n        \tDRB1*11:01      7551\n        \tDRB1*13:01      7468\n        \t\tDRB1*14:54:01   4685\n        \t\tDRB1*13:02:01   4060\n        \t\tDRB1*13:01:01   3660\n        \t\tDRB1*09:01:02   3330\n        \t\t\tDRB1*09:01:02:05        668\n        \t\t\tDRB1*07:01:01:04        667\n        \t\t\tDRB1*07:01:01:05        667\n        \t\t\tDRB1*09:01:02:02        667\n```\n\n## Third-party Dependencies\n\nquickhla requires:\n\n- kraken2 [https://ccb.jhu.edu/software/kraken2/](https://ccb.jhu.edu/software/kraken2/)\n- bowtie2 [http://bowtie-bio.sourceforge.net/bowtie2/index.shtml](http://bowtie-bio.sourceforge.net/bowtie2/index.shtml)\n- hisat2 [https://daehwankimlab.github.io/hisat2/](https://daehwankimlab.github.io/hisat2/)\n- biopython [https://biopython.org/](https://biopython.org/)\n- numpy [https://numpy.org/](https://numpy.org/)\n\nYou can install them manually (see individual download pages):\n\n- kraken2 [https://github.com/DerrickWood/kraken2](https://github.com/DerrickWood/kraken2)\n- bowtie2 [https://sourceforge.net/projects/bowtie-bio/files/bowtie2/2.4.2](https://sourceforge.net/projects/bowtie-bio/files/bowtie2/2.4.2)\n- hisat2 [https://daehwankimlab.github.io/hisat2/download/](https://daehwankimlab.github.io/hisat2/download/)\n- biopython [https://biopython.org/wiki/Download](https://biopython.org/wiki/Download)\n- numpy [https://numpy.org/install/](https://numpy.org/install/)\n\nOr you can install them via conda:\n\n- kraken2 [https://anaconda.org/bioconda/kraken2](https://anaconda.org/bioconda/kraken2)\n- bowtie2 [https://anaconda.org/bioconda/bowtie2](https://anaconda.org/bioconda/bowtie2)\n- hista2 [https://anaconda.org/biobuilds/hisat2](https://anaconda.org/biobuilds/hisat2)\n- biopython [https://anaconda.org/anaconda/biopython](https://anaconda.org/anaconda/biopython)\n- numpy [https://anaconda.org/anaconda/numpy](https://anaconda.org/anaconda/numpy)\n\n```\nconda install -c bioconda kraken2\nconda install -c bioconda bowtie2\nconda install -c biobuilds hisat2\nconda install -c anaconda biopython\nconda install -c anaconda numpy\n```\n\n## Installation\n\n### via Conda\n\n### PyPI\n\n### Manually\n\n```bash\ngit clone https://gitlab.gwdg.de/kristian.ullrich/quickhla.git\ncd quickhla\npython setup.py install\n```\n\n### Manually in conda env\n\n```bash\nconda create -n quickhla python=3.8\nconda activate quickhla\nconda install -c bioconda kraken2\nconda install -c bioconda bowtie2\nconda install -c biobuilds hisat2\nconda install -c anaconda biopython\nconda install -c anaconda numpy\ngit clone https://gitlab.gwdg.de/kristian.ullrich/quickhla.git\ncd quickhla\npython setup.py install\n```\n\n## Example\n\nTest HLA typing for individuals from [https://www.internationalgenome.org/](https://www.internationalgenome.org/)\n\n```\n# download test data\nwget ftp://ftp.1000genomes.ebi.ac.uk/vol1/ftp/phase3/data/HG00100/sequence_read/SRR099966_1.filt.fastq.gz\nwget ftp://ftp.1000genomes.ebi.ac.uk/vol1/ftp/phase3/data/HG00100/sequence_read/SRR099966_2.filt.fastq.gz\n# classify reads - top 4 hits\nquickhla classify -f SRR099966_1.filt.fastq.gz -r SRR099966_2.filt.fastq.gz -d hla.db -db hla.nuc.4d.35 -n 4 -t 12\n# classify reads - top 4 hits - read counts weighted\nquickhla classify -f SRR099966_1.filt.fastq.gz -r SRR099966_2.filt.fastq.gz -d hla.db -db hla.nuc.4d.35 -n 4 -t 12 -w\n```\n\n## Known Issues\n\n## Contributing Code\n\nIf you would like to contribute to CRBHits, please file an issue so that one can establish a statement of need, avoid redundant work, and track progress on your contribution.\n\nBefore you do a pull request, you should always file an issue and make sure that someone from the CRBHits developer team agrees that it’s a problem, and is happy with your basic proposal for fixing it.\n\nOnce an issue has been filed and we've identified how to best orient your contribution with package development as a whole, [fork](https://docs.github.com/en/github/getting-started-with-github/fork-a-repo) the [main repo](https://gitlab.gwdg.de/kristian.ullrich/quickhla), branch off a [feature branch](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/about-branches) from `master`, [commit](https://docs.github.com/en/desktop/contributing-and-collaborating-using-github-desktop/committing-and-reviewing-changes-to-your-project) and [push](https://docs.github.com/en/github/using-git/pushing-commits-to-a-remote-repository) your changes to your fork and submit a [pull request](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/proposing-changes-to-your-work-with-pull-requests) for `quickhla:master`.\n\nBy contributing to this project, you agree to abide by the Code of Conduct terms.\n\n## Bug reports\n\nPlease report any errors or requests regarding [quickhla](https://gitlab.gwdg.de/kristian.ullrich/quickhla) to Kristian Ullrich (ullrich@evolbio.mpg.de)\n\nor use the issue tracker at [https://gitlab.gwdg.de/kristian.ullrich/quickhla/issues](https://gitlab.gwdg.de/kristian.ullrich/quickhla/issues)\n\n## Code of Conduct - Participation guidelines\n\nThis repository adhere to [Contributor Covenant](http://contributor-covenant.org) code of conduct for in any interactions you have within this project. (see [Code of Conduct](https://gitlab.gwdg.de/kristian.ullrich/quickhla/-/blob/master/CODE_OF_CONDUCT.md))\n\nSee also the policy against sexualized discrimination, harassment and violence for the Max Planck Society [Code-of-Conduct](https://www.mpg.de/11961177/code-of-conduct-en.pdf).\n\nBy contributing to this project, you agree to abide by its terms.\n\n## References\n\n1. Buchkovich M.L., Brown C.C., Robasky K., Chai S., Westfall S., Vincent B.G., Weimer E.T., Powers J.G. (2017)\n   **HLAProfiler utilizes k-mer profiles to improve HLA calling accuracy for rare and common alleles in RNA-seq data.**\n  *Genome Med*, **9, 86**. \n   [https://doi.org/10.1186/s13073-017-0473-6](https://doi.org/10.1186/s13073-017-0473-6)\n\n2. Pierini F., Nutsua M., Böhme L., Özer O., Bonczarowska J., Susat J., Franke A., Nebel A., Krause-Kyora B., Lenz T.L. (2020)\n   **Targeted analysis of polymorphic loci from low-coverage shotgun sequence data allows accurate genotyping of HLA genes in historical human populations.**\n   *Sci Rep*, **10, 7339**. [https://doi.org/10.1038/s41598-020-64312-w](https://doi.org/10.1038/s41598-020-64312-w)\n\n3. Robinson J., Barker D.J., Georgiou X., Cooper M.A., Flicek P., Marsh S.G.E. (2020)\n   **IPD-IMGT/HLA Database**\n   *Nucleic Acids Research*, **48(D1), D948–D955**. [https://doi.org/10.1093/nar/gkz950](https://doi.org/10.1093/nar/gkz950)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkullrich%2Fquickhla","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkullrich%2Fquickhla","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkullrich%2Fquickhla/lists"}