You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+60-27Lines changed: 60 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,10 +8,19 @@ Swiss army knife of **HLA** Nomenclature
8
8
9
9
### `py-ard` is ARD reduction for HLA in Python
10
10
11
-
Human leukocyte antigen (HLA) genes encode cell surface proteins that are important for immune regulation. Exons encoding the Antigen Recognition Domain (ARD) are the most polymorphic region of HLA genes and are important for donor/recipient [HLA matching](https://bethematch.org/patients-and-families/before-transplant/find-a-donor/hla-matching/). The history of allele typing methods has played a major role in determining resolution and ambiguity of reported HLA values. Although HLA [nomenclature](https://www.theatlantic.com/magazine/archive/2023/04/clint-smith-nomenclature-poem/673097/) has not always conformed to the same standard, it is now defined by [The WHO Nomenclature Committee for Factors of the HLA System](https://hla.alleles.org/nomenclature/committee.html). `py-ard` is aware of the variation in historical resolutions and grouping and is able to translate from one representation to another based on alleles published quarterly by [IPD/IMGT-HLA](https://github.com/ANHIG/IMGTHLA/).
12
-
11
+
Human leukocyte antigen (HLA) genes encode cell surface proteins that are important for immune regulation. Exons
12
+
encoding the Antigen Recognition Domain (ARD) are the most polymorphic region of HLA genes and are important for
Note: With `py-ard` version *1.0.0* and higher, the redux API has changed. If your use requires the older API, please install with `pip install py-ard==0.9.2`
42
51
52
+
Note: With `py-ard` version *1.0.0* and higher, the redux API has changed. If your use requires the older API, please
53
+
install with `pip install py-ard==0.9.2`
43
54
44
55
### Install With Homebrew
45
56
@@ -75,7 +86,8 @@ See [Our Contribution Guide](CONTRIBUTING.rst) for open source contribution to `
75
86
76
87
### Using `py-ard` from Python code
77
88
78
-
`py-ard` can be used in a program to reduce/expand HLA GL String representation. If pyard discovers an invalid Allele, it'll throw an Invalid Exception, not silently return an empty result.
89
+
`py-ard` can be used in a program to reduce/expand HLA GL String representation. If pyard discovers an invalid Allele,
90
+
it'll throw an Invalid Exception, not silently return an empty result.
79
91
80
92
#### Initialize `py-ard`
81
93
@@ -85,7 +97,6 @@ Import `pyard` package.
85
97
import pyard
86
98
```
87
99
88
-
89
100
Initialize `ARD` object with a version of IMGT HLA database
90
101
91
102
```python
@@ -94,7 +105,10 @@ import pyard
94
105
ard = pyard.init('3510')
95
106
```
96
107
97
-
When processing a large numbers of typings, it's helpful to have a cache of previously calculated reductions to make similar typings reduce faster. The cache size of pre-computed reductions can be changed from the default of 1,000 by setting `cache_size` argument. This increases the memory footprint but will significantly increase the processing times for large number of reductions.
108
+
When processing a large numbers of typings, it's helpful to have a cache of previously calculated reductions to make
109
+
similar typings reduce faster. The cache size of pre-computed reductions can be changed from the default of 1,000 by
110
+
setting `cache_size` argument. This increases the memory footprint but will significantly increase the processing times
By default, the IPD-IMGT/HLA data is stored locally in `$TMPDIR/pyard`. This may be removed when your computer restarts. You can specify a different, more permanent directory for the cached data.
120
+
By default, the IPD-IMGT/HLA data is stored locally in `$TMPDIR/pyard`. This may be removed when your computer restarts.
121
+
You can specify a different, more permanent directory for the cached data.
107
122
108
123
```python
109
124
import pyard.ard
@@ -126,13 +141,15 @@ ard = pyard.init()
126
141
```
127
142
128
143
You can check the current version of IPD-IMGT/HLA database.
144
+
129
145
```python
130
146
ard.get_db_version()
131
147
```
132
148
133
149
### Reduce Typings
134
150
135
-
**Note**: Previous to version of 1.0.0 release of `py-ard`, there was `redux` and `redux_gl` methods on `ard`. They have been consolidated so that `redux` handles both GL Strings and individual alleles.
151
+
**Note**: Previous to version of 1.0.0 release of `py-ard`, there was `redux` and `redux_gl` methods on `ard`. They have
152
+
been consolidated so that `redux` handles both GL Strings and individual alleles.
136
153
137
154
Reduce a single locus HLA Typing by specifying the allele/MAC/XX code and the reduction method to `redux` method.
`py-ard` works well from `R` as well. Please see [Using pyard from R language](https://github.com/nmdp-bioinformatics/py-ard/wiki/Using-pyard-library-from-R-language) page for detailed walkthrough.
248
+
`py-ard` works well from `R` as well. Please
249
+
see [Using pyard from R language](https://github.com/nmdp-bioinformatics/py-ard/wiki/Using-pyard-library-from-R-language)
250
+
page for detailed walkthrough.
230
251
231
252
## Command Line Tools
232
253
233
-
Various command line interface (CLI) tools are available to use for managing local IPD-IMGT/HLA cache database, running impromptu reduction queries and batch processing of CSV files.
254
+
Various command line interface (CLI) tools are available to use for managing local IPD-IMGT/HLA cache database, running
255
+
impromptu reduction queries and batch processing of CSV files.
234
256
235
-
For all tools, use `--imgt-version` and `--data-dir` to specify the IPD-IMGT/HLA database version and the directory where the SQLite files are created.
257
+
For all tools, use `--imgt-version` and `--data-dir` to specify the IPD-IMGT/HLA database version and the directory
258
+
where the SQLite files are created.
236
259
237
260
### `pyard-import` Import the latest IPD-IMGT/HLA database
238
261
239
262
`pyard-import` helps with importing and reinstalling of prepared IPD-IMGT/HLA and MAC data.
240
263
241
264
Use `pyard-import -h` to see all the options available.
`pyard-status` goes through all the available databases and checks all the tables that should be available. This is very helpful to show all the databases, number of rows in each table, any missing tables and the stored IPD-IMGT/HLA version.
340
+
`pyard-status` goes through all the available databases and checks all the tables that should be available. This is very
341
+
helpful to show all the databases, number of rows in each table, any missing tables and the stored IPD-IMGT/HLA version.
317
342
318
343
```shell
319
344
$ pyard-status
320
345
```
321
346
322
347
Use ` --data-dir` to specify an alternate directory for cached database files.
348
+
323
349
```shell
324
350
$ pyard-status --data-dir ~/.pyard/
325
351
IMGT DB Version: Latest (3440)
@@ -348,7 +374,9 @@ Size: 533.37MB
348
374
349
375
### `pyard` Redux quickly
350
376
351
-
`pyard` command can be used for quick reductions from the command line. Use `--help` option to see all the available options.
377
+
`pyard` command can be used for quick reductions from the command line. Use `--help` option to see all the available
Reduce from command line by specifying any typing with `-g` or `--gl` option and the reduction method with `-r` or `--redux-type` option.
402
+
Reduce from command line by specifying any typing with `-g` or `--gl` option and the reduction method with `-r`
403
+
or `--redux-type` option.
375
404
376
405
```shell
377
406
$ pyard -g 'A*01:AB' -r lgx
@@ -429,14 +458,16 @@ B14 = B64/B65
429
458
430
459
### `pyard-csv-reduce` Batch Reduce a CSV file
431
460
432
-
`pyard-csv-reduce` can be used to batch process a CSV file with HLA typings. See [documentation](extras/README.md) for detailed information about all the options.
433
-
461
+
`pyard-csv-reduce` can be used to batch process a CSV file with HLA typings. See [documentation](extras/README.md) for
462
+
detailed information about all the options.
434
463
435
464
## `py-ard` REST Web Service
436
465
437
466
Run `py-ard` as a service so that it can be accessed as a REST service endpoint.
438
467
439
-
To start in debug mode, you can run the `app.py` script. The endpoint should then be available at [localhost:8080](http://0.0.0.0:8080)
468
+
To start in debug mode, you can run the `app.py` script. The endpoint should then be available
469
+
at [localhost:8080](http://0.0.0.0:8080)
470
+
440
471
```shell
441
472
$ python app.py
442
473
* Serving Flask app 'app'
@@ -453,13 +484,15 @@ Press CTRL+C to quit
453
484
For deploying to production, build a Docker image and use that image for deploying to a server.
454
485
455
486
Build the docker image:
487
+
456
488
```shell
457
489
make docker-build
458
490
```
459
491
460
492
builds a Docker image named `pyard-service:latest`
Given the GL String we want to find CWD of is "DRB1*14:XX"
52
+
When we find CWD alleles for the GL String
53
+
Then the CWD alleles should be "DRB1*14:01/DRB1*14:02/DRB1*14:03/DRB1*14:04/DRB1*14:05/DRB1*14:06/DRB1*14:07/DRB1*14:08/DRB1*14:09/DRB1*14:10/DRB1*14:11/DRB1*14:12/DRB1*14:13/DRB1*14:14/DRB1*14:15/DRB1*14:16/DRB1*14:17/DRB1*14:18/DRB1*14:19/DRB1*14:20/DRB1*14:21/DRB1*14:22/DRB1*14:24/DRB1*14:25/DRB1*14:28/DRB1*14:29/DRB1*14:33/DRB1*14:48/DRB1*14:61/DRB1*14:70"
0 commit comments