RBCeq2 2.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- rbceq2-2.1.0/LICENSE +7 -0
- rbceq2-2.1.0/PKG-INFO +141 -0
- rbceq2-2.1.0/README.rst +114 -0
- rbceq2-2.1.0/pyproject.toml +63 -0
- rbceq2-2.1.0/setup.cfg +4 -0
- rbceq2-2.1.0/src/RBCeq2.egg-info/PKG-INFO +141 -0
- rbceq2-2.1.0/src/RBCeq2.egg-info/SOURCES.txt +42 -0
- rbceq2-2.1.0/src/RBCeq2.egg-info/dependency_links.txt +1 -0
- rbceq2-2.1.0/src/RBCeq2.egg-info/entry_points.txt +2 -0
- rbceq2-2.1.0/src/RBCeq2.egg-info/requires.txt +9 -0
- rbceq2-2.1.0/src/RBCeq2.egg-info/top_level.txt +1 -0
- rbceq2-2.1.0/src/rbceq2/IO/PDF_reports.py +540 -0
- rbceq2-2.1.0/src/rbceq2/IO/__init__.py +0 -0
- rbceq2-2.1.0/src/rbceq2/IO/record_data.py +114 -0
- rbceq2-2.1.0/src/rbceq2/IO/validation.py +132 -0
- rbceq2-2.1.0/src/rbceq2/IO/vcf.py +363 -0
- rbceq2-2.1.0/src/rbceq2/__init__.py +0 -0
- rbceq2-2.1.0/src/rbceq2/core_logic/__init__.py +0 -0
- rbceq2-2.1.0/src/rbceq2/core_logic/alleles.py +516 -0
- rbceq2-2.1.0/src/rbceq2/core_logic/co_existing.py +654 -0
- rbceq2-2.1.0/src/rbceq2/core_logic/constants.py +343 -0
- rbceq2-2.1.0/src/rbceq2/core_logic/data_procesing.py +999 -0
- rbceq2-2.1.0/src/rbceq2/core_logic/utils.py +314 -0
- rbceq2-2.1.0/src/rbceq2/db/__init__.py +0 -0
- rbceq2-2.1.0/src/rbceq2/db/db.py +282 -0
- rbceq2-2.1.0/src/rbceq2/filters/__init__.py +0 -0
- rbceq2-2.1.0/src/rbceq2/filters/geno.py +1234 -0
- rbceq2-2.1.0/src/rbceq2/main.py +332 -0
- rbceq2-2.1.0/src/rbceq2/phenotype/__init__.py +0 -0
- rbceq2-2.1.0/src/rbceq2/phenotype/antigens.py +455 -0
- rbceq2-2.1.0/src/rbceq2/phenotype/choose_pheno.py +1145 -0
- rbceq2-2.1.0/src/rbceq2/resources/db.tsv +1869 -0
- rbceq2-2.1.0/tests/test_IO.py +217 -0
- rbceq2-2.1.0/tests/test_VCF.py +416 -0
- rbceq2-2.1.0/tests/test_alleles.py +222 -0
- rbceq2-2.1.0/tests/test_ants.py +374 -0
- rbceq2-2.1.0/tests/test_choose_pheno.py +2473 -0
- rbceq2-2.1.0/tests/test_coexisting.py +2291 -0
- rbceq2-2.1.0/tests/test_data_processing.py +4190 -0
- rbceq2-2.1.0/tests/test_db.py +178 -0
- rbceq2-2.1.0/tests/test_filters.py +2345 -0
- rbceq2-2.1.0/tests/test_main.py +5 -0
- rbceq2-2.1.0/tests/test_pdf.py +101 -0
- rbceq2-2.1.0/tests/test_utils.py +362 -0
rbceq2-2.1.0/LICENSE
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
Copyright 2025 Australian Red Cross Lifeblood
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
4
|
+
|
|
5
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
6
|
+
|
|
7
|
+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
rbceq2-2.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: RBCeq2
|
|
3
|
+
Version: 2.1.0
|
|
4
|
+
Summary: Call ISBT alleles from VCF/s
|
|
5
|
+
Author-email: Liam McIntyre <limcintyre@redcrossblood.org.au>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Repository, https://...
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
10
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
11
|
+
Classifier: Operating System :: OS Independent
|
|
12
|
+
Classifier: Intended Audience :: Science/Research
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
|
|
15
|
+
Requires-Python: >=3.12
|
|
16
|
+
Description-Content-Type: text/x-rst
|
|
17
|
+
License-File: LICENSE
|
|
18
|
+
Requires-Dist: pandas>=2.2.2
|
|
19
|
+
Requires-Dist: polars>=0.20.26
|
|
20
|
+
Requires-Dist: icecream>=2.1
|
|
21
|
+
Requires-Dist: loguru>=0.7.2
|
|
22
|
+
Requires-Dist: pyarrow>=18.1
|
|
23
|
+
Provides-Extra: dev
|
|
24
|
+
Requires-Dist: flake8>=3.9.2; extra == "dev"
|
|
25
|
+
Requires-Dist: coverage>=7.0; extra == "dev"
|
|
26
|
+
Dynamic: license-file
|
|
27
|
+
|
|
28
|
+
RBCeq2 documentation
|
|
29
|
+
====================
|
|
30
|
+
|
|
31
|
+
.. warning::
|
|
32
|
+
NOT FOR CLINICAL USE
|
|
33
|
+
|
|
34
|
+
RBCeq2 reads in genomic variant data in the form of variant call files (VCF) and outputs blood group (BG) genotypes and phenotypes. The user docs (Word) explains how RBCeq2 constructs possible allele combinations and then filters them until only possible genotype/phenotype combinations remain. Internal to the tool, all variants are based on human genome release GRCh37 or GRCh38, and in the context of a variant ‘_ref’ means no change to the reference nucleotide for the associated position.
|
|
35
|
+
|
|
36
|
+
Overview
|
|
37
|
+
--------
|
|
38
|
+
|
|
39
|
+
At the highest level RBCeq2 finds all possible alleles, then filters out those that fail certain logic checks. This allows for an auditable trail of why it has reached a certain result. Every effort has been made to be explicit both in encoding alleles in our database and while writing code. This results in verbose but unambiguous results. Some tools in this space employ Baysian or other likihood methods to filter results – we chose not to do that initially but might add it as an optional feature in the future. Last, some liberties have been taken to standardise syntax and nomenclature across blood groups.
|
|
40
|
+
|
|
41
|
+
This initial release of RBCeq2 is focused on perfecting the calling of International Society for Blood Transfusion (ISBT) defined BG alleles from simple variants (i.e single nucleotide variant -SNVs/small INDEL) that can be found in standard short read or microarray derived VCFs. Further, it supports the use of long read VCFs (i.e large indels and phased data). However, these features are not as polished.
|
|
42
|
+
|
|
43
|
+
Bugs
|
|
44
|
+
----
|
|
45
|
+
|
|
46
|
+
This software is extensively tested and accurately reports genotypes/phenotypes based on our inhouse definitions of the ‘correct’ answer, however, there are some examples where the ‘correct’ answer is subjective. These docs are detailed – if you find what you think is a bug in the results from RBCeq2 please take the time to understand if it inline with what we intended or not. We will endeavor to fix any black and white bugs in less than one week. Most of these will be rare variants that are encoded wrong in our database. Further, we value any and all feedback and feature requests.
|
|
47
|
+
|
|
48
|
+
How To
|
|
49
|
+
------
|
|
50
|
+
|
|
51
|
+
Install via pip (python3.12+) or clone the git repository:
|
|
52
|
+
|
|
53
|
+
.. code-block:: bash
|
|
54
|
+
|
|
55
|
+
pip install RBCeq2
|
|
56
|
+
|
|
57
|
+
Show help:
|
|
58
|
+
|
|
59
|
+
.. code-block:: bash
|
|
60
|
+
|
|
61
|
+
rbceq2 -h
|
|
62
|
+
|
|
63
|
+
Usage:
|
|
64
|
+
|
|
65
|
+
.. code-block:: text
|
|
66
|
+
|
|
67
|
+
usage: py main.py --vcf example_multi_sample.vcf.gz --out example --reference_genome GRCh37
|
|
68
|
+
|
|
69
|
+
options:
|
|
70
|
+
-h, show this help message and exit
|
|
71
|
+
--vcf Path to vcf file/s
|
|
72
|
+
--out Prefix for output files (default: None)
|
|
73
|
+
--allele_depth Allele depth (default: 10)
|
|
74
|
+
--genotype_quality Genotype quality (default: 10)
|
|
75
|
+
--processes Number of processes (default: 1)
|
|
76
|
+
#More is faster, so long as you have that many CPUs and matched RAM (1:1) available
|
|
77
|
+
--reference_genome GRCh37/8 (default: None)
|
|
78
|
+
#If your result are all reference/wildtype then you probably got this wrong
|
|
79
|
+
--phased Use phase information (default: False)
|
|
80
|
+
--microarray Input is from a microarray. (default: False)
|
|
81
|
+
--debug Enable debug logging. If not set, logging will be at info level. (default: False)
|
|
82
|
+
#Turn on to generate output like what is used in the examples in the user documentation
|
|
83
|
+
--validate Enable VCF validation. Doubles run time (default: False)
|
|
84
|
+
#Not normally needed
|
|
85
|
+
--PDFs Make single sample PDF reports
|
|
86
|
+
|
|
87
|
+
Output
|
|
88
|
+
------
|
|
89
|
+
|
|
90
|
+
RBCeq2 generates a ``log.txt``, three programmatically passable TSVs, and a folder with one PDF per sample. The TSVs (one for the genotype and two for phenotype [numeric and alphanumeric separately]) have BGs as column names and sample names (from VCF) as the rows.
|
|
91
|
+
|
|
92
|
+
1000 Genomes Examples
|
|
93
|
+
^^^^^^^^^^^^^^^^^^^^^
|
|
94
|
+
|
|
95
|
+
Genotypes
|
|
96
|
+
"""""""""
|
|
97
|
+
|
|
98
|
+
+---------+--------------------------------------------------+-------------------------+---------------------+
|
|
99
|
+
| | A4GALT | ABCB6 | ABCC1 |
|
|
100
|
+
+=========+==================================================+=========================+=====================+
|
|
101
|
+
| GM18501 | A4GALT*01/A4GALT*02, A4GALT*01/A4GALT*02.02 | ABCB6*01/ABCB6*01W.02 | ABCC1*01/ABCC1*01 |
|
|
102
|
+
+---------+--------------------------------------------------+-------------------------+---------------------+
|
|
103
|
+
| GM18519 | A4GALT*01.02/A4GALT*01.02 | ABCB6*01/ABCB6*01W.02 | ABCC1*01/ABCC1*01 |
|
|
104
|
+
+---------+--------------------------------------------------+-------------------------+---------------------+
|
|
105
|
+
| GM18856 | A4GALT*01/A4GALT*01.02 | ABCB6*01/ABCB6*01 | ABCC1*01/ABCC1*01 |
|
|
106
|
+
+---------+--------------------------------------------------+-------------------------+---------------------+
|
|
107
|
+
|
|
108
|
+
*Note:* In the genotypes TSV, allele pairs are separated by ``/`` and if multiple pairs are possible these are separated by ``,``.
|
|
109
|
+
|
|
110
|
+
Phenotype Alphanumeric
|
|
111
|
+
""""""""""""""""""""""
|
|
112
|
+
|
|
113
|
+
+---------+----------------+-------+-------+
|
|
114
|
+
| | A4GALT | ABCB6 | ABCC1 |
|
|
115
|
+
+=========+================+=======+=======+
|
|
116
|
+
| GM18501 | P1+,Pk+,(P2+) | Lan+ | WLF+ |
|
|
117
|
+
+---------+----------------+-------+-------+
|
|
118
|
+
| GM18519 | P1+,Pk+ | Lan+ | WLF+ |
|
|
119
|
+
+---------+----------------+-------+-------+
|
|
120
|
+
| GM18856 | P1+,Pk+ | Lan+ | WLF+ |
|
|
121
|
+
+---------+----------------+-------+-------+
|
|
122
|
+
|
|
123
|
+
Phenotype Numeric
|
|
124
|
+
"""""""""""""""""
|
|
125
|
+
|
|
126
|
+
+---------+--------+-------+---------+
|
|
127
|
+
| | A4GALT | ABCB6 | ABCC1 |
|
|
128
|
+
+=========+========+=======+=========+
|
|
129
|
+
| GM18501 | | | ABCC1:1 |
|
|
130
|
+
+---------+--------+-------+---------+
|
|
131
|
+
| GM18519 | | | ABCC1:1 |
|
|
132
|
+
+---------+--------+-------+---------+
|
|
133
|
+
| GM18856 | | | ABCC1:1 |
|
|
134
|
+
+---------+--------+-------+---------+
|
|
135
|
+
|
|
136
|
+
In the phenotype TSVs, antigens are separated by ``,`` so if multiple phenotypes are possible they’re separated by `` | `` (e.g., ``DO:1,2 | DO:1,2,5``). Note, not all BGs have both a numeric and alphanumeric phenotype.
|
|
137
|
+
|
|
138
|
+
Further details
|
|
139
|
+
^^^^^^^^^^^^^^^
|
|
140
|
+
|
|
141
|
+
Please see the RBCeq2 user documentation Word doc
|
rbceq2-2.1.0/README.rst
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
RBCeq2 documentation
|
|
2
|
+
====================
|
|
3
|
+
|
|
4
|
+
.. warning::
|
|
5
|
+
NOT FOR CLINICAL USE
|
|
6
|
+
|
|
7
|
+
RBCeq2 reads in genomic variant data in the form of variant call files (VCF) and outputs blood group (BG) genotypes and phenotypes. The user docs (Word) explains how RBCeq2 constructs possible allele combinations and then filters them until only possible genotype/phenotype combinations remain. Internal to the tool, all variants are based on human genome release GRCh37 or GRCh38, and in the context of a variant ‘_ref’ means no change to the reference nucleotide for the associated position.
|
|
8
|
+
|
|
9
|
+
Overview
|
|
10
|
+
--------
|
|
11
|
+
|
|
12
|
+
At the highest level RBCeq2 finds all possible alleles, then filters out those that fail certain logic checks. This allows for an auditable trail of why it has reached a certain result. Every effort has been made to be explicit both in encoding alleles in our database and while writing code. This results in verbose but unambiguous results. Some tools in this space employ Baysian or other likihood methods to filter results – we chose not to do that initially but might add it as an optional feature in the future. Last, some liberties have been taken to standardise syntax and nomenclature across blood groups.
|
|
13
|
+
|
|
14
|
+
This initial release of RBCeq2 is focused on perfecting the calling of International Society for Blood Transfusion (ISBT) defined BG alleles from simple variants (i.e single nucleotide variant -SNVs/small INDEL) that can be found in standard short read or microarray derived VCFs. Further, it supports the use of long read VCFs (i.e large indels and phased data). However, these features are not as polished.
|
|
15
|
+
|
|
16
|
+
Bugs
|
|
17
|
+
----
|
|
18
|
+
|
|
19
|
+
This software is extensively tested and accurately reports genotypes/phenotypes based on our inhouse definitions of the ‘correct’ answer, however, there are some examples where the ‘correct’ answer is subjective. These docs are detailed – if you find what you think is a bug in the results from RBCeq2 please take the time to understand if it inline with what we intended or not. We will endeavor to fix any black and white bugs in less than one week. Most of these will be rare variants that are encoded wrong in our database. Further, we value any and all feedback and feature requests.
|
|
20
|
+
|
|
21
|
+
How To
|
|
22
|
+
------
|
|
23
|
+
|
|
24
|
+
Install via pip (python3.12+) or clone the git repository:
|
|
25
|
+
|
|
26
|
+
.. code-block:: bash
|
|
27
|
+
|
|
28
|
+
pip install RBCeq2
|
|
29
|
+
|
|
30
|
+
Show help:
|
|
31
|
+
|
|
32
|
+
.. code-block:: bash
|
|
33
|
+
|
|
34
|
+
rbceq2 -h
|
|
35
|
+
|
|
36
|
+
Usage:
|
|
37
|
+
|
|
38
|
+
.. code-block:: text
|
|
39
|
+
|
|
40
|
+
usage: py main.py --vcf example_multi_sample.vcf.gz --out example --reference_genome GRCh37
|
|
41
|
+
|
|
42
|
+
options:
|
|
43
|
+
-h, show this help message and exit
|
|
44
|
+
--vcf Path to vcf file/s
|
|
45
|
+
--out Prefix for output files (default: None)
|
|
46
|
+
--allele_depth Allele depth (default: 10)
|
|
47
|
+
--genotype_quality Genotype quality (default: 10)
|
|
48
|
+
--processes Number of processes (default: 1)
|
|
49
|
+
#More is faster, so long as you have that many CPUs and matched RAM (1:1) available
|
|
50
|
+
--reference_genome GRCh37/8 (default: None)
|
|
51
|
+
#If your result are all reference/wildtype then you probably got this wrong
|
|
52
|
+
--phased Use phase information (default: False)
|
|
53
|
+
--microarray Input is from a microarray. (default: False)
|
|
54
|
+
--debug Enable debug logging. If not set, logging will be at info level. (default: False)
|
|
55
|
+
#Turn on to generate output like what is used in the examples in the user documentation
|
|
56
|
+
--validate Enable VCF validation. Doubles run time (default: False)
|
|
57
|
+
#Not normally needed
|
|
58
|
+
--PDFs Make single sample PDF reports
|
|
59
|
+
|
|
60
|
+
Output
|
|
61
|
+
------
|
|
62
|
+
|
|
63
|
+
RBCeq2 generates a ``log.txt``, three programmatically passable TSVs, and a folder with one PDF per sample. The TSVs (one for the genotype and two for phenotype [numeric and alphanumeric separately]) have BGs as column names and sample names (from VCF) as the rows.
|
|
64
|
+
|
|
65
|
+
1000 Genomes Examples
|
|
66
|
+
^^^^^^^^^^^^^^^^^^^^^
|
|
67
|
+
|
|
68
|
+
Genotypes
|
|
69
|
+
"""""""""
|
|
70
|
+
|
|
71
|
+
+---------+--------------------------------------------------+-------------------------+---------------------+
|
|
72
|
+
| | A4GALT | ABCB6 | ABCC1 |
|
|
73
|
+
+=========+==================================================+=========================+=====================+
|
|
74
|
+
| GM18501 | A4GALT*01/A4GALT*02, A4GALT*01/A4GALT*02.02 | ABCB6*01/ABCB6*01W.02 | ABCC1*01/ABCC1*01 |
|
|
75
|
+
+---------+--------------------------------------------------+-------------------------+---------------------+
|
|
76
|
+
| GM18519 | A4GALT*01.02/A4GALT*01.02 | ABCB6*01/ABCB6*01W.02 | ABCC1*01/ABCC1*01 |
|
|
77
|
+
+---------+--------------------------------------------------+-------------------------+---------------------+
|
|
78
|
+
| GM18856 | A4GALT*01/A4GALT*01.02 | ABCB6*01/ABCB6*01 | ABCC1*01/ABCC1*01 |
|
|
79
|
+
+---------+--------------------------------------------------+-------------------------+---------------------+
|
|
80
|
+
|
|
81
|
+
*Note:* In the genotypes TSV, allele pairs are separated by ``/`` and if multiple pairs are possible these are separated by ``,``.
|
|
82
|
+
|
|
83
|
+
Phenotype Alphanumeric
|
|
84
|
+
""""""""""""""""""""""
|
|
85
|
+
|
|
86
|
+
+---------+----------------+-------+-------+
|
|
87
|
+
| | A4GALT | ABCB6 | ABCC1 |
|
|
88
|
+
+=========+================+=======+=======+
|
|
89
|
+
| GM18501 | P1+,Pk+,(P2+) | Lan+ | WLF+ |
|
|
90
|
+
+---------+----------------+-------+-------+
|
|
91
|
+
| GM18519 | P1+,Pk+ | Lan+ | WLF+ |
|
|
92
|
+
+---------+----------------+-------+-------+
|
|
93
|
+
| GM18856 | P1+,Pk+ | Lan+ | WLF+ |
|
|
94
|
+
+---------+----------------+-------+-------+
|
|
95
|
+
|
|
96
|
+
Phenotype Numeric
|
|
97
|
+
"""""""""""""""""
|
|
98
|
+
|
|
99
|
+
+---------+--------+-------+---------+
|
|
100
|
+
| | A4GALT | ABCB6 | ABCC1 |
|
|
101
|
+
+=========+========+=======+=========+
|
|
102
|
+
| GM18501 | | | ABCC1:1 |
|
|
103
|
+
+---------+--------+-------+---------+
|
|
104
|
+
| GM18519 | | | ABCC1:1 |
|
|
105
|
+
+---------+--------+-------+---------+
|
|
106
|
+
| GM18856 | | | ABCC1:1 |
|
|
107
|
+
+---------+--------+-------+---------+
|
|
108
|
+
|
|
109
|
+
In the phenotype TSVs, antigens are separated by ``,`` so if multiple phenotypes are possible they’re separated by `` | `` (e.g., ``DO:1,2 | DO:1,2,5``). Note, not all BGs have both a numeric and alphanumeric phenotype.
|
|
110
|
+
|
|
111
|
+
Further details
|
|
112
|
+
^^^^^^^^^^^^^^^
|
|
113
|
+
|
|
114
|
+
Please see the RBCeq2 user documentation Word doc
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# pyproject.toml
|
|
2
|
+
|
|
3
|
+
[build-system]
|
|
4
|
+
requires = ["setuptools>=61.0"] # Minimum version of setuptools needed
|
|
5
|
+
build-backend = "setuptools.build_meta"
|
|
6
|
+
|
|
7
|
+
[project]
|
|
8
|
+
name = "RBCeq2"
|
|
9
|
+
version = "2.1.0"
|
|
10
|
+
description = "Call ISBT alleles from VCF/s"
|
|
11
|
+
readme = "README.rst" # <-- Use the RST file we created
|
|
12
|
+
license = { text = "MIT" } # Or use { file = "LICENSE" } if you have a LICENSE file
|
|
13
|
+
requires-python = ">=3.12"
|
|
14
|
+
authors = [
|
|
15
|
+
{ name = "Liam McIntyre", email = "limcintyre@redcrossblood.org.au" }
|
|
16
|
+
]
|
|
17
|
+
classifiers = [
|
|
18
|
+
"Programming Language :: Python :: 3",
|
|
19
|
+
"Programming Language :: Python :: 3.12",
|
|
20
|
+
"License :: OSI Approved :: MIT License",
|
|
21
|
+
"Operating System :: OS Independent",
|
|
22
|
+
"Intended Audience :: Science/Research",
|
|
23
|
+
"Intended Audience :: Developers",
|
|
24
|
+
"Topic :: Scientific/Engineering :: Bio-Informatics",
|
|
25
|
+
]
|
|
26
|
+
dependencies = [
|
|
27
|
+
"pandas>=2.2.2",
|
|
28
|
+
"polars>=0.20.26",
|
|
29
|
+
"icecream>=2.1",
|
|
30
|
+
"loguru>=0.7.2",
|
|
31
|
+
"pyarrow>=18.1", # Note: pyarrow can be large, ensure it's strictly necessary
|
|
32
|
+
]
|
|
33
|
+
|
|
34
|
+
[project.urls]
|
|
35
|
+
# Homepage = "https://..." # Optional: Add if you have a project website
|
|
36
|
+
Repository = "https://..." # TODO: UPDATE THIS URL
|
|
37
|
+
|
|
38
|
+
[project.scripts]
|
|
39
|
+
rbceq2 = "rbceq2.main:main"
|
|
40
|
+
|
|
41
|
+
[project.optional-dependencies]
|
|
42
|
+
dev = [
|
|
43
|
+
"flake8>=3.9.2",
|
|
44
|
+
"coverage>=7.0",
|
|
45
|
+
# You might want to add build tools here too:
|
|
46
|
+
# "build",
|
|
47
|
+
# "twine",
|
|
48
|
+
# "pytest",
|
|
49
|
+
]
|
|
50
|
+
|
|
51
|
+
# --- Setuptools specific configuration ---
|
|
52
|
+
# Corresponds to [options] and sub-sections in setup.cfg
|
|
53
|
+
|
|
54
|
+
[tool.setuptools]
|
|
55
|
+
include-package-data = true # Corresponds to include_package_data in [options]
|
|
56
|
+
|
|
57
|
+
[tool.setuptools.packages.find]
|
|
58
|
+
where = ["src"] # Corresponds to package_dir = = src and where = src
|
|
59
|
+
|
|
60
|
+
[tool.setuptools.package-data]
|
|
61
|
+
# Corresponds to [options.package_data]
|
|
62
|
+
# The key is the package name, the value is a list of glob patterns
|
|
63
|
+
rbceq2 = ["resources/*.tsv"]
|
rbceq2-2.1.0/setup.cfg
ADDED
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: RBCeq2
|
|
3
|
+
Version: 2.1.0
|
|
4
|
+
Summary: Call ISBT alleles from VCF/s
|
|
5
|
+
Author-email: Liam McIntyre <limcintyre@redcrossblood.org.au>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Repository, https://...
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
10
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
11
|
+
Classifier: Operating System :: OS Independent
|
|
12
|
+
Classifier: Intended Audience :: Science/Research
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
|
|
15
|
+
Requires-Python: >=3.12
|
|
16
|
+
Description-Content-Type: text/x-rst
|
|
17
|
+
License-File: LICENSE
|
|
18
|
+
Requires-Dist: pandas>=2.2.2
|
|
19
|
+
Requires-Dist: polars>=0.20.26
|
|
20
|
+
Requires-Dist: icecream>=2.1
|
|
21
|
+
Requires-Dist: loguru>=0.7.2
|
|
22
|
+
Requires-Dist: pyarrow>=18.1
|
|
23
|
+
Provides-Extra: dev
|
|
24
|
+
Requires-Dist: flake8>=3.9.2; extra == "dev"
|
|
25
|
+
Requires-Dist: coverage>=7.0; extra == "dev"
|
|
26
|
+
Dynamic: license-file
|
|
27
|
+
|
|
28
|
+
RBCeq2 documentation
|
|
29
|
+
====================
|
|
30
|
+
|
|
31
|
+
.. warning::
|
|
32
|
+
NOT FOR CLINICAL USE
|
|
33
|
+
|
|
34
|
+
RBCeq2 reads in genomic variant data in the form of variant call files (VCF) and outputs blood group (BG) genotypes and phenotypes. The user docs (Word) explains how RBCeq2 constructs possible allele combinations and then filters them until only possible genotype/phenotype combinations remain. Internal to the tool, all variants are based on human genome release GRCh37 or GRCh38, and in the context of a variant ‘_ref’ means no change to the reference nucleotide for the associated position.
|
|
35
|
+
|
|
36
|
+
Overview
|
|
37
|
+
--------
|
|
38
|
+
|
|
39
|
+
At the highest level RBCeq2 finds all possible alleles, then filters out those that fail certain logic checks. This allows for an auditable trail of why it has reached a certain result. Every effort has been made to be explicit both in encoding alleles in our database and while writing code. This results in verbose but unambiguous results. Some tools in this space employ Baysian or other likihood methods to filter results – we chose not to do that initially but might add it as an optional feature in the future. Last, some liberties have been taken to standardise syntax and nomenclature across blood groups.
|
|
40
|
+
|
|
41
|
+
This initial release of RBCeq2 is focused on perfecting the calling of International Society for Blood Transfusion (ISBT) defined BG alleles from simple variants (i.e single nucleotide variant -SNVs/small INDEL) that can be found in standard short read or microarray derived VCFs. Further, it supports the use of long read VCFs (i.e large indels and phased data). However, these features are not as polished.
|
|
42
|
+
|
|
43
|
+
Bugs
|
|
44
|
+
----
|
|
45
|
+
|
|
46
|
+
This software is extensively tested and accurately reports genotypes/phenotypes based on our inhouse definitions of the ‘correct’ answer, however, there are some examples where the ‘correct’ answer is subjective. These docs are detailed – if you find what you think is a bug in the results from RBCeq2 please take the time to understand if it inline with what we intended or not. We will endeavor to fix any black and white bugs in less than one week. Most of these will be rare variants that are encoded wrong in our database. Further, we value any and all feedback and feature requests.
|
|
47
|
+
|
|
48
|
+
How To
|
|
49
|
+
------
|
|
50
|
+
|
|
51
|
+
Install via pip (python3.12+) or clone the git repository:
|
|
52
|
+
|
|
53
|
+
.. code-block:: bash
|
|
54
|
+
|
|
55
|
+
pip install RBCeq2
|
|
56
|
+
|
|
57
|
+
Show help:
|
|
58
|
+
|
|
59
|
+
.. code-block:: bash
|
|
60
|
+
|
|
61
|
+
rbceq2 -h
|
|
62
|
+
|
|
63
|
+
Usage:
|
|
64
|
+
|
|
65
|
+
.. code-block:: text
|
|
66
|
+
|
|
67
|
+
usage: py main.py --vcf example_multi_sample.vcf.gz --out example --reference_genome GRCh37
|
|
68
|
+
|
|
69
|
+
options:
|
|
70
|
+
-h, show this help message and exit
|
|
71
|
+
--vcf Path to vcf file/s
|
|
72
|
+
--out Prefix for output files (default: None)
|
|
73
|
+
--allele_depth Allele depth (default: 10)
|
|
74
|
+
--genotype_quality Genotype quality (default: 10)
|
|
75
|
+
--processes Number of processes (default: 1)
|
|
76
|
+
#More is faster, so long as you have that many CPUs and matched RAM (1:1) available
|
|
77
|
+
--reference_genome GRCh37/8 (default: None)
|
|
78
|
+
#If your result are all reference/wildtype then you probably got this wrong
|
|
79
|
+
--phased Use phase information (default: False)
|
|
80
|
+
--microarray Input is from a microarray. (default: False)
|
|
81
|
+
--debug Enable debug logging. If not set, logging will be at info level. (default: False)
|
|
82
|
+
#Turn on to generate output like what is used in the examples in the user documentation
|
|
83
|
+
--validate Enable VCF validation. Doubles run time (default: False)
|
|
84
|
+
#Not normally needed
|
|
85
|
+
--PDFs Make single sample PDF reports
|
|
86
|
+
|
|
87
|
+
Output
|
|
88
|
+
------
|
|
89
|
+
|
|
90
|
+
RBCeq2 generates a ``log.txt``, three programmatically passable TSVs, and a folder with one PDF per sample. The TSVs (one for the genotype and two for phenotype [numeric and alphanumeric separately]) have BGs as column names and sample names (from VCF) as the rows.
|
|
91
|
+
|
|
92
|
+
1000 Genomes Examples
|
|
93
|
+
^^^^^^^^^^^^^^^^^^^^^
|
|
94
|
+
|
|
95
|
+
Genotypes
|
|
96
|
+
"""""""""
|
|
97
|
+
|
|
98
|
+
+---------+--------------------------------------------------+-------------------------+---------------------+
|
|
99
|
+
| | A4GALT | ABCB6 | ABCC1 |
|
|
100
|
+
+=========+==================================================+=========================+=====================+
|
|
101
|
+
| GM18501 | A4GALT*01/A4GALT*02, A4GALT*01/A4GALT*02.02 | ABCB6*01/ABCB6*01W.02 | ABCC1*01/ABCC1*01 |
|
|
102
|
+
+---------+--------------------------------------------------+-------------------------+---------------------+
|
|
103
|
+
| GM18519 | A4GALT*01.02/A4GALT*01.02 | ABCB6*01/ABCB6*01W.02 | ABCC1*01/ABCC1*01 |
|
|
104
|
+
+---------+--------------------------------------------------+-------------------------+---------------------+
|
|
105
|
+
| GM18856 | A4GALT*01/A4GALT*01.02 | ABCB6*01/ABCB6*01 | ABCC1*01/ABCC1*01 |
|
|
106
|
+
+---------+--------------------------------------------------+-------------------------+---------------------+
|
|
107
|
+
|
|
108
|
+
*Note:* In the genotypes TSV, allele pairs are separated by ``/`` and if multiple pairs are possible these are separated by ``,``.
|
|
109
|
+
|
|
110
|
+
Phenotype Alphanumeric
|
|
111
|
+
""""""""""""""""""""""
|
|
112
|
+
|
|
113
|
+
+---------+----------------+-------+-------+
|
|
114
|
+
| | A4GALT | ABCB6 | ABCC1 |
|
|
115
|
+
+=========+================+=======+=======+
|
|
116
|
+
| GM18501 | P1+,Pk+,(P2+) | Lan+ | WLF+ |
|
|
117
|
+
+---------+----------------+-------+-------+
|
|
118
|
+
| GM18519 | P1+,Pk+ | Lan+ | WLF+ |
|
|
119
|
+
+---------+----------------+-------+-------+
|
|
120
|
+
| GM18856 | P1+,Pk+ | Lan+ | WLF+ |
|
|
121
|
+
+---------+----------------+-------+-------+
|
|
122
|
+
|
|
123
|
+
Phenotype Numeric
|
|
124
|
+
"""""""""""""""""
|
|
125
|
+
|
|
126
|
+
+---------+--------+-------+---------+
|
|
127
|
+
| | A4GALT | ABCB6 | ABCC1 |
|
|
128
|
+
+=========+========+=======+=========+
|
|
129
|
+
| GM18501 | | | ABCC1:1 |
|
|
130
|
+
+---------+--------+-------+---------+
|
|
131
|
+
| GM18519 | | | ABCC1:1 |
|
|
132
|
+
+---------+--------+-------+---------+
|
|
133
|
+
| GM18856 | | | ABCC1:1 |
|
|
134
|
+
+---------+--------+-------+---------+
|
|
135
|
+
|
|
136
|
+
In the phenotype TSVs, antigens are separated by ``,`` so if multiple phenotypes are possible they’re separated by `` | `` (e.g., ``DO:1,2 | DO:1,2,5``). Note, not all BGs have both a numeric and alphanumeric phenotype.
|
|
137
|
+
|
|
138
|
+
Further details
|
|
139
|
+
^^^^^^^^^^^^^^^
|
|
140
|
+
|
|
141
|
+
Please see the RBCeq2 user documentation Word doc
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
LICENSE
|
|
2
|
+
README.rst
|
|
3
|
+
pyproject.toml
|
|
4
|
+
src/RBCeq2.egg-info/PKG-INFO
|
|
5
|
+
src/RBCeq2.egg-info/SOURCES.txt
|
|
6
|
+
src/RBCeq2.egg-info/dependency_links.txt
|
|
7
|
+
src/RBCeq2.egg-info/entry_points.txt
|
|
8
|
+
src/RBCeq2.egg-info/requires.txt
|
|
9
|
+
src/RBCeq2.egg-info/top_level.txt
|
|
10
|
+
src/rbceq2/__init__.py
|
|
11
|
+
src/rbceq2/main.py
|
|
12
|
+
src/rbceq2/IO/PDF_reports.py
|
|
13
|
+
src/rbceq2/IO/__init__.py
|
|
14
|
+
src/rbceq2/IO/record_data.py
|
|
15
|
+
src/rbceq2/IO/validation.py
|
|
16
|
+
src/rbceq2/IO/vcf.py
|
|
17
|
+
src/rbceq2/core_logic/__init__.py
|
|
18
|
+
src/rbceq2/core_logic/alleles.py
|
|
19
|
+
src/rbceq2/core_logic/co_existing.py
|
|
20
|
+
src/rbceq2/core_logic/constants.py
|
|
21
|
+
src/rbceq2/core_logic/data_procesing.py
|
|
22
|
+
src/rbceq2/core_logic/utils.py
|
|
23
|
+
src/rbceq2/db/__init__.py
|
|
24
|
+
src/rbceq2/db/db.py
|
|
25
|
+
src/rbceq2/filters/__init__.py
|
|
26
|
+
src/rbceq2/filters/geno.py
|
|
27
|
+
src/rbceq2/phenotype/__init__.py
|
|
28
|
+
src/rbceq2/phenotype/antigens.py
|
|
29
|
+
src/rbceq2/phenotype/choose_pheno.py
|
|
30
|
+
src/rbceq2/resources/db.tsv
|
|
31
|
+
tests/test_IO.py
|
|
32
|
+
tests/test_VCF.py
|
|
33
|
+
tests/test_alleles.py
|
|
34
|
+
tests/test_ants.py
|
|
35
|
+
tests/test_choose_pheno.py
|
|
36
|
+
tests/test_coexisting.py
|
|
37
|
+
tests/test_data_processing.py
|
|
38
|
+
tests/test_db.py
|
|
39
|
+
tests/test_filters.py
|
|
40
|
+
tests/test_main.py
|
|
41
|
+
tests/test_pdf.py
|
|
42
|
+
tests/test_utils.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
rbceq2
|