pyvariantdb 1.3__tar.gz → 1.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.
@@ -0,0 +1,256 @@
1
+ Metadata-Version: 2.4
2
+ Name: pyvariantdb
3
+ Version: 1.4
4
+ Summary: A python package to download, process and access dbSNP data.
5
+ License: # Attribution-NonCommercial 4.0 International
6
+
7
+ > *Creative Commons Corporation (“Creative Commons”) is not a law firm and does not provide legal services or legal advice. Distribution of Creative Commons public licenses does not create a lawyer-client or other relationship. Creative Commons makes its licenses and related information available on an “as-is” basis. Creative Commons gives no warranties regarding its licenses, any material licensed under their terms and conditions, or any related information. Creative Commons disclaims all liability for damages resulting from their use to the fullest extent possible.*
8
+ >
9
+ > ### Using Creative Commons Public Licenses
10
+ >
11
+ > Creative Commons public licenses provide a standard set of terms and conditions that creators and other rights holders may use to share original works of authorship and other material subject to copyright and certain other rights specified in the public license below. The following considerations are for informational purposes only, are not exhaustive, and do not form part of our licenses.
12
+ >
13
+ > * __Considerations for licensors:__ Our public licenses are intended for use by those authorized to give the public permission to use material in ways otherwise restricted by copyright and certain other rights. Our licenses are irrevocable. Licensors should read and understand the terms and conditions of the license they choose before applying it. Licensors should also secure all rights necessary before applying our licenses so that the public can reuse the material as expected. Licensors should clearly mark any material not subject to the license. This includes other CC-licensed material, or material used under an exception or limitation to copyright. [More considerations for licensors](http://wiki.creativecommons.org/Considerations_for_licensors_and_licensees#Considerations_for_licensors).
14
+ >
15
+ > * __Considerations for the public:__ By using one of our public licenses, a licensor grants the public permission to use the licensed material under specified terms and conditions. If the licensor’s permission is not necessary for any reason–for example, because of any applicable exception or limitation to copyright–then that use is not regulated by the license. Our licenses grant only permissions under copyright and certain other rights that a licensor has authority to grant. Use of the licensed material may still be restricted for other reasons, including because others have copyright or other rights in the material. A licensor may make special requests, such as asking that all changes be marked or described. Although not required by our licenses, you are encouraged to respect those requests where reasonable. [More considerations for the public](http://wiki.creativecommons.org/Considerations_for_licensors_and_licensees#Considerations_for_licensees).
16
+
17
+ ## Creative Commons Attribution-NonCommercial 4.0 International Public License
18
+
19
+ By exercising the Licensed Rights (defined below), You accept and agree to be bound by the terms and conditions of this Creative Commons Attribution-NonCommercial 4.0 International Public License ("Public License"). To the extent this Public License may be interpreted as a contract, You are granted the Licensed Rights in consideration of Your acceptance of these terms and conditions, and the Licensor grants You such rights in consideration of benefits the Licensor receives from making the Licensed Material available under these terms and conditions.
20
+
21
+ ### Section 1 – Definitions.
22
+
23
+ a. __Adapted Material__ means material subject to Copyright and Similar Rights that is derived from or based upon the Licensed Material and in which the Licensed Material is translated, altered, arranged, transformed, or otherwise modified in a manner requiring permission under the Copyright and Similar Rights held by the Licensor. For purposes of this Public License, where the Licensed Material is a musical work, performance, or sound recording, Adapted Material is always produced where the Licensed Material is synched in timed relation with a moving image.
24
+
25
+ b. __Adapter's License__ means the license You apply to Your Copyright and Similar Rights in Your contributions to Adapted Material in accordance with the terms and conditions of this Public License.
26
+
27
+ c. __Copyright and Similar Rights__ means copyright and/or similar rights closely related to copyright including, without limitation, performance, broadcast, sound recording, and Sui Generis Database Rights, without regard to how the rights are labeled or categorized. For purposes of this Public License, the rights specified in Section 2(b)(1)-(2) are not Copyright and Similar Rights.
28
+
29
+ d. __Effective Technological Measures__ means those measures that, in the absence of proper authority, may not be circumvented under laws fulfilling obligations under Article 11 of the WIPO Copyright Treaty adopted on December 20, 1996, and/or similar international agreements.
30
+
31
+ e. __Exceptions and Limitations__ means fair use, fair dealing, and/or any other exception or limitation to Copyright and Similar Rights that applies to Your use of the Licensed Material.
32
+
33
+ f. __Licensed Material__ means the artistic or literary work, database, or other material to which the Licensor applied this Public License.
34
+
35
+ g. __Licensed Rights__ means the rights granted to You subject to the terms and conditions of this Public License, which are limited to all Copyright and Similar Rights that apply to Your use of the Licensed Material and that the Licensor has authority to license.
36
+
37
+ h. __Licensor__ means the individual(s) or entity(ies) granting rights under this Public License.
38
+
39
+ i. __NonCommercial__ means not primarily intended for or directed towards commercial advantage or monetary compensation. For purposes of this Public License, the exchange of the Licensed Material for other material subject to Copyright and Similar Rights by digital file-sharing or similar means is NonCommercial provided there is no payment of monetary compensation in connection with the exchange.
40
+
41
+ j. __Share__ means to provide material to the public by any means or process that requires permission under the Licensed Rights, such as reproduction, public display, public performance, distribution, dissemination, communication, or importation, and to make material available to the public including in ways that members of the public may access the material from a place and at a time individually chosen by them.
42
+
43
+ k. __Sui Generis Database Rights__ means rights other than copyright resulting from Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, as amended and/or succeeded, as well as other essentially equivalent rights anywhere in the world.
44
+
45
+ l. __You__ means the individual or entity exercising the Licensed Rights under this Public License. Your has a corresponding meaning.
46
+
47
+ ### Section 2 – Scope.
48
+
49
+ a. ___License grant.___
50
+
51
+ 1. Subject to the terms and conditions of this Public License, the Licensor hereby grants You a worldwide, royalty-free, non-sublicensable, non-exclusive, irrevocable license to exercise the Licensed Rights in the Licensed Material to:
52
+
53
+ A. reproduce and Share the Licensed Material, in whole or in part, for NonCommercial purposes only; and
54
+
55
+ B. produce, reproduce, and Share Adapted Material for NonCommercial purposes only.
56
+
57
+ 2. __Exceptions and Limitations.__ For the avoidance of doubt, where Exceptions and Limitations apply to Your use, this Public License does not apply, and You do not need to comply with its terms and conditions.
58
+
59
+ 3. __Term.__ The term of this Public License is specified in Section 6(a).
60
+
61
+ 4. __Media and formats; technical modifications allowed.__ The Licensor authorizes You to exercise the Licensed Rights in all media and formats whether now known or hereafter created, and to make technical modifications necessary to do so. The Licensor waives and/or agrees not to assert any right or authority to forbid You from making technical modifications necessary to exercise the Licensed Rights, including technical modifications necessary to circumvent Effective Technological Measures. For purposes of this Public License, simply making modifications authorized by this Section 2(a)(4) never produces Adapted Material.
62
+
63
+ 5. __Downstream recipients.__
64
+
65
+ A. __Offer from the Licensor – Licensed Material.__ Every recipient of the Licensed Material automatically receives an offer from the Licensor to exercise the Licensed Rights under the terms and conditions of this Public License.
66
+
67
+ B. __No downstream restrictions.__ You may not offer or impose any additional or different terms or conditions on, or apply any Effective Technological Measures to, the Licensed Material if doing so restricts exercise of the Licensed Rights by any recipient of the Licensed Material.
68
+
69
+ 6. __No endorsement.__ Nothing in this Public License constitutes or may be construed as permission to assert or imply that You are, or that Your use of the Licensed Material is, connected with, or sponsored, endorsed, or granted official status by, the Licensor or others designated to receive attribution as provided in Section 3(a)(1)(A)(i).
70
+
71
+ b. ___Other rights.___
72
+
73
+ 1. Moral rights, such as the right of integrity, are not licensed under this Public License, nor are publicity, privacy, and/or other similar personality rights; however, to the extent possible, the Licensor waives and/or agrees not to assert any such rights held by the Licensor to the limited extent necessary to allow You to exercise the Licensed Rights, but not otherwise.
74
+
75
+ 2. Patent and trademark rights are not licensed under this Public License.
76
+
77
+ 3. To the extent possible, the Licensor waives any right to collect royalties from You for the exercise of the Licensed Rights, whether directly or through a collecting society under any voluntary or waivable statutory or compulsory licensing scheme. In all other cases the Licensor expressly reserves any right to collect such royalties, including when the Licensed Material is used other than for NonCommercial purposes.
78
+
79
+ ### Section 3 – License Conditions.
80
+
81
+ Your exercise of the Licensed Rights is expressly made subject to the following conditions.
82
+
83
+ a. ___Attribution.___
84
+
85
+ 1. If You Share the Licensed Material (including in modified form), You must:
86
+
87
+ A. retain the following if it is supplied by the Licensor with the Licensed Material:
88
+
89
+ i. identification of the creator(s) of the Licensed Material and any others designated to receive attribution, in any reasonable manner requested by the Licensor (including by pseudonym if designated);
90
+
91
+ ii. a copyright notice;
92
+
93
+ iii. a notice that refers to this Public License;
94
+
95
+ iv. a notice that refers to the disclaimer of warranties;
96
+
97
+ v. a URI or hyperlink to the Licensed Material to the extent reasonably practicable;
98
+
99
+ B. indicate if You modified the Licensed Material and retain an indication of any previous modifications; and
100
+
101
+ C. indicate the Licensed Material is licensed under this Public License, and include the text of, or the URI or hyperlink to, this Public License.
102
+
103
+ 2. You may satisfy the conditions in Section 3(a)(1) in any reasonable manner based on the medium, means, and context in which You Share the Licensed Material. For example, it may be reasonable to satisfy the conditions by providing a URI or hyperlink to a resource that includes the required information.
104
+
105
+ 3. If requested by the Licensor, You must remove any of the information required by Section 3(a)(1)(A) to the extent reasonably practicable.
106
+
107
+ 4. If You Share Adapted Material You produce, the Adapter's License You apply must not prevent recipients of the Adapted Material from complying with this Public License.
108
+
109
+ ### Section 4 – Sui Generis Database Rights.
110
+
111
+ Where the Licensed Rights include Sui Generis Database Rights that apply to Your use of the Licensed Material:
112
+
113
+ a. for the avoidance of doubt, Section 2(a)(1) grants You the right to extract, reuse, reproduce, and Share all or a substantial portion of the contents of the database for NonCommercial purposes only;
114
+
115
+ b. if You include all or a substantial portion of the database contents in a database in which You have Sui Generis Database Rights, then the database in which You have Sui Generis Database Rights (but not its individual contents) is Adapted Material; and
116
+
117
+ c. You must comply with the conditions in Section 3(a) if You Share all or a substantial portion of the contents of the database.
118
+
119
+ For the avoidance of doubt, this Section 4 supplements and does not replace Your obligations under this Public License where the Licensed Rights include other Copyright and Similar Rights.
120
+
121
+ ### Section 5 – Disclaimer of Warranties and Limitation of Liability.
122
+
123
+ a. __Unless otherwise separately undertaken by the Licensor, to the extent possible, the Licensor offers the Licensed Material as-is and as-available, and makes no representations or warranties of any kind concerning the Licensed Material, whether express, implied, statutory, or other. This includes, without limitation, warranties of title, merchantability, fitness for a particular purpose, non-infringement, absence of latent or other defects, accuracy, or the presence or absence of errors, whether or not known or discoverable. Where disclaimers of warranties are not allowed in full or in part, this disclaimer may not apply to You.__
124
+
125
+ b. __To the extent possible, in no event will the Licensor be liable to You on any legal theory (including, without limitation, negligence) or otherwise for any direct, special, indirect, incidental, consequential, punitive, exemplary, or other losses, costs, expenses, or damages arising out of this Public License or use of the Licensed Material, even if the Licensor has been advised of the possibility of such losses, costs, expenses, or damages. Where a limitation of liability is not allowed in full or in part, this limitation may not apply to You.__
126
+
127
+ c. The disclaimer of warranties and limitation of liability provided above shall be interpreted in a manner that, to the extent possible, most closely approximates an absolute disclaimer and waiver of all liability.
128
+
129
+ ### Section 6 – Term and Termination.
130
+
131
+ a. This Public License applies for the term of the Copyright and Similar Rights licensed here. However, if You fail to comply with this Public License, then Your rights under this Public License terminate automatically.
132
+
133
+ b. Where Your right to use the Licensed Material has terminated under Section 6(a), it reinstates:
134
+
135
+ 1. automatically as of the date the violation is cured, provided it is cured within 30 days of Your discovery of the violation; or
136
+
137
+ 2. upon express reinstatement by the Licensor.
138
+
139
+ For the avoidance of doubt, this Section 6(b) does not affect any right the Licensor may have to seek remedies for Your violations of this Public License.
140
+
141
+ c. For the avoidance of doubt, the Licensor may also offer the Licensed Material under separate terms or conditions or stop distributing the Licensed Material at any time; however, doing so will not terminate this Public License.
142
+
143
+ d. Sections 1, 5, 6, 7, and 8 survive termination of this Public License.
144
+
145
+ ### Section 7 – Other Terms and Conditions.
146
+
147
+ a. The Licensor shall not be bound by any additional or different terms or conditions communicated by You unless expressly agreed.
148
+
149
+ b. Any arrangements, understandings, or agreements regarding the Licensed Material not stated herein are separate from and independent of the terms and conditions of this Public License.
150
+
151
+ ### Section 8 – Interpretation.
152
+
153
+ a. For the avoidance of doubt, this Public License does not, and shall not be interpreted to, reduce, limit, restrict, or impose conditions on any use of the Licensed Material that could lawfully be made without permission under this Public License.
154
+
155
+ b. To the extent possible, if any provision of this Public License is deemed unenforceable, it shall be automatically reformed to the minimum extent necessary to make it enforceable. If the provision cannot be reformed, it shall be severed from this Public License without affecting the enforceability of the remaining terms and conditions.
156
+
157
+ c. No term or condition of this Public License will be waived and no failure to comply consented to unless expressly agreed to by the Licensor.
158
+
159
+ d. Nothing in this Public License constitutes or may be interpreted as a limitation upon, or waiver of, any privileges and immunities that apply to the Licensor or You, including from the legal processes of any jurisdiction or authority.
160
+
161
+ > Creative Commons is not a party to its public licenses. Notwithstanding, Creative Commons may elect to apply one of its public licenses to material it publishes and in those instances will be considered the “Licensor.” Except for the limited purpose of indicating that material is shared under a Creative Commons public license or as otherwise permitted by the Creative Commons policies published at [creativecommons.org/policies](http://creativecommons.org/policies), Creative Commons does not authorize the use of the trademark “Creative Commons” or any other trademark or logo of Creative Commons without its prior written consent including, without limitation, in connection with any unauthorized modifications to any of its public licenses or any other arrangements, understandings, or agreements concerning use of licensed material. For the avoidance of doubt, this paragraph does not form part of the public licenses.
162
+ >
163
+ > Creative Commons may be contacted at creativecommons.org
164
+
165
+ Requires-Python: >=3.11
166
+ Description-Content-Type: text/markdown
167
+ License-File: LICENSE
168
+ Provides-Extra: test
169
+ Requires-Dist: pytest; extra == "test"
170
+ Requires-Dist: twine; extra == "test"
171
+ Requires-Dist: pre-commit; extra == "test"
172
+ Requires-Dist: pytest-ruff; extra == "test"
173
+ Requires-Dist: ruff; extra == "test"
174
+ Requires-Dist: grayskull; extra == "test"
175
+ Provides-Extra: prod
176
+ Requires-Dist: pyvariantdb; extra == "prod"
177
+ Provides-Extra: all
178
+ Requires-Dist: pyvariantdb[test]; extra == "all"
179
+ Dynamic: license-file
180
+
181
+ # dbSNP to Parquet Converter
182
+
183
+ A python-package focused rewrite of [Weinstock's dbSNP](https://github.com/weinstockj/dbSNP_to_parquet) to parquet
184
+ repository.
185
+ This package allows convenient download, processing and access to data from dbSNP. A simple python interface
186
+ can be used to work with the data once it is processed.
187
+
188
+ ## Installation
189
+
190
+ `pyvariantdb` is available on PyPI and can be installed from there with the package management tool of choice. For
191
+ development we use pixi:
192
+
193
+ ```bash
194
+ # install pixi
195
+ curl -fsSL https://pixi.sh/install.sh | sh
196
+ pixi update && pixi install
197
+ ```
198
+
199
+ ## Usage
200
+
201
+ We recommend to prepare the data from the command line before using the package since download and processing takes
202
+ quit some time. Per default the data is stored at ~/.cache/pyvariantdb. This can be changed through the usage of
203
+ environment variables:
204
+
205
+ ```bash
206
+ export PYVARIANTDB_HOME = "/raid/cache/pyvariantdb"
207
+ ```
208
+
209
+ Execution of the pipeline can be done with:
210
+
211
+ ```bash
212
+ # activate pixi
213
+ pixi shell -e default
214
+ # download dbsnp
215
+ pyvariantdb-download
216
+ # transform the database to parquets
217
+ pyvariantdb-make-dbsnp
218
+ ```
219
+
220
+ We aim to provide an easy interface to extract genomic coordinates from dbSNP. For this, the main functionality
221
+ is extremely simple. Just provide the rs-identifier (with or without chromosome) and we fetch the respective
222
+ coordindates. However, to achieve this we need to run the pipeline mentioned above.
223
+
224
+ Extracting coordinates is simple:
225
+
226
+ ```python
227
+ from pyvariantdb.lookup import SNPLookup
228
+
229
+ lookup = SNPLookup()
230
+ # P53 mutations, chromosome 17
231
+ rsids = ["rs1042522", "rs17878362", "rs1800372"]
232
+ df_chr = lookup.query_chromosome(rsids, "17")
233
+ df_genome = lookup.query_genome(rsids)
234
+ print(df_chr)
235
+ print(df_genome)
236
+ ```
237
+
238
+ ## Processing Pipeline
239
+
240
+ `pyvariantdb` offers some quality of life improvements for working with dbSNP and the original repository.
241
+ The original pipeline remains the same:
242
+
243
+ 1. Downloads dbSNP data (GRCh38 build 156)
244
+ 2. Filters for SNVs only
245
+ 3. Converts chromosome contigs to standard naming
246
+ 4. Splits data by chromosome
247
+ 5. Creates Parquet lookup tables with RSID mappings
248
+
249
+ ## Output
250
+
251
+ The script entrypoint generates the following files on-disk to the defined cache dir.
252
+
253
+ - `dbSNP_156.bcf` - Full filtered BCF file
254
+ - `dbSNP_156.chr*.bcf` - Per-chromosome BCF files
255
+ - `dbSNP_156.chr*.lookup.parquet` - Per-chromosome RSID lookup tables
256
+ - `dbSNP_156.lookup.parquet` - Combined RSID lookup table
@@ -49,10 +49,10 @@ from pyvariantdb.lookup import SNPLookup
49
49
  lookup = SNPLookup()
50
50
  # P53 mutations, chromosome 17
51
51
  rsids = ["rs1042522", "rs17878362", "rs1800372"]
52
- df_all = lookup.query_all(rsids)
53
52
  df_chr = lookup.query_chromosome(rsids, "17")
54
- print(df_all)
55
- print(df_chr)
53
+ df_genome = lookup.query_genome(rsids)
54
+ print(df_chr)
55
+ print(df_genome)
56
56
  ```
57
57
 
58
58
  ## Processing Pipeline
@@ -1,9 +1,10 @@
1
1
  [project]
2
2
  name = "pyvariantdb"
3
- version = "1.3"
3
+ version = "1.4"
4
4
  description = "A python package to download, process and access dbSNP data."
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.11"
7
+ license = {file = "LICENSE"}
7
8
 
8
9
  [project.scripts]
9
10
  pyvariantdb-download = "pyvariantdb.download:download_dbsnp"
@@ -8,7 +8,9 @@ from pathlib import Path
8
8
  def get_cache_dir() -> None:
9
9
  """Return the root directory of the project."""
10
10
  # check if env var PYVARIANTDB_HOME exists, otherwise ~/.cache/pyvariantdb
11
- cache_dir = os.getenv("PYVARIANTDB_HOME", Path().home() / ".cache" / "pyvariantdb")
11
+ cache_dir = Path(
12
+ os.getenv("PYVARIANTDB_HOME", Path().home() / ".cache" / "pyvariantdb")
13
+ )
12
14
  cache_dir.mkdir(parents=True, exist_ok=True)
13
15
  logger.info(f"Cache directory: {cache_dir}")
14
16
  return cache_dir
@@ -0,0 +1,256 @@
1
+ Metadata-Version: 2.4
2
+ Name: pyvariantdb
3
+ Version: 1.4
4
+ Summary: A python package to download, process and access dbSNP data.
5
+ License: # Attribution-NonCommercial 4.0 International
6
+
7
+ > *Creative Commons Corporation (“Creative Commons”) is not a law firm and does not provide legal services or legal advice. Distribution of Creative Commons public licenses does not create a lawyer-client or other relationship. Creative Commons makes its licenses and related information available on an “as-is” basis. Creative Commons gives no warranties regarding its licenses, any material licensed under their terms and conditions, or any related information. Creative Commons disclaims all liability for damages resulting from their use to the fullest extent possible.*
8
+ >
9
+ > ### Using Creative Commons Public Licenses
10
+ >
11
+ > Creative Commons public licenses provide a standard set of terms and conditions that creators and other rights holders may use to share original works of authorship and other material subject to copyright and certain other rights specified in the public license below. The following considerations are for informational purposes only, are not exhaustive, and do not form part of our licenses.
12
+ >
13
+ > * __Considerations for licensors:__ Our public licenses are intended for use by those authorized to give the public permission to use material in ways otherwise restricted by copyright and certain other rights. Our licenses are irrevocable. Licensors should read and understand the terms and conditions of the license they choose before applying it. Licensors should also secure all rights necessary before applying our licenses so that the public can reuse the material as expected. Licensors should clearly mark any material not subject to the license. This includes other CC-licensed material, or material used under an exception or limitation to copyright. [More considerations for licensors](http://wiki.creativecommons.org/Considerations_for_licensors_and_licensees#Considerations_for_licensors).
14
+ >
15
+ > * __Considerations for the public:__ By using one of our public licenses, a licensor grants the public permission to use the licensed material under specified terms and conditions. If the licensor’s permission is not necessary for any reason–for example, because of any applicable exception or limitation to copyright–then that use is not regulated by the license. Our licenses grant only permissions under copyright and certain other rights that a licensor has authority to grant. Use of the licensed material may still be restricted for other reasons, including because others have copyright or other rights in the material. A licensor may make special requests, such as asking that all changes be marked or described. Although not required by our licenses, you are encouraged to respect those requests where reasonable. [More considerations for the public](http://wiki.creativecommons.org/Considerations_for_licensors_and_licensees#Considerations_for_licensees).
16
+
17
+ ## Creative Commons Attribution-NonCommercial 4.0 International Public License
18
+
19
+ By exercising the Licensed Rights (defined below), You accept and agree to be bound by the terms and conditions of this Creative Commons Attribution-NonCommercial 4.0 International Public License ("Public License"). To the extent this Public License may be interpreted as a contract, You are granted the Licensed Rights in consideration of Your acceptance of these terms and conditions, and the Licensor grants You such rights in consideration of benefits the Licensor receives from making the Licensed Material available under these terms and conditions.
20
+
21
+ ### Section 1 – Definitions.
22
+
23
+ a. __Adapted Material__ means material subject to Copyright and Similar Rights that is derived from or based upon the Licensed Material and in which the Licensed Material is translated, altered, arranged, transformed, or otherwise modified in a manner requiring permission under the Copyright and Similar Rights held by the Licensor. For purposes of this Public License, where the Licensed Material is a musical work, performance, or sound recording, Adapted Material is always produced where the Licensed Material is synched in timed relation with a moving image.
24
+
25
+ b. __Adapter's License__ means the license You apply to Your Copyright and Similar Rights in Your contributions to Adapted Material in accordance with the terms and conditions of this Public License.
26
+
27
+ c. __Copyright and Similar Rights__ means copyright and/or similar rights closely related to copyright including, without limitation, performance, broadcast, sound recording, and Sui Generis Database Rights, without regard to how the rights are labeled or categorized. For purposes of this Public License, the rights specified in Section 2(b)(1)-(2) are not Copyright and Similar Rights.
28
+
29
+ d. __Effective Technological Measures__ means those measures that, in the absence of proper authority, may not be circumvented under laws fulfilling obligations under Article 11 of the WIPO Copyright Treaty adopted on December 20, 1996, and/or similar international agreements.
30
+
31
+ e. __Exceptions and Limitations__ means fair use, fair dealing, and/or any other exception or limitation to Copyright and Similar Rights that applies to Your use of the Licensed Material.
32
+
33
+ f. __Licensed Material__ means the artistic or literary work, database, or other material to which the Licensor applied this Public License.
34
+
35
+ g. __Licensed Rights__ means the rights granted to You subject to the terms and conditions of this Public License, which are limited to all Copyright and Similar Rights that apply to Your use of the Licensed Material and that the Licensor has authority to license.
36
+
37
+ h. __Licensor__ means the individual(s) or entity(ies) granting rights under this Public License.
38
+
39
+ i. __NonCommercial__ means not primarily intended for or directed towards commercial advantage or monetary compensation. For purposes of this Public License, the exchange of the Licensed Material for other material subject to Copyright and Similar Rights by digital file-sharing or similar means is NonCommercial provided there is no payment of monetary compensation in connection with the exchange.
40
+
41
+ j. __Share__ means to provide material to the public by any means or process that requires permission under the Licensed Rights, such as reproduction, public display, public performance, distribution, dissemination, communication, or importation, and to make material available to the public including in ways that members of the public may access the material from a place and at a time individually chosen by them.
42
+
43
+ k. __Sui Generis Database Rights__ means rights other than copyright resulting from Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, as amended and/or succeeded, as well as other essentially equivalent rights anywhere in the world.
44
+
45
+ l. __You__ means the individual or entity exercising the Licensed Rights under this Public License. Your has a corresponding meaning.
46
+
47
+ ### Section 2 – Scope.
48
+
49
+ a. ___License grant.___
50
+
51
+ 1. Subject to the terms and conditions of this Public License, the Licensor hereby grants You a worldwide, royalty-free, non-sublicensable, non-exclusive, irrevocable license to exercise the Licensed Rights in the Licensed Material to:
52
+
53
+ A. reproduce and Share the Licensed Material, in whole or in part, for NonCommercial purposes only; and
54
+
55
+ B. produce, reproduce, and Share Adapted Material for NonCommercial purposes only.
56
+
57
+ 2. __Exceptions and Limitations.__ For the avoidance of doubt, where Exceptions and Limitations apply to Your use, this Public License does not apply, and You do not need to comply with its terms and conditions.
58
+
59
+ 3. __Term.__ The term of this Public License is specified in Section 6(a).
60
+
61
+ 4. __Media and formats; technical modifications allowed.__ The Licensor authorizes You to exercise the Licensed Rights in all media and formats whether now known or hereafter created, and to make technical modifications necessary to do so. The Licensor waives and/or agrees not to assert any right or authority to forbid You from making technical modifications necessary to exercise the Licensed Rights, including technical modifications necessary to circumvent Effective Technological Measures. For purposes of this Public License, simply making modifications authorized by this Section 2(a)(4) never produces Adapted Material.
62
+
63
+ 5. __Downstream recipients.__
64
+
65
+ A. __Offer from the Licensor – Licensed Material.__ Every recipient of the Licensed Material automatically receives an offer from the Licensor to exercise the Licensed Rights under the terms and conditions of this Public License.
66
+
67
+ B. __No downstream restrictions.__ You may not offer or impose any additional or different terms or conditions on, or apply any Effective Technological Measures to, the Licensed Material if doing so restricts exercise of the Licensed Rights by any recipient of the Licensed Material.
68
+
69
+ 6. __No endorsement.__ Nothing in this Public License constitutes or may be construed as permission to assert or imply that You are, or that Your use of the Licensed Material is, connected with, or sponsored, endorsed, or granted official status by, the Licensor or others designated to receive attribution as provided in Section 3(a)(1)(A)(i).
70
+
71
+ b. ___Other rights.___
72
+
73
+ 1. Moral rights, such as the right of integrity, are not licensed under this Public License, nor are publicity, privacy, and/or other similar personality rights; however, to the extent possible, the Licensor waives and/or agrees not to assert any such rights held by the Licensor to the limited extent necessary to allow You to exercise the Licensed Rights, but not otherwise.
74
+
75
+ 2. Patent and trademark rights are not licensed under this Public License.
76
+
77
+ 3. To the extent possible, the Licensor waives any right to collect royalties from You for the exercise of the Licensed Rights, whether directly or through a collecting society under any voluntary or waivable statutory or compulsory licensing scheme. In all other cases the Licensor expressly reserves any right to collect such royalties, including when the Licensed Material is used other than for NonCommercial purposes.
78
+
79
+ ### Section 3 – License Conditions.
80
+
81
+ Your exercise of the Licensed Rights is expressly made subject to the following conditions.
82
+
83
+ a. ___Attribution.___
84
+
85
+ 1. If You Share the Licensed Material (including in modified form), You must:
86
+
87
+ A. retain the following if it is supplied by the Licensor with the Licensed Material:
88
+
89
+ i. identification of the creator(s) of the Licensed Material and any others designated to receive attribution, in any reasonable manner requested by the Licensor (including by pseudonym if designated);
90
+
91
+ ii. a copyright notice;
92
+
93
+ iii. a notice that refers to this Public License;
94
+
95
+ iv. a notice that refers to the disclaimer of warranties;
96
+
97
+ v. a URI or hyperlink to the Licensed Material to the extent reasonably practicable;
98
+
99
+ B. indicate if You modified the Licensed Material and retain an indication of any previous modifications; and
100
+
101
+ C. indicate the Licensed Material is licensed under this Public License, and include the text of, or the URI or hyperlink to, this Public License.
102
+
103
+ 2. You may satisfy the conditions in Section 3(a)(1) in any reasonable manner based on the medium, means, and context in which You Share the Licensed Material. For example, it may be reasonable to satisfy the conditions by providing a URI or hyperlink to a resource that includes the required information.
104
+
105
+ 3. If requested by the Licensor, You must remove any of the information required by Section 3(a)(1)(A) to the extent reasonably practicable.
106
+
107
+ 4. If You Share Adapted Material You produce, the Adapter's License You apply must not prevent recipients of the Adapted Material from complying with this Public License.
108
+
109
+ ### Section 4 – Sui Generis Database Rights.
110
+
111
+ Where the Licensed Rights include Sui Generis Database Rights that apply to Your use of the Licensed Material:
112
+
113
+ a. for the avoidance of doubt, Section 2(a)(1) grants You the right to extract, reuse, reproduce, and Share all or a substantial portion of the contents of the database for NonCommercial purposes only;
114
+
115
+ b. if You include all or a substantial portion of the database contents in a database in which You have Sui Generis Database Rights, then the database in which You have Sui Generis Database Rights (but not its individual contents) is Adapted Material; and
116
+
117
+ c. You must comply with the conditions in Section 3(a) if You Share all or a substantial portion of the contents of the database.
118
+
119
+ For the avoidance of doubt, this Section 4 supplements and does not replace Your obligations under this Public License where the Licensed Rights include other Copyright and Similar Rights.
120
+
121
+ ### Section 5 – Disclaimer of Warranties and Limitation of Liability.
122
+
123
+ a. __Unless otherwise separately undertaken by the Licensor, to the extent possible, the Licensor offers the Licensed Material as-is and as-available, and makes no representations or warranties of any kind concerning the Licensed Material, whether express, implied, statutory, or other. This includes, without limitation, warranties of title, merchantability, fitness for a particular purpose, non-infringement, absence of latent or other defects, accuracy, or the presence or absence of errors, whether or not known or discoverable. Where disclaimers of warranties are not allowed in full or in part, this disclaimer may not apply to You.__
124
+
125
+ b. __To the extent possible, in no event will the Licensor be liable to You on any legal theory (including, without limitation, negligence) or otherwise for any direct, special, indirect, incidental, consequential, punitive, exemplary, or other losses, costs, expenses, or damages arising out of this Public License or use of the Licensed Material, even if the Licensor has been advised of the possibility of such losses, costs, expenses, or damages. Where a limitation of liability is not allowed in full or in part, this limitation may not apply to You.__
126
+
127
+ c. The disclaimer of warranties and limitation of liability provided above shall be interpreted in a manner that, to the extent possible, most closely approximates an absolute disclaimer and waiver of all liability.
128
+
129
+ ### Section 6 – Term and Termination.
130
+
131
+ a. This Public License applies for the term of the Copyright and Similar Rights licensed here. However, if You fail to comply with this Public License, then Your rights under this Public License terminate automatically.
132
+
133
+ b. Where Your right to use the Licensed Material has terminated under Section 6(a), it reinstates:
134
+
135
+ 1. automatically as of the date the violation is cured, provided it is cured within 30 days of Your discovery of the violation; or
136
+
137
+ 2. upon express reinstatement by the Licensor.
138
+
139
+ For the avoidance of doubt, this Section 6(b) does not affect any right the Licensor may have to seek remedies for Your violations of this Public License.
140
+
141
+ c. For the avoidance of doubt, the Licensor may also offer the Licensed Material under separate terms or conditions or stop distributing the Licensed Material at any time; however, doing so will not terminate this Public License.
142
+
143
+ d. Sections 1, 5, 6, 7, and 8 survive termination of this Public License.
144
+
145
+ ### Section 7 – Other Terms and Conditions.
146
+
147
+ a. The Licensor shall not be bound by any additional or different terms or conditions communicated by You unless expressly agreed.
148
+
149
+ b. Any arrangements, understandings, or agreements regarding the Licensed Material not stated herein are separate from and independent of the terms and conditions of this Public License.
150
+
151
+ ### Section 8 – Interpretation.
152
+
153
+ a. For the avoidance of doubt, this Public License does not, and shall not be interpreted to, reduce, limit, restrict, or impose conditions on any use of the Licensed Material that could lawfully be made without permission under this Public License.
154
+
155
+ b. To the extent possible, if any provision of this Public License is deemed unenforceable, it shall be automatically reformed to the minimum extent necessary to make it enforceable. If the provision cannot be reformed, it shall be severed from this Public License without affecting the enforceability of the remaining terms and conditions.
156
+
157
+ c. No term or condition of this Public License will be waived and no failure to comply consented to unless expressly agreed to by the Licensor.
158
+
159
+ d. Nothing in this Public License constitutes or may be interpreted as a limitation upon, or waiver of, any privileges and immunities that apply to the Licensor or You, including from the legal processes of any jurisdiction or authority.
160
+
161
+ > Creative Commons is not a party to its public licenses. Notwithstanding, Creative Commons may elect to apply one of its public licenses to material it publishes and in those instances will be considered the “Licensor.” Except for the limited purpose of indicating that material is shared under a Creative Commons public license or as otherwise permitted by the Creative Commons policies published at [creativecommons.org/policies](http://creativecommons.org/policies), Creative Commons does not authorize the use of the trademark “Creative Commons” or any other trademark or logo of Creative Commons without its prior written consent including, without limitation, in connection with any unauthorized modifications to any of its public licenses or any other arrangements, understandings, or agreements concerning use of licensed material. For the avoidance of doubt, this paragraph does not form part of the public licenses.
162
+ >
163
+ > Creative Commons may be contacted at creativecommons.org
164
+
165
+ Requires-Python: >=3.11
166
+ Description-Content-Type: text/markdown
167
+ License-File: LICENSE
168
+ Provides-Extra: test
169
+ Requires-Dist: pytest; extra == "test"
170
+ Requires-Dist: twine; extra == "test"
171
+ Requires-Dist: pre-commit; extra == "test"
172
+ Requires-Dist: pytest-ruff; extra == "test"
173
+ Requires-Dist: ruff; extra == "test"
174
+ Requires-Dist: grayskull; extra == "test"
175
+ Provides-Extra: prod
176
+ Requires-Dist: pyvariantdb; extra == "prod"
177
+ Provides-Extra: all
178
+ Requires-Dist: pyvariantdb[test]; extra == "all"
179
+ Dynamic: license-file
180
+
181
+ # dbSNP to Parquet Converter
182
+
183
+ A python-package focused rewrite of [Weinstock's dbSNP](https://github.com/weinstockj/dbSNP_to_parquet) to parquet
184
+ repository.
185
+ This package allows convenient download, processing and access to data from dbSNP. A simple python interface
186
+ can be used to work with the data once it is processed.
187
+
188
+ ## Installation
189
+
190
+ `pyvariantdb` is available on PyPI and can be installed from there with the package management tool of choice. For
191
+ development we use pixi:
192
+
193
+ ```bash
194
+ # install pixi
195
+ curl -fsSL https://pixi.sh/install.sh | sh
196
+ pixi update && pixi install
197
+ ```
198
+
199
+ ## Usage
200
+
201
+ We recommend to prepare the data from the command line before using the package since download and processing takes
202
+ quit some time. Per default the data is stored at ~/.cache/pyvariantdb. This can be changed through the usage of
203
+ environment variables:
204
+
205
+ ```bash
206
+ export PYVARIANTDB_HOME = "/raid/cache/pyvariantdb"
207
+ ```
208
+
209
+ Execution of the pipeline can be done with:
210
+
211
+ ```bash
212
+ # activate pixi
213
+ pixi shell -e default
214
+ # download dbsnp
215
+ pyvariantdb-download
216
+ # transform the database to parquets
217
+ pyvariantdb-make-dbsnp
218
+ ```
219
+
220
+ We aim to provide an easy interface to extract genomic coordinates from dbSNP. For this, the main functionality
221
+ is extremely simple. Just provide the rs-identifier (with or without chromosome) and we fetch the respective
222
+ coordindates. However, to achieve this we need to run the pipeline mentioned above.
223
+
224
+ Extracting coordinates is simple:
225
+
226
+ ```python
227
+ from pyvariantdb.lookup import SNPLookup
228
+
229
+ lookup = SNPLookup()
230
+ # P53 mutations, chromosome 17
231
+ rsids = ["rs1042522", "rs17878362", "rs1800372"]
232
+ df_chr = lookup.query_chromosome(rsids, "17")
233
+ df_genome = lookup.query_genome(rsids)
234
+ print(df_chr)
235
+ print(df_genome)
236
+ ```
237
+
238
+ ## Processing Pipeline
239
+
240
+ `pyvariantdb` offers some quality of life improvements for working with dbSNP and the original repository.
241
+ The original pipeline remains the same:
242
+
243
+ 1. Downloads dbSNP data (GRCh38 build 156)
244
+ 2. Filters for SNVs only
245
+ 3. Converts chromosome contigs to standard naming
246
+ 4. Splits data by chromosome
247
+ 5. Creates Parquet lookup tables with RSID mappings
248
+
249
+ ## Output
250
+
251
+ The script entrypoint generates the following files on-disk to the defined cache dir.
252
+
253
+ - `dbSNP_156.bcf` - Full filtered BCF file
254
+ - `dbSNP_156.chr*.bcf` - Per-chromosome BCF files
255
+ - `dbSNP_156.chr*.lookup.parquet` - Per-chromosome RSID lookup tables
256
+ - `dbSNP_156.lookup.parquet` - Combined RSID lookup table
pyvariantdb-1.3/PKG-INFO DELETED
@@ -1,96 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: pyvariantdb
3
- Version: 1.3
4
- Summary: A python package to download, process and access dbSNP data.
5
- Requires-Python: >=3.11
6
- Description-Content-Type: text/markdown
7
- License-File: LICENSE
8
- Provides-Extra: test
9
- Requires-Dist: pytest; extra == "test"
10
- Requires-Dist: twine; extra == "test"
11
- Requires-Dist: pre-commit; extra == "test"
12
- Requires-Dist: pytest-ruff; extra == "test"
13
- Requires-Dist: ruff; extra == "test"
14
- Requires-Dist: grayskull; extra == "test"
15
- Provides-Extra: prod
16
- Requires-Dist: pyvariantdb; extra == "prod"
17
- Provides-Extra: all
18
- Requires-Dist: pyvariantdb[test]; extra == "all"
19
- Dynamic: license-file
20
-
21
- # dbSNP to Parquet Converter
22
-
23
- A python-package focused rewrite of [Weinstock's dbSNP](https://github.com/weinstockj/dbSNP_to_parquet) to parquet
24
- repository.
25
- This package allows convenient download, processing and access to data from dbSNP. A simple python interface
26
- can be used to work with the data once it is processed.
27
-
28
- ## Installation
29
-
30
- `pyvariantdb` is available on PyPI and can be installed from there with the package management tool of choice. For
31
- development we use pixi:
32
-
33
- ```bash
34
- # install pixi
35
- curl -fsSL https://pixi.sh/install.sh | sh
36
- pixi update && pixi install
37
- ```
38
-
39
- ## Usage
40
-
41
- We recommend to prepare the data from the command line before using the package since download and processing takes
42
- quit some time. Per default the data is stored at ~/.cache/pyvariantdb. This can be changed through the usage of
43
- environment variables:
44
-
45
- ```bash
46
- export PYVARIANTDB_HOME = "/raid/cache/pyvariantdb"
47
- ```
48
-
49
- Execution of the pipeline can be done with:
50
-
51
- ```bash
52
- # activate pixi
53
- pixi shell -e default
54
- # download dbsnp
55
- pyvariantdb-download
56
- # transform the database to parquets
57
- pyvariantdb-make-dbsnp
58
- ```
59
-
60
- We aim to provide an easy interface to extract genomic coordinates from dbSNP. For this, the main functionality
61
- is extremely simple. Just provide the rs-identifier (with or without chromosome) and we fetch the respective
62
- coordindates. However, to achieve this we need to run the pipeline mentioned above.
63
-
64
- Extracting coordinates is simple:
65
-
66
- ```python
67
- from pyvariantdb.lookup import SNPLookup
68
-
69
- lookup = SNPLookup()
70
- # P53 mutations, chromosome 17
71
- rsids = ["rs1042522", "rs17878362", "rs1800372"]
72
- df_all = lookup.query_all(rsids)
73
- df_chr = lookup.query_chromosome(rsids, "17")
74
- print(df_all)
75
- print(df_chr)
76
- ```
77
-
78
- ## Processing Pipeline
79
-
80
- `pyvariantdb` offers some quality of life improvements for working with dbSNP and the original repository.
81
- The original pipeline remains the same:
82
-
83
- 1. Downloads dbSNP data (GRCh38 build 156)
84
- 2. Filters for SNVs only
85
- 3. Converts chromosome contigs to standard naming
86
- 4. Splits data by chromosome
87
- 5. Creates Parquet lookup tables with RSID mappings
88
-
89
- ## Output
90
-
91
- The script entrypoint generates the following files on-disk to the defined cache dir.
92
-
93
- - `dbSNP_156.bcf` - Full filtered BCF file
94
- - `dbSNP_156.chr*.bcf` - Per-chromosome BCF files
95
- - `dbSNP_156.chr*.lookup.parquet` - Per-chromosome RSID lookup tables
96
- - `dbSNP_156.lookup.parquet` - Combined RSID lookup table
@@ -1,96 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: pyvariantdb
3
- Version: 1.3
4
- Summary: A python package to download, process and access dbSNP data.
5
- Requires-Python: >=3.11
6
- Description-Content-Type: text/markdown
7
- License-File: LICENSE
8
- Provides-Extra: test
9
- Requires-Dist: pytest; extra == "test"
10
- Requires-Dist: twine; extra == "test"
11
- Requires-Dist: pre-commit; extra == "test"
12
- Requires-Dist: pytest-ruff; extra == "test"
13
- Requires-Dist: ruff; extra == "test"
14
- Requires-Dist: grayskull; extra == "test"
15
- Provides-Extra: prod
16
- Requires-Dist: pyvariantdb; extra == "prod"
17
- Provides-Extra: all
18
- Requires-Dist: pyvariantdb[test]; extra == "all"
19
- Dynamic: license-file
20
-
21
- # dbSNP to Parquet Converter
22
-
23
- A python-package focused rewrite of [Weinstock's dbSNP](https://github.com/weinstockj/dbSNP_to_parquet) to parquet
24
- repository.
25
- This package allows convenient download, processing and access to data from dbSNP. A simple python interface
26
- can be used to work with the data once it is processed.
27
-
28
- ## Installation
29
-
30
- `pyvariantdb` is available on PyPI and can be installed from there with the package management tool of choice. For
31
- development we use pixi:
32
-
33
- ```bash
34
- # install pixi
35
- curl -fsSL https://pixi.sh/install.sh | sh
36
- pixi update && pixi install
37
- ```
38
-
39
- ## Usage
40
-
41
- We recommend to prepare the data from the command line before using the package since download and processing takes
42
- quit some time. Per default the data is stored at ~/.cache/pyvariantdb. This can be changed through the usage of
43
- environment variables:
44
-
45
- ```bash
46
- export PYVARIANTDB_HOME = "/raid/cache/pyvariantdb"
47
- ```
48
-
49
- Execution of the pipeline can be done with:
50
-
51
- ```bash
52
- # activate pixi
53
- pixi shell -e default
54
- # download dbsnp
55
- pyvariantdb-download
56
- # transform the database to parquets
57
- pyvariantdb-make-dbsnp
58
- ```
59
-
60
- We aim to provide an easy interface to extract genomic coordinates from dbSNP. For this, the main functionality
61
- is extremely simple. Just provide the rs-identifier (with or without chromosome) and we fetch the respective
62
- coordindates. However, to achieve this we need to run the pipeline mentioned above.
63
-
64
- Extracting coordinates is simple:
65
-
66
- ```python
67
- from pyvariantdb.lookup import SNPLookup
68
-
69
- lookup = SNPLookup()
70
- # P53 mutations, chromosome 17
71
- rsids = ["rs1042522", "rs17878362", "rs1800372"]
72
- df_all = lookup.query_all(rsids)
73
- df_chr = lookup.query_chromosome(rsids, "17")
74
- print(df_all)
75
- print(df_chr)
76
- ```
77
-
78
- ## Processing Pipeline
79
-
80
- `pyvariantdb` offers some quality of life improvements for working with dbSNP and the original repository.
81
- The original pipeline remains the same:
82
-
83
- 1. Downloads dbSNP data (GRCh38 build 156)
84
- 2. Filters for SNVs only
85
- 3. Converts chromosome contigs to standard naming
86
- 4. Splits data by chromosome
87
- 5. Creates Parquet lookup tables with RSID mappings
88
-
89
- ## Output
90
-
91
- The script entrypoint generates the following files on-disk to the defined cache dir.
92
-
93
- - `dbSNP_156.bcf` - Full filtered BCF file
94
- - `dbSNP_156.chr*.bcf` - Per-chromosome BCF files
95
- - `dbSNP_156.chr*.lookup.parquet` - Per-chromosome RSID lookup tables
96
- - `dbSNP_156.lookup.parquet` - Combined RSID lookup table
File without changes
File without changes
File without changes