oncoref 1.6.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.
Files changed (143) hide show
  1. oncoref-1.6.0/LICENSE +201 -0
  2. oncoref-1.6.0/MANIFEST.in +10 -0
  3. oncoref-1.6.0/PKG-INFO +169 -0
  4. oncoref-1.6.0/README.md +133 -0
  5. oncoref-1.6.0/oncoref/__init__.py +390 -0
  6. oncoref-1.6.0/oncoref/apd1.py +59 -0
  7. oncoref-1.6.0/oncoref/cancer_genes.py +149 -0
  8. oncoref-1.6.0/oncoref/cancer_types.py +827 -0
  9. oncoref-1.6.0/oncoref/catalog.py +261 -0
  10. oncoref-1.6.0/oncoref/cli.py +633 -0
  11. oncoref-1.6.0/oncoref/coverage.py +282 -0
  12. oncoref-1.6.0/oncoref/cta.py +297 -0
  13. oncoref-1.6.0/oncoref/cta_regen.py +560 -0
  14. oncoref-1.6.0/oncoref/cta_tissues.py +152 -0
  15. oncoref-1.6.0/oncoref/data/cancer-apd1-response.csv +82 -0
  16. oncoref-1.6.0/oncoref/data/cancer-code-burden-map.csv +5 -0
  17. oncoref-1.6.0/oncoref/data/cancer-cohort-aggregates.csv +18 -0
  18. oncoref-1.6.0/oncoref/data/cancer-driver-genes.csv +740 -0
  19. oncoref-1.6.0/oncoref/data/cancer-driver-variants.csv +580 -0
  20. oncoref-1.6.0/oncoref/data/cancer-expression-source-candidates.csv +59 -0
  21. oncoref-1.6.0/oncoref/data/cancer-frameshift-burden.csv +37 -0
  22. oncoref-1.6.0/oncoref/data/cancer-fusions.csv +172 -0
  23. oncoref-1.6.0/oncoref/data/cancer-ici-response.csv +105 -0
  24. oncoref-1.6.0/oncoref/data/cancer-incidence-mortality.csv +38 -0
  25. oncoref-1.6.0/oncoref/data/cancer-key-genes.csv +852 -0
  26. oncoref-1.6.0/oncoref/data/cancer-lineage-group-overrides.csv +2 -0
  27. oncoref-1.6.0/oncoref/data/cancer-lineage-groups.csv +28 -0
  28. oncoref-1.6.0/oncoref/data/cancer-reference-expression-samples.csv.gz +0 -0
  29. oncoref-1.6.0/oncoref/data/cancer-response-signatures.csv +25 -0
  30. oncoref-1.6.0/oncoref/data/cancer-subtype-groupings.csv +13 -0
  31. oncoref-1.6.0/oncoref/data/cancer-testis-antigens.csv +398 -0
  32. oncoref-1.6.0/oncoref/data/cancer-tmb.csv +123 -0
  33. oncoref-1.6.0/oncoref/data/cancer-type-genes.csv +578 -0
  34. oncoref-1.6.0/oncoref/data/cancer-type-registry.csv +165 -0
  35. oncoref-1.6.0/oncoref/data/cancer-viral-antigens.csv +7 -0
  36. oncoref-1.6.0/oncoref/data/cdna-identical-gene-groups.csv +327 -0
  37. oncoref-1.6.0/oncoref/data/censored-gene-reference-tpm.csv +1729 -0
  38. oncoref-1.6.0/oncoref/data/clean-tpm-censored-genes.csv +2787 -0
  39. oncoref-1.6.0/oncoref/data/cohort-registry.csv +42 -0
  40. oncoref-1.6.0/oncoref/data/cta-candidate-references.csv +13 -0
  41. oncoref-1.6.0/oncoref/data/cta-ihc-unreliable.csv +7 -0
  42. oncoref-1.6.0/oncoref/data/degenerate-subtype-pairs.csv +8 -0
  43. oncoref-1.6.0/oncoref/data/disease-state-rules.csv +9 -0
  44. oncoref-1.6.0/oncoref/data/ensembl-id-aliases.csv +468 -0
  45. oncoref-1.6.0/oncoref/data/expression_sources.yaml +964 -0
  46. oncoref-1.6.0/oncoref/data/extra-tx-mappings.csv +213 -0
  47. oncoref-1.6.0/oncoref/data/family-burden-map.csv +10 -0
  48. oncoref-1.6.0/oncoref/data/fusion-expression-effects.csv +7 -0
  49. oncoref-1.6.0/oncoref/data/fusion-surrogate-expression.csv +52 -0
  50. oncoref-1.6.0/oncoref/data/hemoglobin-genes.csv +13 -0
  51. oncoref-1.6.0/oncoref/data/histone-genes.csv +193 -0
  52. oncoref-1.6.0/oncoref/data/housekeeping-genes.csv +31 -0
  53. oncoref-1.6.0/oncoref/data/mitochondrial-genes.csv +38 -0
  54. oncoref-1.6.0/oncoref/data/narrative-gene-sets.csv +4 -0
  55. oncoref-1.6.0/oncoref/data/ncbi-symbol-synonyms.csv.gz +0 -0
  56. oncoref-1.6.0/oncoref/data/nuclear-retained-lncrnas.csv +5 -0
  57. oncoref-1.6.0/oncoref/data/numt-pseudogenes.csv +413 -0
  58. oncoref-1.6.0/oncoref/data/proteoform-collapse-overrides.csv +2 -0
  59. oncoref-1.6.0/oncoref/data/proteoform-groups-genome.csv +411 -0
  60. oncoref-1.6.0/oncoref/data/proteoform-groups.csv +48 -0
  61. oncoref-1.6.0/oncoref/data/rare-cancer-fusion-rules.csv +27 -0
  62. oncoref-1.6.0/oncoref/data/ribosomal-protein-genes.csv +123 -0
  63. oncoref-1.6.0/oncoref/data/ribosomal-protein-pseudogenes.csv +1641 -0
  64. oncoref-1.6.0/oncoref/data/rrna-and-pseudogenes.csv +558 -0
  65. oncoref-1.6.0/oncoref/data/small-noncoding-rnas.csv +6396 -0
  66. oncoref-1.6.0/oncoref/data/source-matrices.csv +119 -0
  67. oncoref-1.6.0/oncoref/data/tissue-burden-map.csv +71 -0
  68. oncoref-1.6.0/oncoref/data_bundle.py +378 -0
  69. oncoref-1.6.0/oncoref/data_manifest.py +283 -0
  70. oncoref-1.6.0/oncoref/expression.py +1062 -0
  71. oncoref-1.6.0/oncoref/expression_builders.py +334 -0
  72. oncoref-1.6.0/oncoref/expression_engine.py +168 -0
  73. oncoref-1.6.0/oncoref/expression_registry.py +162 -0
  74. oncoref-1.6.0/oncoref/fusions.py +186 -0
  75. oncoref-1.6.0/oncoref/gene_families.py +126 -0
  76. oncoref-1.6.0/oncoref/gene_ids.py +88 -0
  77. oncoref-1.6.0/oncoref/gene_qc.py +233 -0
  78. oncoref-1.6.0/oncoref/genome.py +298 -0
  79. oncoref-1.6.0/oncoref/hpa.py +101 -0
  80. oncoref-1.6.0/oncoref/ici.py +169 -0
  81. oncoref-1.6.0/oncoref/incidence.py +156 -0
  82. oncoref-1.6.0/oncoref/load_dataset.py +233 -0
  83. oncoref-1.6.0/oncoref/normalization.py +607 -0
  84. oncoref-1.6.0/oncoref/peptides.py +237 -0
  85. oncoref-1.6.0/oncoref/plots.py +1083 -0
  86. oncoref-1.6.0/oncoref/proteoforms.py +302 -0
  87. oncoref-1.6.0/oncoref/reference_data.py +287 -0
  88. oncoref-1.6.0/oncoref/response_signatures.py +92 -0
  89. oncoref-1.6.0/oncoref/samples.py +70 -0
  90. oncoref-1.6.0/oncoref/source_matrices.py +145 -0
  91. oncoref-1.6.0/oncoref/tmb.py +101 -0
  92. oncoref-1.6.0/oncoref/version.py +31 -0
  93. oncoref-1.6.0/oncoref.egg-info/PKG-INFO +169 -0
  94. oncoref-1.6.0/oncoref.egg-info/SOURCES.txt +141 -0
  95. oncoref-1.6.0/oncoref.egg-info/dependency_links.txt +1 -0
  96. oncoref-1.6.0/oncoref.egg-info/entry_points.txt +2 -0
  97. oncoref-1.6.0/oncoref.egg-info/requires.txt +14 -0
  98. oncoref-1.6.0/oncoref.egg-info/top_level.txt +1 -0
  99. oncoref-1.6.0/pyproject.toml +140 -0
  100. oncoref-1.6.0/setup.cfg +4 -0
  101. oncoref-1.6.0/tests/test_apd1.py +34 -0
  102. oncoref-1.6.0/tests/test_base_layer.py +45 -0
  103. oncoref-1.6.0/tests/test_build_generators.py +248 -0
  104. oncoref-1.6.0/tests/test_cancer_genes.py +50 -0
  105. oncoref-1.6.0/tests/test_cancer_type_registry.py +69 -0
  106. oncoref-1.6.0/tests/test_cancer_types.py +131 -0
  107. oncoref-1.6.0/tests/test_catalog.py +224 -0
  108. oncoref-1.6.0/tests/test_cli.py +111 -0
  109. oncoref-1.6.0/tests/test_coverage.py +144 -0
  110. oncoref-1.6.0/tests/test_cta.py +145 -0
  111. oncoref-1.6.0/tests/test_cta_regen.py +65 -0
  112. oncoref-1.6.0/tests/test_cta_table_integrity.py +104 -0
  113. oncoref-1.6.0/tests/test_data_bundle.py +160 -0
  114. oncoref-1.6.0/tests/test_data_manifest.py +89 -0
  115. oncoref-1.6.0/tests/test_data_parity.py +42 -0
  116. oncoref-1.6.0/tests/test_expression.py +687 -0
  117. oncoref-1.6.0/tests/test_expression_engine.py +60 -0
  118. oncoref-1.6.0/tests/test_expression_sources.py +56 -0
  119. oncoref-1.6.0/tests/test_exprmeta.py +32 -0
  120. oncoref-1.6.0/tests/test_fusions.py +84 -0
  121. oncoref-1.6.0/tests/test_gene_families.py +46 -0
  122. oncoref-1.6.0/tests/test_gene_ids.py +42 -0
  123. oncoref-1.6.0/tests/test_gene_qc.py +69 -0
  124. oncoref-1.6.0/tests/test_genome.py +48 -0
  125. oncoref-1.6.0/tests/test_genome_pick.py +64 -0
  126. oncoref-1.6.0/tests/test_hpa.py +116 -0
  127. oncoref-1.6.0/tests/test_ici.py +60 -0
  128. oncoref-1.6.0/tests/test_incidence.py +97 -0
  129. oncoref-1.6.0/tests/test_normalization.py +342 -0
  130. oncoref-1.6.0/tests/test_ontology_hierarchy_curation.py +66 -0
  131. oncoref-1.6.0/tests/test_peptides.py +157 -0
  132. oncoref-1.6.0/tests/test_plots.py +449 -0
  133. oncoref-1.6.0/tests/test_proteoform_genome.py +70 -0
  134. oncoref-1.6.0/tests/test_proteoforms.py +301 -0
  135. oncoref-1.6.0/tests/test_reference_data.py +147 -0
  136. oncoref-1.6.0/tests/test_response_signatures.py +48 -0
  137. oncoref-1.6.0/tests/test_samples.py +35 -0
  138. oncoref-1.6.0/tests/test_source_matrices.py +115 -0
  139. oncoref-1.6.0/tests/test_subtype_groupings.py +46 -0
  140. oncoref-1.6.0/tests/test_tmb.py +42 -0
  141. oncoref-1.6.0/tests/test_tree_navigation.py +82 -0
  142. oncoref-1.6.0/tests/test_within_sample.py +92 -0
  143. oncoref-1.6.0/tests/test_within_sample_proteoform.py +165 -0
oncoref-1.6.0/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,10 @@
1
+ # sdist content control. Mirror the wheel exclusions in pyproject.toml's
2
+ # [tool.setuptools.exclude-package-data] — without this the sdist auto-includes
3
+ # every git-tracked file and the heavy per-cohort expression data (added in a
4
+ # later milestone) would balloon the .tar.gz past PyPI's 100 MiB limit.
5
+ recursive-exclude oncoref/data/cancer-reference-expression *
6
+ recursive-exclude oncoref/data/cancer-reference-expression-percentiles *
7
+ recursive-exclude oncoref/data/cancer-reference-expression-representatives *
8
+ recursive-exclude oncoref/data/cancer-reference-expression-within-sample-top5 *
9
+ exclude oncoref/data/pan-cancer-expression.csv
10
+ exclude oncoref/data/hpa-cell-type-expression.csv
oncoref-1.6.0/PKG-INFO ADDED
@@ -0,0 +1,169 @@
1
+ Metadata-Version: 2.4
2
+ Name: oncoref
3
+ Version: 1.6.0
4
+ Summary: Curated cancer reference data: ontology, TMB, incidence/mortality, and expression
5
+ Author-email: Alex Rubinsteyn <alex.rubinsteyn@unc.edu>
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Homepage, https://github.com/pirl-unc/oncoref
8
+ Project-URL: Repository, https://github.com/pirl-unc/oncoref
9
+ Classifier: Development Status :: 4 - Beta
10
+ Classifier: Environment :: Console
11
+ Classifier: Operating System :: OS Independent
12
+ Classifier: Intended Audience :: Science/Research
13
+ Classifier: Programming Language :: Python
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.9
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
20
+ Requires-Python: >=3.9
21
+ Description-Content-Type: text/markdown
22
+ License-File: LICENSE
23
+ Requires-Dist: pandas
24
+ Requires-Dist: numpy
25
+ Requires-Dist: pyarrow
26
+ Requires-Dist: PyYAML
27
+ Requires-Dist: pyensembl
28
+ Provides-Extra: plots
29
+ Requires-Dist: matplotlib; extra == "plots"
30
+ Provides-Extra: dev
31
+ Requires-Dist: pytest; extra == "dev"
32
+ Requires-Dist: pytest-cov; extra == "dev"
33
+ Requires-Dist: ruff; extra == "dev"
34
+ Requires-Dist: matplotlib; extra == "dev"
35
+ Dynamic: license-file
36
+
37
+ # oncoref
38
+
39
+ [![Tests](https://github.com/pirl-unc/oncoref/actions/workflows/tests.yml/badge.svg)](https://github.com/pirl-unc/oncoref/actions/workflows/tests.yml)
40
+ [![PyPI](https://img.shields.io/pypi/v/oncoref.svg)](https://pypi.org/project/oncoref/)
41
+
42
+ Curated cancer reference data — cancer-type ontology, tumor mutational burden
43
+ (TMB), incidence/mortality, checkpoint-inhibitor (ICI) response, per-cohort RNA-seq expression,
44
+ and cancer-testis antigens — behind one small Python API, a data fetch/cache
45
+ CLI, and a set of reference plots.
46
+
47
+ ## oncoref is the base layer
48
+
49
+ `oncoref` is **designed as the base layer** of the openvax/PIRL stack — the
50
+ intended single upstream **source of truth** for cancer reference data, meant to
51
+ become a shared dependency of
52
+ [pirlygenes](https://github.com/pirl-unc/pirlygenes),
53
+ [trufflepig](https://github.com/pirl-unc/trufflepig), and
54
+ [tsarina](https://github.com/pirl-unc/tsarina). Adoption is still in progress —
55
+ most of these don't depend on it yet. Architecturally it stays at the bottom: it
56
+ depends only on pandas / numpy / pyarrow / PyYAML, it **never imports its
57
+ consumers** (data and logic flow only downward), and it **owns** these
58
+ definitions rather than mirroring them from elsewhere.
59
+
60
+ Anything that needs to know about
61
+
62
+ - **gene expression of cancer samples** — per-cohort RNA-seq in a normalized,
63
+ comparable space: summary stats, tail-weighted percentiles, and medoid/exemplar
64
+ samples per cancer type/subtype;
65
+ - **HPA protein / RNA** normal-tissue expression;
66
+ - the **definition of cancer-testis antigens** — the HPA tissue-restriction call
67
+ over the candidate list (HPA-only; no MS/peptide layer);
68
+ - the **ontology of cancer types** — codes, the parent/child hierarchy, subtypes,
69
+ families, characteristic driver fusions, and the cross-cutting MSI/POLE/HPV
70
+ groupings; and
71
+ - **checkpoint-inhibitor response rates** and **TMB** per cancer type
72
+
73
+ depends on `oncoref` — including `pirlygenes` (gene-set curation/analysis),
74
+ `tsarina` (personalized target selection), `hitlist` (panel selection),
75
+ `trufflepig` (sample classification), and anything else downstream.
76
+
77
+ Everything keys on the cancer-type registry. The small curated tables ship in the
78
+ wheel; the heavy per-cohort expression bundle downloads on first use from
79
+ oncoref's own GitHub Release.
80
+
81
+ ## Install
82
+
83
+ ```bash
84
+ pip install oncoref
85
+ ```
86
+
87
+ ## Python API
88
+
89
+ ```python
90
+ import oncoref as od
91
+
92
+ od.resolve_cancer_type("prostate") # -> "PRAD"
93
+ od.cancer_type_info("SARC_RMS_ARMS") # full registry record + burden + tmb
94
+ od.cancer_tmb("LUAD_EGFR") # 6.9 (inherited from LUAD)
95
+ od.cancer_burden("pancreas", metric="us_mortality_pct")
96
+ od.burden_category("SARC_OS") # -> "bone_and_joint" (incidence/mortality bucket)
97
+ od.cancer_ici_response("SKCM") # 42 (anti-PD-1 ORR %; fallback aPD-1 → aPD-L1 → combo)
98
+ od.cancer_ici_response("SKCM", regimen="PD-1+CTLA-4") # 57.6 (pin a regimen)
99
+
100
+ # Cancer-testis antigens (HPA-derived tissue-restriction):
101
+ od.cta_gene_names() # expressed CTA symbols (MAGEA4, CT83, …)
102
+ od.cta_evidence() # full HPA restriction table
103
+
104
+ # Per-cohort expression percentiles (downloads the data bundle on first use):
105
+ od.cohort_gene_percentiles("PRAD") # per-gene p0…p100 vector (within-cohort)
106
+ od.within_sample_top_fraction("PRAD") # per-gene frac of samples top-5% (within-sample)
107
+ ```
108
+
109
+ ### Domains
110
+
111
+ - **Ontology** — `cancer_type_registry`, `resolve_cancer_type`,
112
+ `cancer_type_info`, `cancer_types_in_family`, `viral_status`, `fusion_status`,
113
+ the cohort vocabulary (`cohort_registry`, `cohort_aggregates`).
114
+ - **TMB** — `cancer_tmb`, `cancer_tmb_df` (parent-chain inheritance).
115
+ - **Incidence / mortality** — `cancer_burden`, `burden_category` (ACS / GLOBOCAN).
116
+ - **Checkpoint response** — `cancer_ici_response` (ORR per type/regimen: anti-PD-1,
117
+ anti-PD-L1, anti-PD-1+anti-CTLA-4), with `cancer_apd1_response` the PD-1 shortcut.
118
+ - **Expression** — `cohort_gene_percentiles`, `within_sample_top_fraction`,
119
+ `representative_cohort_samples` over the lazy-downloaded per-cohort bundle.
120
+ - **Cancer-testis antigens** — `cta_gene_names`/`cta_gene_ids`, `cta_evidence`,
121
+ `synthesize_restriction` (HPA-only tissue-restriction; MS evidence stays in the
122
+ target-selection layer).
123
+ - **HPA normal tissue** — `hpa_rna_consensus`, `hpa_normal_tissue` (IHC),
124
+ `hpa_single_cell`, and per-gene lookups (`gene_tissue_ntpm`,
125
+ `gene_protein_tissues`, `gene_cell_type_ntpm`) over HPA v23, fetched on demand
126
+ (`oncoref hpa fetch`).
127
+ - **Genome reference** — `canonical_gene_id_and_name`, `find_gene_id_by_name`,
128
+ `find_gene_name_from_ensembl_{gene,transcript}_id`, `aggregate_gene_expression`
129
+ (pyensembl-backed symbol ↔ Ensembl-ID resolution). pyensembl ships with the
130
+ package, but resolution needs a downloaded human release once:
131
+ `pyensembl install --release 111 --species homo_sapiens` (the accessors return
132
+ `None` until then).
133
+ - **Peptides** — `cta_specific_9mer_counts`, `cta_specific_9mer_load` (per-cohort
134
+ mean per-patient CTA-specific 9-mer load): 9-mers found in a CTA protein but in no
135
+ non-CTA protein, enumerated from the reference proteome and cached per release.
136
+ - **Plots** (`pip install oncoref[plots]`) — `oncoref.plots.apd1_vs_tmb`,
137
+ `apd1_orr_bars`, `incidence_vs_mortality`, and the CTA/coverage figures.
138
+
139
+ ## CLI
140
+
141
+ ```bash
142
+ oncoref cancer-type prostate # registry info as JSON
143
+ oncoref tmb LUAD_EGFR # 6.9
144
+ oncoref ici SKCM # 42 (--regimen to pin, --all-regimens to compare)
145
+ oncoref burden pancreas --metric us_mortality_pct
146
+ oncoref cta --count # number of expressed CTAs
147
+ oncoref plot apd1-vs-tmb --out apd1_vs_tmb.png
148
+
149
+ # expression-bundle cache (per-cohort expression):
150
+ oncoref cache fetch # download the ~340 MB bundle
151
+ oncoref cache status # which bundle paths are cached (no download)
152
+ oncoref cache dir # where the data bundle is cached
153
+ oncoref cache prune --yes # delete stale version caches
154
+ oncoref hpa fetch # download HPA reference data (RNA / IHC / single-cell)
155
+ oncoref version
156
+ ```
157
+
158
+ ## Development
159
+
160
+ ```bash
161
+ ./develop.sh # editable install with dev extras
162
+ ./format.sh # ruff format
163
+ ./lint.sh # ruff check + format --check
164
+ ./test.sh # lint + pytest with coverage
165
+ ```
166
+
167
+ ## License
168
+
169
+ Apache 2.0.
@@ -0,0 +1,133 @@
1
+ # oncoref
2
+
3
+ [![Tests](https://github.com/pirl-unc/oncoref/actions/workflows/tests.yml/badge.svg)](https://github.com/pirl-unc/oncoref/actions/workflows/tests.yml)
4
+ [![PyPI](https://img.shields.io/pypi/v/oncoref.svg)](https://pypi.org/project/oncoref/)
5
+
6
+ Curated cancer reference data — cancer-type ontology, tumor mutational burden
7
+ (TMB), incidence/mortality, checkpoint-inhibitor (ICI) response, per-cohort RNA-seq expression,
8
+ and cancer-testis antigens — behind one small Python API, a data fetch/cache
9
+ CLI, and a set of reference plots.
10
+
11
+ ## oncoref is the base layer
12
+
13
+ `oncoref` is **designed as the base layer** of the openvax/PIRL stack — the
14
+ intended single upstream **source of truth** for cancer reference data, meant to
15
+ become a shared dependency of
16
+ [pirlygenes](https://github.com/pirl-unc/pirlygenes),
17
+ [trufflepig](https://github.com/pirl-unc/trufflepig), and
18
+ [tsarina](https://github.com/pirl-unc/tsarina). Adoption is still in progress —
19
+ most of these don't depend on it yet. Architecturally it stays at the bottom: it
20
+ depends only on pandas / numpy / pyarrow / PyYAML, it **never imports its
21
+ consumers** (data and logic flow only downward), and it **owns** these
22
+ definitions rather than mirroring them from elsewhere.
23
+
24
+ Anything that needs to know about
25
+
26
+ - **gene expression of cancer samples** — per-cohort RNA-seq in a normalized,
27
+ comparable space: summary stats, tail-weighted percentiles, and medoid/exemplar
28
+ samples per cancer type/subtype;
29
+ - **HPA protein / RNA** normal-tissue expression;
30
+ - the **definition of cancer-testis antigens** — the HPA tissue-restriction call
31
+ over the candidate list (HPA-only; no MS/peptide layer);
32
+ - the **ontology of cancer types** — codes, the parent/child hierarchy, subtypes,
33
+ families, characteristic driver fusions, and the cross-cutting MSI/POLE/HPV
34
+ groupings; and
35
+ - **checkpoint-inhibitor response rates** and **TMB** per cancer type
36
+
37
+ depends on `oncoref` — including `pirlygenes` (gene-set curation/analysis),
38
+ `tsarina` (personalized target selection), `hitlist` (panel selection),
39
+ `trufflepig` (sample classification), and anything else downstream.
40
+
41
+ Everything keys on the cancer-type registry. The small curated tables ship in the
42
+ wheel; the heavy per-cohort expression bundle downloads on first use from
43
+ oncoref's own GitHub Release.
44
+
45
+ ## Install
46
+
47
+ ```bash
48
+ pip install oncoref
49
+ ```
50
+
51
+ ## Python API
52
+
53
+ ```python
54
+ import oncoref as od
55
+
56
+ od.resolve_cancer_type("prostate") # -> "PRAD"
57
+ od.cancer_type_info("SARC_RMS_ARMS") # full registry record + burden + tmb
58
+ od.cancer_tmb("LUAD_EGFR") # 6.9 (inherited from LUAD)
59
+ od.cancer_burden("pancreas", metric="us_mortality_pct")
60
+ od.burden_category("SARC_OS") # -> "bone_and_joint" (incidence/mortality bucket)
61
+ od.cancer_ici_response("SKCM") # 42 (anti-PD-1 ORR %; fallback aPD-1 → aPD-L1 → combo)
62
+ od.cancer_ici_response("SKCM", regimen="PD-1+CTLA-4") # 57.6 (pin a regimen)
63
+
64
+ # Cancer-testis antigens (HPA-derived tissue-restriction):
65
+ od.cta_gene_names() # expressed CTA symbols (MAGEA4, CT83, …)
66
+ od.cta_evidence() # full HPA restriction table
67
+
68
+ # Per-cohort expression percentiles (downloads the data bundle on first use):
69
+ od.cohort_gene_percentiles("PRAD") # per-gene p0…p100 vector (within-cohort)
70
+ od.within_sample_top_fraction("PRAD") # per-gene frac of samples top-5% (within-sample)
71
+ ```
72
+
73
+ ### Domains
74
+
75
+ - **Ontology** — `cancer_type_registry`, `resolve_cancer_type`,
76
+ `cancer_type_info`, `cancer_types_in_family`, `viral_status`, `fusion_status`,
77
+ the cohort vocabulary (`cohort_registry`, `cohort_aggregates`).
78
+ - **TMB** — `cancer_tmb`, `cancer_tmb_df` (parent-chain inheritance).
79
+ - **Incidence / mortality** — `cancer_burden`, `burden_category` (ACS / GLOBOCAN).
80
+ - **Checkpoint response** — `cancer_ici_response` (ORR per type/regimen: anti-PD-1,
81
+ anti-PD-L1, anti-PD-1+anti-CTLA-4), with `cancer_apd1_response` the PD-1 shortcut.
82
+ - **Expression** — `cohort_gene_percentiles`, `within_sample_top_fraction`,
83
+ `representative_cohort_samples` over the lazy-downloaded per-cohort bundle.
84
+ - **Cancer-testis antigens** — `cta_gene_names`/`cta_gene_ids`, `cta_evidence`,
85
+ `synthesize_restriction` (HPA-only tissue-restriction; MS evidence stays in the
86
+ target-selection layer).
87
+ - **HPA normal tissue** — `hpa_rna_consensus`, `hpa_normal_tissue` (IHC),
88
+ `hpa_single_cell`, and per-gene lookups (`gene_tissue_ntpm`,
89
+ `gene_protein_tissues`, `gene_cell_type_ntpm`) over HPA v23, fetched on demand
90
+ (`oncoref hpa fetch`).
91
+ - **Genome reference** — `canonical_gene_id_and_name`, `find_gene_id_by_name`,
92
+ `find_gene_name_from_ensembl_{gene,transcript}_id`, `aggregate_gene_expression`
93
+ (pyensembl-backed symbol ↔ Ensembl-ID resolution). pyensembl ships with the
94
+ package, but resolution needs a downloaded human release once:
95
+ `pyensembl install --release 111 --species homo_sapiens` (the accessors return
96
+ `None` until then).
97
+ - **Peptides** — `cta_specific_9mer_counts`, `cta_specific_9mer_load` (per-cohort
98
+ mean per-patient CTA-specific 9-mer load): 9-mers found in a CTA protein but in no
99
+ non-CTA protein, enumerated from the reference proteome and cached per release.
100
+ - **Plots** (`pip install oncoref[plots]`) — `oncoref.plots.apd1_vs_tmb`,
101
+ `apd1_orr_bars`, `incidence_vs_mortality`, and the CTA/coverage figures.
102
+
103
+ ## CLI
104
+
105
+ ```bash
106
+ oncoref cancer-type prostate # registry info as JSON
107
+ oncoref tmb LUAD_EGFR # 6.9
108
+ oncoref ici SKCM # 42 (--regimen to pin, --all-regimens to compare)
109
+ oncoref burden pancreas --metric us_mortality_pct
110
+ oncoref cta --count # number of expressed CTAs
111
+ oncoref plot apd1-vs-tmb --out apd1_vs_tmb.png
112
+
113
+ # expression-bundle cache (per-cohort expression):
114
+ oncoref cache fetch # download the ~340 MB bundle
115
+ oncoref cache status # which bundle paths are cached (no download)
116
+ oncoref cache dir # where the data bundle is cached
117
+ oncoref cache prune --yes # delete stale version caches
118
+ oncoref hpa fetch # download HPA reference data (RNA / IHC / single-cell)
119
+ oncoref version
120
+ ```
121
+
122
+ ## Development
123
+
124
+ ```bash
125
+ ./develop.sh # editable install with dev extras
126
+ ./format.sh # ruff format
127
+ ./lint.sh # ruff check + format --check
128
+ ./test.sh # lint + pytest with coverage
129
+ ```
130
+
131
+ ## License
132
+
133
+ Apache 2.0.