hlann


Namehlann JSON
Version 0.0.4 PyPI version JSON
download
home_page
SummaryHLA Annotation (HLAnn) Python package for annotating HLA
upload_time2023-06-07 19:52:41
maintainer
docs_urlNone
authorNMDP Bioinformatics
requires_python
licenseLGPL 3.0
keywords hlann
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # HLA Annotation Pipeline

# Table of Contents
- [Background](#background-)
- [Tools](#tools-)
    - [Python Package](#python-package-)
    - [HLA Annotation Pipeline](#hla-annotation-pipeline-)
- [Docker Deployment](#docker-deployment-)

# Background [⤴](#table-of-contents)
In many cases, modern HLA nomenclature cannot fully describe the various genetic polymorphisms between both primary and reference data, as well as between recipients and stem cell sources. This tool addresses this issue by integrating sequence data with HLA nomenclature to facilitate research into some of these less-accessible genetic polymorphisms. Additionally, various mismatching models (HLA-B leader and HLA-DPB1 expression/TCE, for instance) have been built-in to provide an aggregating hub for aiding in clinical decision-making. This operating procedure details the usage and deployment of this tool.


# Tools [⤴](#table-of-contents)
## Python Package [⤴](#table-of-contents)
### Installation
```
pip install .
```
### Setup
```
from hlann.hlann import HLAnn
hlann = HLAnn(db_version='3470', verbose=True)
```
### Usage
#### Allotype
Command
```
hlann.annotate_allotype('DPB1*01:AETTG')
```
<details>
<summary>Result</summary>
<pre>
{'name': 'DPB1*01:AETTG',
 'tce': '3',
 'resolution': 'intermediate',
 'matched': False,
 'expr_level': '~high',
 'expr_annot_type': '~experimental',
 'alleles': [{'allele_expr': 'DPB1*01:01',
   'CIWD_TOTAL': 'C',
   'exon3_motif_ref': 'ACCACTC',
   'utr3_motif_ref': 'G',
   'tce': '3',
   'resolution': 'high',
   'expr_level': 'high',
   'experimental': True},
  {'allele_expr': 'DPB1*162:01',
   'CIWD_TOTAL': 'WD',
   'exon3_motif_ref': 'GTTGTCT',
   'utr3_motif_ref': 'A',
   'tce': '3',
   'resolution': 'high',
   'expr_level': 'low',
   'experimental': False},
  {'allele_expr': 'DPB1*417:01',
   'CIWD_TOTAL': 'WD',
   'exon3_motif_ref': 'ACCACTC',
   'utr3_motif_ref': 'unknown',
   'tce': '3',
   'resolution': 'high',
   'expr_level': 'high',
   'experimental': False}]}
</pre>
</details>
<br>

#### Genotype
Command
```
hlann.annotate_genotype('DPB1*01:AETTA+DPB1*04:AETTB')
```
<details>
<summary>Result</summary>
<pre>
{
  "allele_one": {
    "alleles": [
      {
        "CIWD": "C",
        "allele_expr": "DPB1*01:01",
        "exon3_motif_ref": "ACCACTC",
        "experimental": true,
        "expr_level": "high",
        "resolution": "high",
        "tce": "3",
        "utr3_motif_ref": "G"
      },
      {
        "CIWD": "WD",
        "allele_expr": "DPB1*417:01",
        "exon3_motif_ref": "ACCACTC",
        "experimental": false,
        "expr_level": "high",
        "resolution": "high",
        "tce": "3",
        "utr3_motif_ref": "unknown"
      }
    ],
    "expr_annot_type": "experimental",
    "expr_level": "high",
    "matched": false,
    "name": "DPB1*01:AETTA",
    "resolution": "intermediate",
    "tce": "3"
  },
  "allele_two": {
    "alleles": [
      {
        "CIWD": "C",
        "allele_expr": "DPB1*04:01",
        "exon3_motif_ref": "GTTGTCT/GTTGCCT/GTTATCT",
        "experimental": true,
        "expr_level": "low",
        "resolution": "high",
        "tce": "3/0",
        "utr3_motif_ref": "A"
      },
      {
        "CIWD": "C",
        "allele_expr": "DPB1*126:01",
        "exon3_motif_ref": "GTTGTCT",
        "experimental": false,
        "expr_level": "low",
        "resolution": "high",
        "tce": "3",
        "utr3_motif_ref": "A"
      },
      {
        "CIWD": "I",
        "allele_expr": "DPB1*350:01",
        "exon3_motif_ref": "ACCACTC",
        "experimental": false,
        "expr_level": "high",
        "resolution": "allelic",
        "tce": "3",
        "utr3_motif_ref": "unknown"
      },
      {
        "CIWD": "WD",
        "allele_expr": "DPB1*415:01",
        "exon3_motif_ref": "GTTGTCT",
        "experimental": false,
        "expr_level": "low",
        "resolution": "allelic",
        "tce": "3",
        "utr3_motif_ref": "A"
      }
    ],
    "expr_annot_type": "~experimental",
    "expr_level": "~low",
    "matched": false,
    "name": "DPB1*04:AETTB",
    "resolution": "intermediate",
    "tce": "3"
  },
  "genotype": "DPB1*01:AETTA+DPB1*04:AETTB"
}
</pre>
</details>
<br>


#### Matches
Command
```
hlann.annotate_match('DPB1*04:01+DPB1*40:01', 'DPB1*40:01+DPB1*40:01')
```
<details>
<summary>Result</summary>
<pre>
{
  "directionality": "GvH",
  "genotype_donor": {
    "allele_one": {
      "alleles": null,
      "expr_annot_type": "experimental",
      "expr_level": "low",
      "matched": true,
      "name": "DPB1*40:01",
      "resolution": "high",
      "tce": "3"
    },
    "allele_two": {
      "alleles": null,
      "expr_annot_type": "experimental",
      "expr_level": "low",
      "matched": true,
      "name": "DPB1*40:01",
      "resolution": "high",
      "tce": "3"
    },
    "genotype": "DPB1*40:01+DPB1*40:01"
  },
  "genotype_recipient": {
    "allele_one": {
      "alleles": null,
      "expr_annot_type": "experimental",
      "expr_level": "low",
      "matched": false,
      "name": "DPB1*04:01",
      "resolution": "high",
      "tce": "3"
    },
    "allele_two": {
      "alleles": null,
      "expr_annot_type": "experimental",
      "expr_level": "low",
      "matched": true,
      "name": "DPB1*40:01",
      "resolution": "high",
      "tce": "3"
    },
    "genotype": "DPB1*04:01+DPB1*40:01"
  },
  "grade": "MA",
  "matched_alleles_don": [
    "DPB1*40:01",
    "DPB1*40:01"
  ],
  "matched_alleles_pat": [
    "DPB1*40:01"
  ],
  "mismatched_allele_pat_expr_level": "low",
  "mismatched_alleles_don": [],
  "mismatched_alleles_pat": [
    "DPB1*04:01"
  ],
  "tce_match": "Permissive"
}
</pre>
</details>
<br>



## HLA Annotation Pipeline [⤴](#table-of-contents)
### Bootstrapping

To begin, ensure that you have Python3 (3.9 was used for this project) installed. To check, issue this command to verify your python version:
```
python --version
```

If Python3 is not installed, please download it from [here](https://www.python.org/downloads/).

If Python3 is readily available, set up your virtual environment by running these commands:
```
python3 -m venv venv
source venv/bin/activate
```

You can also use [Anaconda](https://www.anaconda.com/products/distribution) for the specific python version.
```
conda create -n "venv10" python=3.10
conda activate venv10
```

Pip is the package installer for Python. It comes pre-packaged with Python. This will be used to install our requirements as such:
```
pip install --upgrade pip
pip install -r requirements.txt
```

Once installed, *behave* will be available for testing.

### Initialization

Initialize the web service via this command:
```
streamlit run webapp.py
```

Once initialized, you may access the tool at http://localhost:8501.

### Testing

Running all the tests in this repository is as simple as running this command:
```
behave
```

The results of your BDD tests can sometimes be difficult to view in the terminal. To view the tests results in the browser, we can use allure-behave, which was installed by pip during the bootstrapping process.

You will first need to specify behave to generate formatted allure results

behave -f allure_behave.formatter:AllureFormatter -o tests/results/
Finally, to view these formatted results in the browser, enter this command:

allure serve tests/results

### Docker Deployment [⤴](#table-of-contents)
To build the docker image the following command may be executed in the project root directory:
```
docker build -t agg-match-tool .
```

To deploy the app now we can use the following command. The application should be available in your domain, i.e. `http://host:80/`
```
docker run -d -p 80:80 -t agg-match-tool .
```
To stop the app container, We have to obtain the container id by executing 
```
docker ps -a
```
Then we have to execute 
```
docker stop $CONTAINER_ID
```

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "hlann",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "hlann",
    "author": "NMDP Bioinformatics",
    "author_email": "<rsajulga@nmdp.org>",
    "download_url": "",
    "platform": null,
    "description": "# HLA Annotation Pipeline\n\n# Table of Contents\n- [Background](#background-)\n- [Tools](#tools-)\n    - [Python Package](#python-package-)\n    - [HLA Annotation Pipeline](#hla-annotation-pipeline-)\n- [Docker Deployment](#docker-deployment-)\n\n# Background [\u2934](#table-of-contents)\nIn many cases, modern HLA nomenclature cannot fully describe the various genetic polymorphisms between both primary and reference data, as well as between recipients and stem cell sources. This tool addresses this issue by integrating sequence data with HLA nomenclature to facilitate research into some of these less-accessible genetic polymorphisms. Additionally, various mismatching models (HLA-B leader and HLA-DPB1 expression/TCE, for instance) have been built-in to provide an aggregating hub for aiding in clinical decision-making. This operating procedure details the usage and deployment of this tool.\n\n\n# Tools [\u2934](#table-of-contents)\n## Python Package [\u2934](#table-of-contents)\n### Installation\n```\npip install .\n```\n### Setup\n```\nfrom hlann.hlann import HLAnn\nhlann = HLAnn(db_version='3470', verbose=True)\n```\n### Usage\n#### Allotype\nCommand\n```\nhlann.annotate_allotype('DPB1*01:AETTG')\n```\n<details>\n<summary>Result</summary>\n<pre>\n{'name': 'DPB1*01:AETTG',\n 'tce': '3',\n 'resolution': 'intermediate',\n 'matched': False,\n 'expr_level': '~high',\n 'expr_annot_type': '~experimental',\n 'alleles': [{'allele_expr': 'DPB1*01:01',\n   'CIWD_TOTAL': 'C',\n   'exon3_motif_ref': 'ACCACTC',\n   'utr3_motif_ref': 'G',\n   'tce': '3',\n   'resolution': 'high',\n   'expr_level': 'high',\n   'experimental': True},\n  {'allele_expr': 'DPB1*162:01',\n   'CIWD_TOTAL': 'WD',\n   'exon3_motif_ref': 'GTTGTCT',\n   'utr3_motif_ref': 'A',\n   'tce': '3',\n   'resolution': 'high',\n   'expr_level': 'low',\n   'experimental': False},\n  {'allele_expr': 'DPB1*417:01',\n   'CIWD_TOTAL': 'WD',\n   'exon3_motif_ref': 'ACCACTC',\n   'utr3_motif_ref': 'unknown',\n   'tce': '3',\n   'resolution': 'high',\n   'expr_level': 'high',\n   'experimental': False}]}\n</pre>\n</details>\n<br>\n\n#### Genotype\nCommand\n```\nhlann.annotate_genotype('DPB1*01:AETTA+DPB1*04:AETTB')\n```\n<details>\n<summary>Result</summary>\n<pre>\n{\n  \"allele_one\": {\n    \"alleles\": [\n      {\n        \"CIWD\": \"C\",\n        \"allele_expr\": \"DPB1*01:01\",\n        \"exon3_motif_ref\": \"ACCACTC\",\n        \"experimental\": true,\n        \"expr_level\": \"high\",\n        \"resolution\": \"high\",\n        \"tce\": \"3\",\n        \"utr3_motif_ref\": \"G\"\n      },\n      {\n        \"CIWD\": \"WD\",\n        \"allele_expr\": \"DPB1*417:01\",\n        \"exon3_motif_ref\": \"ACCACTC\",\n        \"experimental\": false,\n        \"expr_level\": \"high\",\n        \"resolution\": \"high\",\n        \"tce\": \"3\",\n        \"utr3_motif_ref\": \"unknown\"\n      }\n    ],\n    \"expr_annot_type\": \"experimental\",\n    \"expr_level\": \"high\",\n    \"matched\": false,\n    \"name\": \"DPB1*01:AETTA\",\n    \"resolution\": \"intermediate\",\n    \"tce\": \"3\"\n  },\n  \"allele_two\": {\n    \"alleles\": [\n      {\n        \"CIWD\": \"C\",\n        \"allele_expr\": \"DPB1*04:01\",\n        \"exon3_motif_ref\": \"GTTGTCT/GTTGCCT/GTTATCT\",\n        \"experimental\": true,\n        \"expr_level\": \"low\",\n        \"resolution\": \"high\",\n        \"tce\": \"3/0\",\n        \"utr3_motif_ref\": \"A\"\n      },\n      {\n        \"CIWD\": \"C\",\n        \"allele_expr\": \"DPB1*126:01\",\n        \"exon3_motif_ref\": \"GTTGTCT\",\n        \"experimental\": false,\n        \"expr_level\": \"low\",\n        \"resolution\": \"high\",\n        \"tce\": \"3\",\n        \"utr3_motif_ref\": \"A\"\n      },\n      {\n        \"CIWD\": \"I\",\n        \"allele_expr\": \"DPB1*350:01\",\n        \"exon3_motif_ref\": \"ACCACTC\",\n        \"experimental\": false,\n        \"expr_level\": \"high\",\n        \"resolution\": \"allelic\",\n        \"tce\": \"3\",\n        \"utr3_motif_ref\": \"unknown\"\n      },\n      {\n        \"CIWD\": \"WD\",\n        \"allele_expr\": \"DPB1*415:01\",\n        \"exon3_motif_ref\": \"GTTGTCT\",\n        \"experimental\": false,\n        \"expr_level\": \"low\",\n        \"resolution\": \"allelic\",\n        \"tce\": \"3\",\n        \"utr3_motif_ref\": \"A\"\n      }\n    ],\n    \"expr_annot_type\": \"~experimental\",\n    \"expr_level\": \"~low\",\n    \"matched\": false,\n    \"name\": \"DPB1*04:AETTB\",\n    \"resolution\": \"intermediate\",\n    \"tce\": \"3\"\n  },\n  \"genotype\": \"DPB1*01:AETTA+DPB1*04:AETTB\"\n}\n</pre>\n</details>\n<br>\n\n\n#### Matches\nCommand\n```\nhlann.annotate_match('DPB1*04:01+DPB1*40:01', 'DPB1*40:01+DPB1*40:01')\n```\n<details>\n<summary>Result</summary>\n<pre>\n{\n  \"directionality\": \"GvH\",\n  \"genotype_donor\": {\n    \"allele_one\": {\n      \"alleles\": null,\n      \"expr_annot_type\": \"experimental\",\n      \"expr_level\": \"low\",\n      \"matched\": true,\n      \"name\": \"DPB1*40:01\",\n      \"resolution\": \"high\",\n      \"tce\": \"3\"\n    },\n    \"allele_two\": {\n      \"alleles\": null,\n      \"expr_annot_type\": \"experimental\",\n      \"expr_level\": \"low\",\n      \"matched\": true,\n      \"name\": \"DPB1*40:01\",\n      \"resolution\": \"high\",\n      \"tce\": \"3\"\n    },\n    \"genotype\": \"DPB1*40:01+DPB1*40:01\"\n  },\n  \"genotype_recipient\": {\n    \"allele_one\": {\n      \"alleles\": null,\n      \"expr_annot_type\": \"experimental\",\n      \"expr_level\": \"low\",\n      \"matched\": false,\n      \"name\": \"DPB1*04:01\",\n      \"resolution\": \"high\",\n      \"tce\": \"3\"\n    },\n    \"allele_two\": {\n      \"alleles\": null,\n      \"expr_annot_type\": \"experimental\",\n      \"expr_level\": \"low\",\n      \"matched\": true,\n      \"name\": \"DPB1*40:01\",\n      \"resolution\": \"high\",\n      \"tce\": \"3\"\n    },\n    \"genotype\": \"DPB1*04:01+DPB1*40:01\"\n  },\n  \"grade\": \"MA\",\n  \"matched_alleles_don\": [\n    \"DPB1*40:01\",\n    \"DPB1*40:01\"\n  ],\n  \"matched_alleles_pat\": [\n    \"DPB1*40:01\"\n  ],\n  \"mismatched_allele_pat_expr_level\": \"low\",\n  \"mismatched_alleles_don\": [],\n  \"mismatched_alleles_pat\": [\n    \"DPB1*04:01\"\n  ],\n  \"tce_match\": \"Permissive\"\n}\n</pre>\n</details>\n<br>\n\n\n\n## HLA Annotation Pipeline [\u2934](#table-of-contents)\n### Bootstrapping\n\nTo begin, ensure that you have Python3 (3.9 was used for this project) installed. To check, issue this command to verify your python version:\n```\npython --version\n```\n\nIf Python3 is not installed, please download it from [here](https://www.python.org/downloads/).\n\nIf Python3 is readily available, set up your virtual environment by running these commands:\n```\npython3 -m venv venv\nsource venv/bin/activate\n```\n\nYou can also use [Anaconda](https://www.anaconda.com/products/distribution) for the specific python version.\n```\nconda create -n \"venv10\" python=3.10\nconda activate venv10\n```\n\nPip is the package installer for Python. It comes pre-packaged with Python. This will be used to install our requirements as such:\n```\npip install --upgrade pip\npip install -r requirements.txt\n```\n\nOnce installed, *behave* will be available for testing.\n\n### Initialization\n\nInitialize the web service via this command:\n```\nstreamlit run webapp.py\n```\n\nOnce initialized, you may access the tool at http://localhost:8501.\n\n### Testing\n\nRunning all the tests in this repository is as simple as running this command:\n```\nbehave\n```\n\nThe results of your BDD tests can sometimes be difficult to view in the terminal. To view the tests results in the browser, we can use allure-behave, which was installed by pip during the bootstrapping process.\n\nYou will first need to specify behave to generate formatted allure results\n\nbehave -f allure_behave.formatter:AllureFormatter -o tests/results/\nFinally, to view these formatted results in the browser, enter this command:\n\nallure serve tests/results\n\n### Docker Deployment [\u2934](#table-of-contents)\nTo build the docker image the following command may be executed in the project root directory:\n```\ndocker build -t agg-match-tool .\n```\n\nTo deploy the app now we can use the following command. The application should be available in your domain, i.e. `http://host:80/`\n```\ndocker run -d -p 80:80 -t agg-match-tool .\n```\nTo stop the app container, We have to obtain the container id by executing \n```\ndocker ps -a\n```\nThen we have to execute \n```\ndocker stop $CONTAINER_ID\n```\n",
    "bugtrack_url": null,
    "license": "LGPL 3.0",
    "summary": "HLA Annotation (HLAnn) Python package for annotating HLA",
    "version": "0.0.4",
    "project_urls": null,
    "split_keywords": [
        "hlann"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ae773d04301b9c902900ff289aa717fa86b7502d76f4b9460e979364025c64fc",
                "md5": "0426b5e4c69c82eccea179a1921ae8ab",
                "sha256": "49bc9e84459c637b6af767ffe3e79d44d936619332cc7885d95d97ea1736c204"
            },
            "downloads": -1,
            "filename": "hlann-0.0.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "0426b5e4c69c82eccea179a1921ae8ab",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 35783490,
            "upload_time": "2023-06-07T19:52:41",
            "upload_time_iso_8601": "2023-06-07T19:52:41.010613Z",
            "url": "https://files.pythonhosted.org/packages/ae/77/3d04301b9c902900ff289aa717fa86b7502d76f4b9460e979364025c64fc/hlann-0.0.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-06-07 19:52:41",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "hlann"
}
        
Elapsed time: 0.10681s