RBCeq2 2.4.1__tar.gz → 2.4.4__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.
Files changed (90) hide show
  1. rbceq2-2.4.4/CITATION.cff +39 -0
  2. {rbceq2-2.4.1 → rbceq2-2.4.4}/MANIFEST.in +2 -1
  3. rbceq2-2.4.4/PKG-INFO +202 -0
  4. rbceq2-2.4.4/README.md +175 -0
  5. {rbceq2-2.4.1 → rbceq2-2.4.4}/pyproject.toml +5 -5
  6. rbceq2-2.4.4/src/rbceq2/IO/PDF_reports.py +696 -0
  7. rbceq2-2.4.4/src/rbceq2/IO/encoders.py +1240 -0
  8. rbceq2-2.4.4/src/rbceq2/IO/record_data.py +349 -0
  9. rbceq2-2.4.4/src/rbceq2/IO/vcf.py +1668 -0
  10. {rbceq2-2.4.1 → rbceq2-2.4.4}/src/rbceq2/core_logic/alleles.py +167 -20
  11. {rbceq2-2.4.1 → rbceq2-2.4.4}/src/rbceq2/core_logic/co_existing.py +10 -18
  12. {rbceq2-2.4.1 → rbceq2-2.4.4}/src/rbceq2/core_logic/constants.py +142 -7
  13. rbceq2-2.4.4/src/rbceq2/core_logic/data_procesing.py +2779 -0
  14. rbceq2-2.4.4/src/rbceq2/core_logic/filter_semantics.py +158 -0
  15. {rbceq2-2.4.1 → rbceq2-2.4.4}/src/rbceq2/core_logic/large_variants.py +146 -84
  16. {rbceq2-2.4.1 → rbceq2-2.4.4}/src/rbceq2/core_logic/utils.py +71 -39
  17. {rbceq2-2.4.1 → rbceq2-2.4.4}/src/rbceq2/db/db.py +369 -56
  18. {rbceq2-2.4.1 → rbceq2-2.4.4}/src/rbceq2/filters/geno.py +653 -87
  19. {rbceq2-2.4.1 → rbceq2-2.4.4}/src/rbceq2/filters/knops.py +5 -137
  20. {rbceq2-2.4.1 → rbceq2-2.4.4}/src/rbceq2/filters/phased.py +601 -142
  21. rbceq2-2.4.4/src/rbceq2/filters/shared_filter_functionality.py +182 -0
  22. {rbceq2-2.4.1 → rbceq2-2.4.4}/src/rbceq2/main.py +264 -45
  23. {rbceq2-2.4.1 → rbceq2-2.4.4}/src/rbceq2/phenotype/antigens.py +35 -43
  24. {rbceq2-2.4.1 → rbceq2-2.4.4}/src/rbceq2/phenotype/choose_pheno.py +32 -50
  25. rbceq2-2.4.4/src/rbceq2/resources/db.tsv +2051 -0
  26. rbceq2-2.4.4/src/rbceq2/resources/filter_values.tsv +27 -0
  27. rbceq2-2.4.4/src/rbceq2.egg-info/PKG-INFO +202 -0
  28. {rbceq2-2.4.1 → rbceq2-2.4.4}/src/rbceq2.egg-info/SOURCES.txt +21 -1
  29. {rbceq2-2.4.1 → rbceq2-2.4.4}/src/rbceq2.egg-info/requires.txt +1 -1
  30. rbceq2-2.4.4/tests/test_VCF.py +1259 -0
  31. rbceq2-2.4.4/tests/test_allele_coverage.py +249 -0
  32. {rbceq2-2.4.1 → rbceq2-2.4.4}/tests/test_alleles.py +128 -5
  33. {rbceq2-2.4.1 → rbceq2-2.4.4}/tests/test_ants.py +3 -1
  34. {rbceq2-2.4.1 → rbceq2-2.4.4}/tests/test_choose_pheno.py +57 -1
  35. {rbceq2-2.4.1 → rbceq2-2.4.4}/tests/test_coexisting.py +85 -26
  36. {rbceq2-2.4.1 → rbceq2-2.4.4}/tests/test_data_processing.py +1308 -329
  37. {rbceq2-2.4.1 → rbceq2-2.4.4}/tests/test_db.py +97 -0
  38. rbceq2-2.4.4/tests/test_deletion_phase_seed.py +167 -0
  39. rbceq2-2.4.4/tests/test_deletion_placement.py +123 -0
  40. rbceq2-2.4.4/tests/test_duplicate_row_agreement.py +91 -0
  41. rbceq2-2.4.4/tests/test_filter_semantics.py +167 -0
  42. rbceq2-2.4.4/tests/test_filters_phase.py +1836 -0
  43. rbceq2-2.4.4/tests/test_fut3_secretor.py +104 -0
  44. rbceq2-2.4.4/tests/test_fy_null_token.py +82 -0
  45. rbceq2-2.4.4/tests/test_geno_filters.py +1550 -0
  46. {rbceq2-2.4.1 → rbceq2-2.4.4}/tests/test_large_variants.py +5 -5
  47. rbceq2-2.4.4/tests/test_locus_copies.py +763 -0
  48. rbceq2-2.4.4/tests/test_main.py +65 -0
  49. rbceq2-2.4.4/tests/test_multiallelic.py +270 -0
  50. rbceq2-2.4.4/tests/test_pdf.py +260 -0
  51. rbceq2-2.4.4/tests/test_phase_evidence.py +232 -0
  52. rbceq2-2.4.4/tests/test_phase_flip_invariance.py +600 -0
  53. rbceq2-2.4.4/tests/test_phase_set_provenance.py +125 -0
  54. rbceq2-2.4.4/tests/test_ploidy.py +590 -0
  55. rbceq2-2.4.4/tests/test_record_data.py +80 -0
  56. rbceq2-2.4.4/tests/test_sv_build_selection.py +83 -0
  57. rbceq2-2.4.4/tests/test_sv_match_ambiguity.py +158 -0
  58. rbceq2-2.4.4/tests/test_sv_match_ties.py +73 -0
  59. rbceq2-2.4.4/tests/test_sv_provenance.py +170 -0
  60. rbceq2-2.4.1/PKG-INFO +0 -93
  61. rbceq2-2.4.1/README.md +0 -59
  62. rbceq2-2.4.1/src/rbceq2/IO/PDF_reports.py +0 -558
  63. rbceq2-2.4.1/src/rbceq2/IO/encoders.py +0 -237
  64. rbceq2-2.4.1/src/rbceq2/IO/record_data.py +0 -171
  65. rbceq2-2.4.1/src/rbceq2/IO/vcf.py +0 -666
  66. rbceq2-2.4.1/src/rbceq2/core_logic/data_procesing.py +0 -1559
  67. rbceq2-2.4.1/src/rbceq2/filters/shared_filter_functionality.py +0 -108
  68. rbceq2-2.4.1/src/rbceq2/resources/db.tsv +0 -2008
  69. rbceq2-2.4.1/src/rbceq2/resources/db_backup.tsv +0 -2008
  70. rbceq2-2.4.1/src/rbceq2.egg-info/PKG-INFO +0 -93
  71. rbceq2-2.4.1/tests/test_VCF.py +0 -340
  72. rbceq2-2.4.1/tests/test_filters_phase.py +0 -308
  73. rbceq2-2.4.1/tests/test_geno_filters.py +0 -813
  74. rbceq2-2.4.1/tests/test_main.py +0 -5
  75. rbceq2-2.4.1/tests/test_pdf.py +0 -101
  76. {rbceq2-2.4.1 → rbceq2-2.4.4}/LICENSE +0 -0
  77. {rbceq2-2.4.1 → rbceq2-2.4.4}/setup.cfg +0 -0
  78. {rbceq2-2.4.1 → rbceq2-2.4.4}/src/rbceq2/IO/__init__.py +0 -0
  79. {rbceq2-2.4.1 → rbceq2-2.4.4}/src/rbceq2/IO/validation.py +0 -0
  80. {rbceq2-2.4.1 → rbceq2-2.4.4}/src/rbceq2/__init__.py +0 -0
  81. {rbceq2-2.4.1 → rbceq2-2.4.4}/src/rbceq2/core_logic/__init__.py +0 -0
  82. {rbceq2-2.4.1 → rbceq2-2.4.4}/src/rbceq2/db/__init__.py +0 -0
  83. {rbceq2-2.4.1 → rbceq2-2.4.4}/src/rbceq2/filters/__init__.py +0 -0
  84. {rbceq2-2.4.1 → rbceq2-2.4.4}/src/rbceq2/phenotype/__init__.py +0 -0
  85. {rbceq2-2.4.1 → rbceq2-2.4.4}/src/rbceq2.egg-info/dependency_links.txt +0 -0
  86. {rbceq2-2.4.1 → rbceq2-2.4.4}/src/rbceq2.egg-info/entry_points.txt +0 -0
  87. {rbceq2-2.4.1 → rbceq2-2.4.4}/src/rbceq2.egg-info/top_level.txt +0 -0
  88. {rbceq2-2.4.1 → rbceq2-2.4.4}/tests/test_IO.py +0 -0
  89. {rbceq2-2.4.1 → rbceq2-2.4.4}/tests/test_co_filters.py +0 -0
  90. {rbceq2-2.4.1 → rbceq2-2.4.4}/tests/test_utils.py +0 -0
@@ -0,0 +1,39 @@
1
+ cff-version: 1.2.0
2
+ message: "If you use RBCeq2, plz cite this software entry."
3
+ authors:
4
+ - family-names: McIntyre
5
+ given-names: Liam
6
+ orcid: "https://orcid.org/0000-0002-3143-5192"
7
+ affiliation: "Australian Red Cross Lifeblood"
8
+ - family-names: Perros
9
+ given-names: Alexis
10
+ orcid: "https://orcid.org/0000-0001-5596-2934"
11
+ affiliation: "Australian Red Cross Lifeblood"
12
+ - family-names: Sowah
13
+ given-names: Sandra
14
+ orcid: "https://orcid.org/0000-0003-3339-3763"
15
+ affiliation: "Australian Red Cross Lifeblood"
16
+ - family-names: Davison
17
+ given-names: Candice
18
+ orcid: "https://orcid.org/0000-0003-3705-2544"
19
+ affiliation: "Australian Red Cross Lifeblood"
20
+ - family-names: Hyland
21
+ given-names: Catherine
22
+ orcid: "https://orcid.org/0000-0002-4124-6168"
23
+ affiliation: "Australian Red Cross Lifeblood"
24
+ - family-names: Robert
25
+ given-names: Flower
26
+ orcid: "https://orcid.org/0000-0002-7257-1844"
27
+ affiliation: "Australian Red Cross Lifeblood"
28
+ - family-names: Eileen
29
+ given-names: Roulis
30
+ orcid: "https://orcid.org/0000-0001-6824-5432"
31
+ affiliation: "Australian Red Cross Lifeblood"
32
+ title: "RBCeq2"
33
+ version: 2.4.4
34
+ date-released: 2026-09-16
35
+ url: "https://github.com/liammcintyre/RBCeq2"
36
+ repository-code: "https://github.com/liammcintyre/RBCeq2.git"
37
+ license: MIT
38
+ keywords: [bioinformatics, blood-group, genomics]
39
+ type: software
@@ -1,3 +1,4 @@
1
1
  recursive-include src/rbceq2/resources *.tsv
2
2
  include LICENSE
3
- include README.md
3
+ include README.md
4
+ include CITATION.cff
rbceq2-2.4.4/PKG-INFO ADDED
@@ -0,0 +1,202 @@
1
+ Metadata-Version: 2.4
2
+ Name: rbceq2
3
+ Version: 2.4.4
4
+ Summary: Call ISBT alleles from VCF/s
5
+ Author-email: Liam McIntyre <limcintyre@redcrossblood.org.au>
6
+ License-Expression: MIT
7
+ Classifier: Programming Language :: Python :: 3
8
+ Classifier: Programming Language :: Python :: 3.12
9
+ Classifier: Operating System :: OS Independent
10
+ Classifier: Intended Audience :: Science/Research
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
13
+ Requires-Python: >=3.12
14
+ Description-Content-Type: text/markdown
15
+ License-File: LICENSE
16
+ Requires-Dist: pandas>=2.2.2
17
+ Requires-Dist: polars>=0.20.31
18
+ Requires-Dist: icecream>=2.1
19
+ Requires-Dist: loguru>=0.7.2
20
+ Requires-Dist: pyarrow>=18.1
21
+ Requires-Dist: reportlab>=4.3.1
22
+ Requires-Dist: frozendict>=2.4.6
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
+ <table>
29
+ <tr>
30
+ <td>
31
+ <h1>RBCeq2: blood group allele inference</h1>
32
+ </td>
33
+ <td align="right">
34
+ <img src="images/Lifeblood-R_Primary_Keyline_RGB.jpg" alt="Lifeblood Logo" width="150">
35
+ </td>
36
+ </tr>
37
+ </table>
38
+
39
+ > [!WARNING]
40
+ > NOT FOR CLINICAL USE
41
+
42
+ ## Version v2.4.4
43
+
44
+ RBCeq2 infers blood-group genotypes and phenotypes from supplied variant calls using
45
+ the curated ISBT allele definitions distributed with the package. Deterministic
46
+ rules select and exclude candidate alleles and pairs; `--debug` records the evidence
47
+ and named exclusions behind the result.
48
+
49
+ ## Install and run
50
+
51
+ Python 3.12 or newer is required.
52
+
53
+ ```bash
54
+ python -m pip install rbceq2==2.4.4
55
+ rbceq2 --version
56
+ rbceq2 --vcf sample.vcf.gz --out result --reference_genome GRCh38 --debug
57
+ ```
58
+
59
+ Supply `GRCh37` or `GRCh38` to match the input coordinates. A single-sample VCF,
60
+ multi-sample VCF, or directory of separate `.vcf`/`.vcf.gz` files can be supplied.
61
+ Both ordinary gzip and uncompressed VCF input are read. For a directory:
62
+
63
+ ```bash
64
+ rbceq2 --vcf samples/ --out cohort --reference_genome GRCh38 --processes 4 --debug
65
+ ```
66
+
67
+ Use `rbceq2 --help` for all current options. Useful switches include:
68
+
69
+ | Option | Purpose |
70
+ |---|---|
71
+ | `--phased` | Use genotype phasing and phase-set information where available. |
72
+ | `--RH` | Include RHD/RHCE for the supported inputs described below. |
73
+ | `--HPAs` | Include human platelet antigen results. |
74
+ | `--no_filter` | Disable FILTER-based allele exclusion; inference checks still apply. |
75
+ | `--validate` | Run additional VCF format checks. Basic input checks always run. |
76
+ | `--PDFs` | Generate per-sample PDF reports. |
77
+ | `--min_size` | Minimum indel/SV size for fuzzy structural matching; default 10. |
78
+ | `--processes` | Worker processes; default 1. Large input loading also uses memory. |
79
+
80
+ ## Input contract
81
+
82
+ Provide genotyped VCF calls from an upstream caller, with its calling and coverage
83
+ QC completed. **Native gVCFs are not supported in v2.4.4**: unspecified ALT
84
+ placeholders such as `<NON_REF>`/`<*>` and reference blocks require additional
85
+ handling. A gVCF can be read as text and still produce incomplete or misleading
86
+ inference; use the caller's final genotyped VCF.
87
+
88
+ GT must be the first FORMAT key when the row is used for inference. Called indices
89
+ must refer to REF (`0`) or an ALT declared by that row. Missing alleles use `.`.
90
+ Supported GT spellings use `/` or `|` between canonical integer indices; initial
91
+ phasing separators and leading-zero indices are explicitly unsupported.
92
+
93
+ Small-variant multiallelic records are processed into per-ALT calls internally.
94
+ Some reference-containing multiallelic configurations can remain partially
95
+ unresolved. Inspect `Undetermined` results and normalize such sites upstream where
96
+ appropriate. Mixed symbolic structural/small-variant records need caller-specific
97
+ assessment and are not a general supported input route.
98
+
99
+
100
+ ### Chromosome copies and gene copies
101
+
102
+ These are different statements and lead to different output shapes:
103
+
104
+ - A valid called haploid GT outside PAR on X/Y supplies per-sample evidence for one
105
+ chromosome in that region.
106
+ - Gene copy number can be read from GT ploidy only when the upstream caller
107
+ explicitly uses that convention.
108
+
109
+ Called structural deletions are evaluated against the curated database and can
110
+ constrain which chromosome carries an overlapping allele. The deletion's presence
111
+ and the gene-copy interpretation inferred from GT are kept distinct.
112
+
113
+ ### RHD and RHCE
114
+
115
+ Use `--RH` for long-read VCFs with structural-variant information, or for callers
116
+ that explicitly encode RH gene copy number as GT ploidy. Ordinary short-read
117
+ variant calls without either source of information are unsupported for RH
118
+ inference because of the similarity between RHD and RHCE.
119
+
120
+ Compatibility depends on the caller's stated encoding convention. Synthetic
121
+ examples establish the software's behavior; they do not establish compatibility
122
+ with every caller.
123
+
124
+ ### Structural-variant selection
125
+
126
+ Structural variants are fuzzy matched against allele definitions for the selected
127
+ `--reference_genome`.
128
+
129
+ ### FILTER and missing data
130
+
131
+ By default, `PASS` and absent filtering (`.` or empty) do not exclude an allele.
132
+ Other FILTER values are classified: recognized values unrelated to call correctness
133
+ can be retained; call-correctness failures and unrecognized values can exclude.
134
+ Unrecognized values are named in warnings. `--no_filter` bypasses this FILTER-based
135
+ exclusion, while genotype validity and inference rules remain active.
136
+
137
+ A no-call such as `.`, `./.`, or a partial missing GT becomes `NO_DATA` and alleles
138
+ requiring that uncalled variant are excluded by name. All nonmissing indices must
139
+ still be valid for the row.
140
+
141
+ **A reference output does not establish sequencing coverage.** Missing records can
142
+ lead to reference defaults, and a no-call can still reach a reference fallback when
143
+ no candidate remains. Inspect the debug evidence and exclusions; a fallback is not
144
+ a measured homozygous-reference call.
145
+
146
+ ## Outputs and interpretation
147
+
148
+ With `--out result`, the main outputs are:
149
+
150
+ - `result_geno.tsv`
151
+ - `result_pheno_numeric.tsv`
152
+ - `result_pheno_alphanumeric.tsv`
153
+ - `result_<run UUID>_log.txt`
154
+
155
+ The first TSV column identifies the sample; its heading contains the run UUID.
156
+ Cohort input uses the VCF sample names. Single-file and directory input uses the
157
+ filename with its final suffix removed, so `sample.vcf.gz` is named `sample.vcf`.
158
+
159
+ | Slot value | Meaning |
160
+ |---|---|
161
+ | A named allele | The selected database allele. |
162
+ | `-` | No second chromosome slot in the inferred single-copy region. |
163
+ | An absent-gene subtype, e.g. `RHAG*01N` | The database's designation for a missing gene copy without naming a specific breakpoint-defined allele. |
164
+ | `Novel_gene_deletion` | A missing gene copy for which no applicable database absence subtype is available. GT-based use depends on the caller convention above. |
165
+ | `Undetermined` | An allele slot that could not be named. Both slots can be undetermined when the blood group cannot be interpreted. |
166
+
167
+ `allele/Undetermined` retains one resolved slot. `Undetermined/Undetermined` can
168
+ represent a whole-group refusal; it does not establish the physical copy count.
169
+ Neither is a database allele.
170
+
171
+ Genotype alternatives are comma-separated. Phenotype alternatives are listed
172
+ independently and can be deduplicated, so entries must not be joined by position
173
+ between files. A slash can be part of a phenotype name.
174
+
175
+ Malformed retained GTs fail the affected sample and are reported with a named error;
176
+ the other samples in a cohort or directory can continue. Shared header/FORMAT
177
+ problems can prevent loading an input file. A nonzero process exit and the log must
178
+ be reviewed even when some result files were written.
179
+
180
+ ### PDF reports
181
+
182
+ `--PDFs` writes reports to `<output prefix>_PDFs/`. Each report preserves the exact
183
+ sample identity used in the TSVs, including suffixes and letter case.
184
+
185
+ ## Database v2.5.1
186
+
187
+ The packaged [db.tsv](src/rbceq2/resources/db.tsv) is the source of allele definitions
188
+ used by inference. It is curated against ISBT definitions and includes explicit
189
+ modelling and nomenclature choices. Package and database versions are reported
190
+ separately by `--version`.
191
+
192
+ ## Documentation and reporting issues
193
+
194
+ This README describes the v2.4.4 input and output contract. Longer PDF worked
195
+ examples attached to earlier releases are historical and may describe earlier
196
+ behavior; use the version-matched contract here when interpreting current output.
197
+
198
+ When reporting an issue, include the package/database versions, genome build,
199
+ command, and the complete affected sample/blood-group debug block where shareable.
200
+ State the caller and its genotype/copy-number convention. Expected answers can
201
+ require biological adjudication; a successful run or agreement with stored gold
202
+ does not establish clinical validity.
rbceq2-2.4.4/README.md ADDED
@@ -0,0 +1,175 @@
1
+ <table>
2
+ <tr>
3
+ <td>
4
+ <h1>RBCeq2: blood group allele inference</h1>
5
+ </td>
6
+ <td align="right">
7
+ <img src="images/Lifeblood-R_Primary_Keyline_RGB.jpg" alt="Lifeblood Logo" width="150">
8
+ </td>
9
+ </tr>
10
+ </table>
11
+
12
+ > [!WARNING]
13
+ > NOT FOR CLINICAL USE
14
+
15
+ ## Version v2.4.4
16
+
17
+ RBCeq2 infers blood-group genotypes and phenotypes from supplied variant calls using
18
+ the curated ISBT allele definitions distributed with the package. Deterministic
19
+ rules select and exclude candidate alleles and pairs; `--debug` records the evidence
20
+ and named exclusions behind the result.
21
+
22
+ ## Install and run
23
+
24
+ Python 3.12 or newer is required.
25
+
26
+ ```bash
27
+ python -m pip install rbceq2==2.4.4
28
+ rbceq2 --version
29
+ rbceq2 --vcf sample.vcf.gz --out result --reference_genome GRCh38 --debug
30
+ ```
31
+
32
+ Supply `GRCh37` or `GRCh38` to match the input coordinates. A single-sample VCF,
33
+ multi-sample VCF, or directory of separate `.vcf`/`.vcf.gz` files can be supplied.
34
+ Both ordinary gzip and uncompressed VCF input are read. For a directory:
35
+
36
+ ```bash
37
+ rbceq2 --vcf samples/ --out cohort --reference_genome GRCh38 --processes 4 --debug
38
+ ```
39
+
40
+ Use `rbceq2 --help` for all current options. Useful switches include:
41
+
42
+ | Option | Purpose |
43
+ |---|---|
44
+ | `--phased` | Use genotype phasing and phase-set information where available. |
45
+ | `--RH` | Include RHD/RHCE for the supported inputs described below. |
46
+ | `--HPAs` | Include human platelet antigen results. |
47
+ | `--no_filter` | Disable FILTER-based allele exclusion; inference checks still apply. |
48
+ | `--validate` | Run additional VCF format checks. Basic input checks always run. |
49
+ | `--PDFs` | Generate per-sample PDF reports. |
50
+ | `--min_size` | Minimum indel/SV size for fuzzy structural matching; default 10. |
51
+ | `--processes` | Worker processes; default 1. Large input loading also uses memory. |
52
+
53
+ ## Input contract
54
+
55
+ Provide genotyped VCF calls from an upstream caller, with its calling and coverage
56
+ QC completed. **Native gVCFs are not supported in v2.4.4**: unspecified ALT
57
+ placeholders such as `<NON_REF>`/`<*>` and reference blocks require additional
58
+ handling. A gVCF can be read as text and still produce incomplete or misleading
59
+ inference; use the caller's final genotyped VCF.
60
+
61
+ GT must be the first FORMAT key when the row is used for inference. Called indices
62
+ must refer to REF (`0`) or an ALT declared by that row. Missing alleles use `.`.
63
+ Supported GT spellings use `/` or `|` between canonical integer indices; initial
64
+ phasing separators and leading-zero indices are explicitly unsupported.
65
+
66
+ Small-variant multiallelic records are processed into per-ALT calls internally.
67
+ Some reference-containing multiallelic configurations can remain partially
68
+ unresolved. Inspect `Undetermined` results and normalize such sites upstream where
69
+ appropriate. Mixed symbolic structural/small-variant records need caller-specific
70
+ assessment and are not a general supported input route.
71
+
72
+
73
+ ### Chromosome copies and gene copies
74
+
75
+ These are different statements and lead to different output shapes:
76
+
77
+ - A valid called haploid GT outside PAR on X/Y supplies per-sample evidence for one
78
+ chromosome in that region.
79
+ - Gene copy number can be read from GT ploidy only when the upstream caller
80
+ explicitly uses that convention.
81
+
82
+ Called structural deletions are evaluated against the curated database and can
83
+ constrain which chromosome carries an overlapping allele. The deletion's presence
84
+ and the gene-copy interpretation inferred from GT are kept distinct.
85
+
86
+ ### RHD and RHCE
87
+
88
+ Use `--RH` for long-read VCFs with structural-variant information, or for callers
89
+ that explicitly encode RH gene copy number as GT ploidy. Ordinary short-read
90
+ variant calls without either source of information are unsupported for RH
91
+ inference because of the similarity between RHD and RHCE.
92
+
93
+ Compatibility depends on the caller's stated encoding convention. Synthetic
94
+ examples establish the software's behavior; they do not establish compatibility
95
+ with every caller.
96
+
97
+ ### Structural-variant selection
98
+
99
+ Structural variants are fuzzy matched against allele definitions for the selected
100
+ `--reference_genome`.
101
+
102
+ ### FILTER and missing data
103
+
104
+ By default, `PASS` and absent filtering (`.` or empty) do not exclude an allele.
105
+ Other FILTER values are classified: recognized values unrelated to call correctness
106
+ can be retained; call-correctness failures and unrecognized values can exclude.
107
+ Unrecognized values are named in warnings. `--no_filter` bypasses this FILTER-based
108
+ exclusion, while genotype validity and inference rules remain active.
109
+
110
+ A no-call such as `.`, `./.`, or a partial missing GT becomes `NO_DATA` and alleles
111
+ requiring that uncalled variant are excluded by name. All nonmissing indices must
112
+ still be valid for the row.
113
+
114
+ **A reference output does not establish sequencing coverage.** Missing records can
115
+ lead to reference defaults, and a no-call can still reach a reference fallback when
116
+ no candidate remains. Inspect the debug evidence and exclusions; a fallback is not
117
+ a measured homozygous-reference call.
118
+
119
+ ## Outputs and interpretation
120
+
121
+ With `--out result`, the main outputs are:
122
+
123
+ - `result_geno.tsv`
124
+ - `result_pheno_numeric.tsv`
125
+ - `result_pheno_alphanumeric.tsv`
126
+ - `result_<run UUID>_log.txt`
127
+
128
+ The first TSV column identifies the sample; its heading contains the run UUID.
129
+ Cohort input uses the VCF sample names. Single-file and directory input uses the
130
+ filename with its final suffix removed, so `sample.vcf.gz` is named `sample.vcf`.
131
+
132
+ | Slot value | Meaning |
133
+ |---|---|
134
+ | A named allele | The selected database allele. |
135
+ | `-` | No second chromosome slot in the inferred single-copy region. |
136
+ | An absent-gene subtype, e.g. `RHAG*01N` | The database's designation for a missing gene copy without naming a specific breakpoint-defined allele. |
137
+ | `Novel_gene_deletion` | A missing gene copy for which no applicable database absence subtype is available. GT-based use depends on the caller convention above. |
138
+ | `Undetermined` | An allele slot that could not be named. Both slots can be undetermined when the blood group cannot be interpreted. |
139
+
140
+ `allele/Undetermined` retains one resolved slot. `Undetermined/Undetermined` can
141
+ represent a whole-group refusal; it does not establish the physical copy count.
142
+ Neither is a database allele.
143
+
144
+ Genotype alternatives are comma-separated. Phenotype alternatives are listed
145
+ independently and can be deduplicated, so entries must not be joined by position
146
+ between files. A slash can be part of a phenotype name.
147
+
148
+ Malformed retained GTs fail the affected sample and are reported with a named error;
149
+ the other samples in a cohort or directory can continue. Shared header/FORMAT
150
+ problems can prevent loading an input file. A nonzero process exit and the log must
151
+ be reviewed even when some result files were written.
152
+
153
+ ### PDF reports
154
+
155
+ `--PDFs` writes reports to `<output prefix>_PDFs/`. Each report preserves the exact
156
+ sample identity used in the TSVs, including suffixes and letter case.
157
+
158
+ ## Database v2.5.1
159
+
160
+ The packaged [db.tsv](src/rbceq2/resources/db.tsv) is the source of allele definitions
161
+ used by inference. It is curated against ISBT definitions and includes explicit
162
+ modelling and nomenclature choices. Package and database versions are reported
163
+ separately by `--version`.
164
+
165
+ ## Documentation and reporting issues
166
+
167
+ This README describes the v2.4.4 input and output contract. Longer PDF worked
168
+ examples attached to earlier releases are historical and may describe earlier
169
+ behavior; use the version-matched contract here when interpreting current output.
170
+
171
+ When reporting an issue, include the package/database versions, genome build,
172
+ command, and the complete affected sample/blood-group debug block where shareable.
173
+ State the caller and its genotype/copy-number convention. Expected answers can
174
+ require biological adjudication; a successful run or agreement with stored gold
175
+ does not establish clinical validity.
@@ -1,15 +1,16 @@
1
1
  # pyproject.toml
2
2
 
3
3
  [build-system]
4
- requires = ["setuptools>=61.0"] # Minimum version of setuptools needed
4
+ requires = ["setuptools>=77.0.3"]
5
5
  build-backend = "setuptools.build_meta"
6
6
 
7
7
  [project]
8
8
  name = "rbceq2"
9
- version = "2.4.1"
9
+ version = "2.4.4"
10
10
  description = "Call ISBT alleles from VCF/s"
11
11
  readme = "README.md"
12
- license = { file = "LICENSE" }
12
+ license = "MIT"
13
+ license-files = ["LICENSE"]
13
14
  requires-python = ">=3.12"
14
15
  authors = [
15
16
  { name = "Liam McIntyre", email = "limcintyre@redcrossblood.org.au" }
@@ -17,7 +18,6 @@ authors = [
17
18
  classifiers = [
18
19
  "Programming Language :: Python :: 3",
19
20
  "Programming Language :: Python :: 3.12",
20
- "License :: OSI Approved :: MIT License",
21
21
  "Operating System :: OS Independent",
22
22
  "Intended Audience :: Science/Research",
23
23
  "Intended Audience :: Developers",
@@ -25,7 +25,7 @@ classifiers = [
25
25
  ]
26
26
  dependencies = [
27
27
  "pandas>=2.2.2",
28
- "polars>=0.20.26",
28
+ "polars>=0.20.31",
29
29
  "icecream>=2.1",
30
30
  "loguru>=0.7.2",
31
31
  "pyarrow>=18.1",