protein-fasta 0.3.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.
- protein_fasta-0.3.0/LICENSE +21 -0
- protein_fasta-0.3.0/LICENSES/Apache-2.0.txt +159 -0
- protein_fasta-0.3.0/LICENSES/BSD-3-Clause-Biopython.txt +29 -0
- protein_fasta-0.3.0/NOTICE +33 -0
- protein_fasta-0.3.0/PKG-INFO +202 -0
- protein_fasta-0.3.0/README.md +161 -0
- protein_fasta-0.3.0/pyproject.toml +162 -0
- protein_fasta-0.3.0/pyproject.toml.orig +136 -0
- protein_fasta-0.3.0/src/protein_fasta/__init__.py +1 -0
- protein_fasta-0.3.0/src/protein_fasta/analytics/__init__.py +0 -0
- protein_fasta-0.3.0/src/protein_fasta/analytics/clustering.py +213 -0
- protein_fasta-0.3.0/src/protein_fasta/analytics/comparisons.py +202 -0
- protein_fasta-0.3.0/src/protein_fasta/analytics/decoy_diagnostics.py +112 -0
- protein_fasta-0.3.0/src/protein_fasta/analytics/digestion.py +95 -0
- protein_fasta-0.3.0/src/protein_fasta/analytics/hashing.py +75 -0
- protein_fasta-0.3.0/src/protein_fasta/analytics/peptide_properties.py +286 -0
- protein_fasta-0.3.0/src/protein_fasta/analytics_compile.py +37 -0
- protein_fasta-0.3.0/src/protein_fasta/api.py +16 -0
- protein_fasta-0.3.0/src/protein_fasta/artifact_io.py +77 -0
- protein_fasta-0.3.0/src/protein_fasta/candidate_analysis.py +398 -0
- protein_fasta-0.3.0/src/protein_fasta/cli.py +1452 -0
- protein_fasta-0.3.0/src/protein_fasta/compile.py +43 -0
- protein_fasta-0.3.0/src/protein_fasta/database/__init__.py +0 -0
- protein_fasta-0.3.0/src/protein_fasta/database/collisions.py +47 -0
- protein_fasta-0.3.0/src/protein_fasta/database/decoy.py +106 -0
- protein_fasta-0.3.0/src/protein_fasta/database/decoy_generation.py +296 -0
- protein_fasta-0.3.0/src/protein_fasta/database/entrapment.py +103 -0
- protein_fasta-0.3.0/src/protein_fasta/database/entrapment_generation.py +440 -0
- protein_fasta-0.3.0/src/protein_fasta/database/metadata.py +58 -0
- protein_fasta-0.3.0/src/protein_fasta/database/models.py +69 -0
- protein_fasta-0.3.0/src/protein_fasta/database/naming.py +112 -0
- protein_fasta-0.3.0/src/protein_fasta/database_build.py +953 -0
- protein_fasta-0.3.0/src/protein_fasta/database_compile.py +71 -0
- protein_fasta-0.3.0/src/protein_fasta/decoy_compile.py +50 -0
- protein_fasta-0.3.0/src/protein_fasta/decoy_database.py +290 -0
- protein_fasta-0.3.0/src/protein_fasta/decoy_report.py +272 -0
- protein_fasta-0.3.0/src/protein_fasta/diagnostic_summary.py +71 -0
- protein_fasta-0.3.0/src/protein_fasta/diagnostics/__init__.py +0 -0
- protein_fasta-0.3.0/src/protein_fasta/diagnostics/messages.py +12 -0
- protein_fasta-0.3.0/src/protein_fasta/diagnostics/runtime.py +91 -0
- protein_fasta-0.3.0/src/protein_fasta/documents/_schema/candidate_effective.schema.json +44 -0
- protein_fasta-0.3.0/src/protein_fasta/documents/_schema/candidate_request.schema.json +44 -0
- protein_fasta-0.3.0/src/protein_fasta/documents/_schema/candidate_result.schema.json +259 -0
- protein_fasta-0.3.0/src/protein_fasta/documents/_schema/database_build_effective.schema.json +360 -0
- protein_fasta-0.3.0/src/protein_fasta/documents/_schema/database_build_profile.schema.json +166 -0
- protein_fasta-0.3.0/src/protein_fasta/documents/_schema/database_build_request.schema.json +381 -0
- protein_fasta-0.3.0/src/protein_fasta/documents/_schema/database_build_result.schema.json +715 -0
- protein_fasta-0.3.0/src/protein_fasta/documents/_schema/decoy_effective.schema.json +144 -0
- protein_fasta-0.3.0/src/protein_fasta/documents/_schema/decoy_report_effective.schema.json +151 -0
- protein_fasta-0.3.0/src/protein_fasta/documents/_schema/decoy_report_request.schema.json +150 -0
- protein_fasta-0.3.0/src/protein_fasta/documents/_schema/decoy_report_result.schema.json +261 -0
- protein_fasta-0.3.0/src/protein_fasta/documents/_schema/decoy_request.schema.json +144 -0
- protein_fasta-0.3.0/src/protein_fasta/documents/_schema/decoy_result.schema.json +466 -0
- protein_fasta-0.3.0/src/protein_fasta/documents/_schema/derived_protein_input_request.schema.json +59 -0
- protein_fasta-0.3.0/src/protein_fasta/documents/_schema/derived_protein_input_result.schema.json +249 -0
- protein_fasta-0.3.0/src/protein_fasta/documents/_schema/diagnostic.schema.json +59 -0
- protein_fasta-0.3.0/src/protein_fasta/documents/_schema/digestion.schema.json +32 -0
- protein_fasta-0.3.0/src/protein_fasta/documents/_schema/entry_classifier.schema.json +78 -0
- protein_fasta-0.3.0/src/protein_fasta/documents/_schema/enzyme.schema.json +34 -0
- protein_fasta-0.3.0/src/protein_fasta/documents/_schema/header_format.schema.json +138 -0
- protein_fasta-0.3.0/src/protein_fasta/documents/_schema/peptide_build_effective.schema.json +173 -0
- protein_fasta-0.3.0/src/protein_fasta/documents/_schema/peptide_build_request.schema.json +171 -0
- protein_fasta-0.3.0/src/protein_fasta/documents/_schema/peptide_build_result.schema.json +329 -0
- protein_fasta-0.3.0/src/protein_fasta/documents/_schema/peptide_comparison_effective.schema.json +22 -0
- protein_fasta-0.3.0/src/protein_fasta/documents/_schema/peptide_comparison_request.schema.json +22 -0
- protein_fasta-0.3.0/src/protein_fasta/documents/_schema/peptide_comparison_result.schema.json +120 -0
- protein_fasta-0.3.0/src/protein_fasta/documents/_schema/protein_input_request.schema.json +146 -0
- protein_fasta-0.3.0/src/protein_fasta/documents/_schema/protein_input_result.schema.json +311 -0
- protein_fasta-0.3.0/src/protein_fasta/documents/_schema/registry.schema.json +211 -0
- protein_fasta-0.3.0/src/protein_fasta/documents/_schema/registry_diagnostic.schema.json +119 -0
- protein_fasta-0.3.0/src/protein_fasta/documents/_schema/uniprot_catalog_request.schema.json +102 -0
- protein_fasta-0.3.0/src/protein_fasta/documents/_schema/uniprot_catalog_result.schema.json +225 -0
- protein_fasta-0.3.0/src/protein_fasta/documents/_schema/uniprot_download_request.schema.json +158 -0
- protein_fasta-0.3.0/src/protein_fasta/documents/_schema/uniprot_download_result.schema.json +368 -0
- protein_fasta-0.3.0/src/protein_fasta/documents/build_profiles/fgcz/profile.json +41 -0
- protein_fasta-0.3.0/src/protein_fasta/documents/diagnostics/rules.json +35 -0
- protein_fasta-0.3.0/src/protein_fasta/documents/entry_classifiers/rules.json +38 -0
- protein_fasta-0.3.0/src/protein_fasta/documents/enzymes/trypsin/rules.json +6 -0
- protein_fasta-0.3.0/src/protein_fasta/documents/frame_formats/refseq/rules.json +32 -0
- protein_fasta-0.3.0/src/protein_fasta/documents/frame_formats/uniprotkb/rules.json +76 -0
- protein_fasta-0.3.0/src/protein_fasta/documents/registry/fgcz.json +46 -0
- protein_fasta-0.3.0/src/protein_fasta/documents.py +217 -0
- protein_fasta-0.3.0/src/protein_fasta/frame.py +411 -0
- protein_fasta-0.3.0/src/protein_fasta/frame_compile.py +100 -0
- protein_fasta-0.3.0/src/protein_fasta/frame_formats/__init__.py +0 -0
- protein_fasta-0.3.0/src/protein_fasta/frame_formats/classification.py +66 -0
- protein_fasta-0.3.0/src/protein_fasta/frame_formats/detection.py +50 -0
- protein_fasta-0.3.0/src/protein_fasta/frame_formats/extraction.py +35 -0
- protein_fasta-0.3.0/src/protein_fasta/frame_formats/runtime.py +202 -0
- protein_fasta-0.3.0/src/protein_fasta/inventory.py +279 -0
- protein_fasta-0.3.0/src/protein_fasta/peptide/__init__.py +0 -0
- protein_fasta-0.3.0/src/protein_fasta/peptide/computation.py +178 -0
- protein_fasta-0.3.0/src/protein_fasta/peptide/executors.py +76 -0
- protein_fasta-0.3.0/src/protein_fasta/peptide/models.py +73 -0
- protein_fasta-0.3.0/src/protein_fasta/peptide_frame.py +43 -0
- protein_fasta-0.3.0/src/protein_fasta/peptide_workflow.py +564 -0
- protein_fasta-0.3.0/src/protein_fasta/protein_input.py +554 -0
- protein_fasta-0.3.0/src/protein_fasta/py.typed +1 -0
- protein_fasta-0.3.0/src/protein_fasta/reading/__init__.py +0 -0
- protein_fasta-0.3.0/src/protein_fasta/reading/header.py +22 -0
- protein_fasta-0.3.0/src/protein_fasta/reading/parser.py +118 -0
- protein_fasta-0.3.0/src/protein_fasta/reading/writer.py +27 -0
- protein_fasta-0.3.0/src/protein_fasta/record.py +63 -0
- protein_fasta-0.3.0/src/protein_fasta/registry/__init__.py +0 -0
- protein_fasta-0.3.0/src/protein_fasta/registry/backend/__init__.py +0 -0
- protein_fasta-0.3.0/src/protein_fasta/registry/backend/base.py +253 -0
- protein_fasta-0.3.0/src/protein_fasta/registry/backend/duckdb.py +487 -0
- protein_fasta-0.3.0/src/protein_fasta/registry/backend/factory.py +163 -0
- protein_fasta-0.3.0/src/protein_fasta/registry/backend/schema.py +200 -0
- protein_fasta-0.3.0/src/protein_fasta/registry/backend/sqlite.py +291 -0
- protein_fasta-0.3.0/src/protein_fasta/registry/classification.py +88 -0
- protein_fasta-0.3.0/src/protein_fasta/registry/clustering.py +287 -0
- protein_fasta-0.3.0/src/protein_fasta/registry/comparisons.py +765 -0
- protein_fasta-0.3.0/src/protein_fasta/registry/export.py +472 -0
- protein_fasta-0.3.0/src/protein_fasta/registry/filenames.py +77 -0
- protein_fasta-0.3.0/src/protein_fasta/registry/indexing.py +2425 -0
- protein_fasta-0.3.0/src/protein_fasta/registry/kinds.py +20 -0
- protein_fasta-0.3.0/src/protein_fasta/registry/metadata.py +52 -0
- protein_fasta-0.3.0/src/protein_fasta/registry/pair_metrics.py +163 -0
- protein_fasta-0.3.0/src/protein_fasta/registry/rules.py +83 -0
- protein_fasta-0.3.0/src/protein_fasta/registry/snapshots.py +103 -0
- protein_fasta-0.3.0/src/protein_fasta/registry_workflow.py +105 -0
- protein_fasta-0.3.0/src/protein_fasta/schema/__init__.py +0 -0
- protein_fasta-0.3.0/src/protein_fasta/schema/analytics.py +33 -0
- protein_fasta-0.3.0/src/protein_fasta/schema/artifacts.py +19 -0
- protein_fasta-0.3.0/src/protein_fasta/schema/base.py +9 -0
- protein_fasta-0.3.0/src/protein_fasta/schema/build.py +268 -0
- protein_fasta-0.3.0/src/protein_fasta/schema/candidate.py +67 -0
- protein_fasta-0.3.0/src/protein_fasta/schema/decoy.py +107 -0
- protein_fasta-0.3.0/src/protein_fasta/schema/decoy_report.py +56 -0
- protein_fasta-0.3.0/src/protein_fasta/schema/diagnostics.py +120 -0
- protein_fasta-0.3.0/src/protein_fasta/schema/frame_formats.py +103 -0
- protein_fasta-0.3.0/src/protein_fasta/schema/peptide.py +116 -0
- protein_fasta-0.3.0/src/protein_fasta/schema/protein_input.py +131 -0
- protein_fasta-0.3.0/src/protein_fasta/schema/registry.py +73 -0
- protein_fasta-0.3.0/src/protein_fasta/schema/uniprot.py +151 -0
- protein_fasta-0.3.0/src/protein_fasta/summary.py +143 -0
- protein_fasta-0.3.0/src/protein_fasta/uniprot/__init__.py +0 -0
- protein_fasta-0.3.0/src/protein_fasta/uniprot/acquisition.py +126 -0
- protein_fasta-0.3.0/src/protein_fasta/uniprot/models.py +76 -0
- protein_fasta-0.3.0/src/protein_fasta/uniprot/provider_rows.py +113 -0
- protein_fasta-0.3.0/src/protein_fasta/uniprot/queries.py +26 -0
- protein_fasta-0.3.0/src/protein_fasta/uniprot/resolution.py +60 -0
- protein_fasta-0.3.0/src/protein_fasta/uniprot/transport.py +181 -0
- protein_fasta-0.3.0/src/protein_fasta/uniprot_catalog.py +271 -0
- protein_fasta-0.3.0/src/protein_fasta/uniprot_download.py +239 -0
- protein_fasta-0.3.0/src/protein_fasta/validation/__init__.py +0 -0
- protein_fasta-0.3.0/src/protein_fasta/validation/sequence.py +25 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Witold Wolski
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
https://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, and
|
|
10
|
+
distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by the copyright
|
|
13
|
+
owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all other entities
|
|
16
|
+
that control, are controlled by, or are under common control with that entity.
|
|
17
|
+
For the purposes of this definition, "control" means (i) the power, direct or
|
|
18
|
+
indirect, to cause the direction or management of such entity, whether by
|
|
19
|
+
contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
20
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
21
|
+
|
|
22
|
+
"You" (or "Your") shall mean an individual or Legal Entity exercising
|
|
23
|
+
permissions granted by this License.
|
|
24
|
+
|
|
25
|
+
"Source" form shall mean the preferred form for making modifications, including
|
|
26
|
+
but not limited to software source code, documentation source, and configuration
|
|
27
|
+
files.
|
|
28
|
+
|
|
29
|
+
"Object" form shall mean any form resulting from mechanical transformation or
|
|
30
|
+
translation of a Source form, including but not limited to compiled object code,
|
|
31
|
+
generated documentation, and conversions to other media types.
|
|
32
|
+
|
|
33
|
+
"Work" shall mean the work of authorship, whether in Source or Object form, made
|
|
34
|
+
available under the License, as indicated by a copyright notice that is included
|
|
35
|
+
in or attached to the work.
|
|
36
|
+
|
|
37
|
+
"Derivative Works" shall mean any work, whether in Source or Object form, that
|
|
38
|
+
is based on (or derived from) the Work and for which the editorial revisions,
|
|
39
|
+
annotations, elaborations, or other modifications represent, as a whole, an
|
|
40
|
+
original work of authorship. For the purposes of this License, Derivative Works
|
|
41
|
+
shall not include works that remain separable from, or merely link (or bind by
|
|
42
|
+
name) to the interfaces of, the Work and Derivative Works thereof.
|
|
43
|
+
|
|
44
|
+
"Contribution" shall mean any work of authorship, including the original
|
|
45
|
+
version of the Work and any modifications or additions to that Work or
|
|
46
|
+
Derivative Works thereof, that is intentionally submitted to Licensor for
|
|
47
|
+
inclusion in the Work by the copyright owner or by an individual or Legal Entity
|
|
48
|
+
authorized to submit on behalf of the copyright owner. For the purposes of this
|
|
49
|
+
definition, "submitted" means any form of electronic, verbal, or written
|
|
50
|
+
communication sent to the Licensor or its representatives, including but not
|
|
51
|
+
limited to communication on electronic mailing lists, source code control
|
|
52
|
+
systems, and issue tracking systems that are managed by, or on behalf of, the
|
|
53
|
+
Licensor for the purpose of discussing and improving the Work, but excluding
|
|
54
|
+
communication that is conspicuously marked or otherwise designated in writing
|
|
55
|
+
by the copyright owner as "Not a Contribution."
|
|
56
|
+
|
|
57
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf
|
|
58
|
+
of whom a Contribution has been received by Licensor and subsequently
|
|
59
|
+
incorporated within the Work.
|
|
60
|
+
|
|
61
|
+
2. Grant of Copyright License. Subject to the terms and conditions of this
|
|
62
|
+
License, each Contributor hereby grants to You a perpetual, worldwide,
|
|
63
|
+
non-exclusive, no-charge, royalty-free, irrevocable copyright license to
|
|
64
|
+
reproduce, prepare Derivative Works of, publicly display, publicly perform,
|
|
65
|
+
sublicense, and distribute the Work and such Derivative Works in Source or
|
|
66
|
+
Object form.
|
|
67
|
+
|
|
68
|
+
3. Grant of Patent License. Subject to the terms and conditions of this License,
|
|
69
|
+
each Contributor hereby grants to You a perpetual, worldwide, non-exclusive,
|
|
70
|
+
no-charge, royalty-free, irrevocable (except as stated in this section) patent
|
|
71
|
+
license to make, have made, use, offer to sell, sell, import, and otherwise
|
|
72
|
+
transfer the Work, where such license applies only to those patent claims
|
|
73
|
+
licensable by such Contributor that are necessarily infringed by their
|
|
74
|
+
Contribution(s) alone or by combination of their Contribution(s) with the Work
|
|
75
|
+
to which such Contribution(s) was submitted. If You institute patent litigation
|
|
76
|
+
against any entity (including a cross-claim or counterclaim in a lawsuit)
|
|
77
|
+
alleging that the Work or a Contribution incorporated within the Work
|
|
78
|
+
constitutes direct or contributory patent infringement, then any patent licenses
|
|
79
|
+
granted to You under this License for that Work shall terminate as of the date
|
|
80
|
+
such litigation is filed.
|
|
81
|
+
|
|
82
|
+
4. Redistribution. You may reproduce and distribute copies of the Work or
|
|
83
|
+
Derivative Works thereof in any medium, with or without modifications, and in
|
|
84
|
+
Source or Object form, provided that You meet the following conditions:
|
|
85
|
+
|
|
86
|
+
(a) You must give any other recipients of the Work or Derivative Works a copy of
|
|
87
|
+
this License; and
|
|
88
|
+
|
|
89
|
+
(b) You must cause any modified files to carry prominent notices stating that
|
|
90
|
+
You changed the files; and
|
|
91
|
+
|
|
92
|
+
(c) You must retain, in the Source form of any Derivative Works that You
|
|
93
|
+
distribute, all copyright, patent, trademark, and attribution notices from the
|
|
94
|
+
Source form of the Work, excluding those notices that do not pertain to any part
|
|
95
|
+
of the Derivative Works; and
|
|
96
|
+
|
|
97
|
+
(d) If the Work includes a "NOTICE" text file as part of its distribution, then
|
|
98
|
+
any Derivative Works that You distribute must include a readable copy of the
|
|
99
|
+
attribution notices contained within such NOTICE file, excluding those notices
|
|
100
|
+
that do not pertain to any part of the Derivative Works, in at least one of the
|
|
101
|
+
following places: within a NOTICE text file distributed as part of the
|
|
102
|
+
Derivative Works; within the Source form or documentation, if provided along
|
|
103
|
+
with the Derivative Works; or, within a display generated by the Derivative
|
|
104
|
+
Works, if and wherever such third-party notices normally appear. The contents of
|
|
105
|
+
the NOTICE file are for informational purposes only and do not modify the
|
|
106
|
+
License. You may add Your own attribution notices within Derivative Works that
|
|
107
|
+
You distribute, alongside or as an addendum to the NOTICE text from the Work,
|
|
108
|
+
provided that such additional attribution notices cannot be construed as
|
|
109
|
+
modifying the License.
|
|
110
|
+
|
|
111
|
+
You may add Your own copyright statement to Your modifications and may provide
|
|
112
|
+
additional or different license terms and conditions for use, reproduction, or
|
|
113
|
+
distribution of Your modifications, or for any such Derivative Works as a whole,
|
|
114
|
+
provided Your use, reproduction, and distribution of the Work otherwise
|
|
115
|
+
complies with the conditions stated in this License.
|
|
116
|
+
|
|
117
|
+
5. Submission of Contributions. Unless You explicitly state otherwise, any
|
|
118
|
+
Contribution intentionally submitted for inclusion in the Work by You to the
|
|
119
|
+
Licensor shall be under the terms and conditions of this License, without any
|
|
120
|
+
additional terms or conditions. Notwithstanding the above, nothing herein shall
|
|
121
|
+
supersede or modify the terms of any separate license agreement you may have
|
|
122
|
+
executed with Licensor regarding such Contributions.
|
|
123
|
+
|
|
124
|
+
6. Trademarks. This License does not grant permission to use the trade names,
|
|
125
|
+
trademarks, service marks, or product names of the Licensor, except as required
|
|
126
|
+
for reasonable and customary use in describing the origin of the Work and
|
|
127
|
+
reproducing the content of the NOTICE file.
|
|
128
|
+
|
|
129
|
+
7. Disclaimer of Warranty. Unless required by applicable law or agreed to in
|
|
130
|
+
writing, Licensor provides the Work (and each Contributor provides its
|
|
131
|
+
Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
132
|
+
KIND, either express or implied, including, without limitation, any warranties
|
|
133
|
+
or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
134
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
135
|
+
appropriateness of using or redistributing the Work and assume any risks
|
|
136
|
+
associated with Your exercise of permissions under this License.
|
|
137
|
+
|
|
138
|
+
8. Limitation of Liability. In no event and under no legal theory, whether in
|
|
139
|
+
tort (including negligence), contract, or otherwise, unless required by
|
|
140
|
+
applicable law (such as deliberate and grossly negligent acts) or agreed to in
|
|
141
|
+
writing, shall any Contributor be liable to You for damages, including any
|
|
142
|
+
direct, indirect, special, incidental, or consequential damages of any character
|
|
143
|
+
arising as a result of this License or out of the use or inability to use the
|
|
144
|
+
Work (including but not limited to damages for loss of goodwill, work stoppage,
|
|
145
|
+
computer failure or malfunction, or any and all other commercial damages or
|
|
146
|
+
losses), even if such Contributor has been advised of the possibility of such
|
|
147
|
+
damages.
|
|
148
|
+
|
|
149
|
+
9. Accepting Warranty or Additional Liability. While redistributing the Work or
|
|
150
|
+
Derivative Works thereof, You may choose to offer, and charge a fee for,
|
|
151
|
+
acceptance of support, warranty, indemnity, or other liability obligations
|
|
152
|
+
and/or rights consistent with this License. However, in accepting such
|
|
153
|
+
obligations, You may act only on Your own behalf and on Your sole responsibility,
|
|
154
|
+
not on behalf of any other Contributor, and only if You agree to indemnify,
|
|
155
|
+
defend, and hold each Contributor harmless for any liability incurred by, or
|
|
156
|
+
claims asserted against, such Contributor by reason of your accepting any such
|
|
157
|
+
warranty or additional liability.
|
|
158
|
+
|
|
159
|
+
END OF TERMS AND CONDITIONS
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
BSD 3-Clause License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 1999-2024, The Biopython Contributors
|
|
4
|
+
All rights reserved.
|
|
5
|
+
|
|
6
|
+
Redistribution and use in source and binary forms, with or without
|
|
7
|
+
modification, are permitted provided that the following conditions are met:
|
|
8
|
+
|
|
9
|
+
1. Redistributions of source code must retain the above copyright notice,
|
|
10
|
+
this list of conditions and the following disclaimer.
|
|
11
|
+
|
|
12
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
13
|
+
this list of conditions and the following disclaimer in the documentation
|
|
14
|
+
and/or other materials provided with the distribution.
|
|
15
|
+
|
|
16
|
+
3. Neither the name of the copyright holder nor the names of its contributors
|
|
17
|
+
may be used to endorse or promote products derived from this software
|
|
18
|
+
without specific prior written permission.
|
|
19
|
+
|
|
20
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
21
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
22
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
23
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
24
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
25
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
26
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
27
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
28
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
29
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
Protein FASTA
|
|
2
|
+
Copyright 2026 Witold Wolski
|
|
3
|
+
|
|
4
|
+
This product includes modified source-derived behavior from FDR Benchmark,
|
|
5
|
+
Copyright 2026 Functional Genomics Center Zurich, revision
|
|
6
|
+
bbf582e382833cf8bdc439e69edb287842293b02, under the Apache License 2.0.
|
|
7
|
+
|
|
8
|
+
FDR Benchmark in turn records the following attributions:
|
|
9
|
+
|
|
10
|
+
- PGATK, https://github.com/bigbio/pgatk, reviewed revision cdedf9057e7e.
|
|
11
|
+
Its DecoyPYrat reverse/switch and collision workflow informed the decoy
|
|
12
|
+
generation implementation.
|
|
13
|
+
- FDRBench, https://github.com/Noble-Lab/FDRBench, reviewed revision
|
|
14
|
+
5deac96dfa0e. Its entrapment-generation behavior informed the entrapment
|
|
15
|
+
generation implementation.
|
|
16
|
+
|
|
17
|
+
The original projects and associated publications retain their respective
|
|
18
|
+
copyrights and attribution. See LICENSES/Apache-2.0.txt for the applicable
|
|
19
|
+
third-party license.
|
|
20
|
+
|
|
21
|
+
The dipeptide instability weight values in
|
|
22
|
+
src/protein_fasta/analytics/peptide_properties.py are taken from Biopython
|
|
23
|
+
1.86, Bio/SeqUtils/ProtParamData.py, Copyright (c) 1999-2024 The Biopython
|
|
24
|
+
Contributors, under the BSD 3-Clause License (two entries changed to the
|
|
25
|
+
values of the R package Peptides). See LICENSES/BSD-3-Clause-Biopython.txt.
|
|
26
|
+
|
|
27
|
+
The reversed-phase retention coefficients and length-corrected retention
|
|
28
|
+
model in the same file are taken from Pyteomics 4.7.5, pyteomics/achrom.py
|
|
29
|
+
(RCs_zubarev, calculate_RT), under the Apache License 2.0; see
|
|
30
|
+
LICENSES/Apache-2.0.txt. Pyteomics: Goloborodko et al., J Am Soc Mass Spectrom
|
|
31
|
+
2013, 24(2):301-304; Levitsky et al., J Proteome Res 2019, 18(2):709-714. The
|
|
32
|
+
coefficients: Goloborodko et al., Rapid Commun Mass Spectrom 2010,
|
|
33
|
+
24(4):454-462.
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: protein-fasta
|
|
3
|
+
Version: 0.3.0
|
|
4
|
+
Summary: Streaming protein records and config-driven Polars FASTA frames.
|
|
5
|
+
Keywords: proteomics,fasta,protein database,uniprot,polars
|
|
6
|
+
Author: Witold Wolski
|
|
7
|
+
Author-email: Witold Wolski <wew@fgcz.ethz.ch>
|
|
8
|
+
License-Expression: MIT
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
License-File: LICENSES/Apache-2.0.txt
|
|
11
|
+
License-File: LICENSES/BSD-3-Clause-Biopython.txt
|
|
12
|
+
License-File: NOTICE
|
|
13
|
+
Classifier: Development Status :: 3 - Alpha
|
|
14
|
+
Classifier: Intended Audience :: Science/Research
|
|
15
|
+
Classifier: Operating System :: OS Independent
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
18
|
+
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
|
|
19
|
+
Classifier: Typing :: Typed
|
|
20
|
+
Requires-Dist: loguru>=0.7,<1
|
|
21
|
+
Requires-Dist: pydantic>=2.13,<3
|
|
22
|
+
Requires-Dist: cyclopts>=4.20,<5 ; extra == 'cli'
|
|
23
|
+
Requires-Dist: httpx>=0.28,<1 ; extra == 'cli'
|
|
24
|
+
Requires-Dist: loguru>=0.7,<1 ; extra == 'cli'
|
|
25
|
+
Requires-Dist: polars>=1.43.2,<2 ; extra == 'cli'
|
|
26
|
+
Requires-Dist: xlsxwriter>=3.2,<4 ; extra == 'cli'
|
|
27
|
+
Requires-Dist: duckdb>=1.4.2,<2 ; extra == 'duckdb'
|
|
28
|
+
Requires-Dist: polars>=1.43.2,<2 ; extra == 'duckdb'
|
|
29
|
+
Requires-Dist: pyarrow>=22 ; extra == 'duckdb'
|
|
30
|
+
Requires-Dist: polars>=1.43.2,<2 ; extra == 'frame'
|
|
31
|
+
Requires-Dist: httpx>=0.28,<1 ; extra == 'uniprot'
|
|
32
|
+
Requires-Dist: polars>=1.43.2,<2 ; extra == 'uniprot'
|
|
33
|
+
Requires-Python: >=3.13
|
|
34
|
+
Project-URL: Documentation, https://anndata-omics-bridge.github.io/protein-fasta/
|
|
35
|
+
Project-URL: Repository, https://github.com/anndata-omics-bridge/protein-fasta
|
|
36
|
+
Provides-Extra: cli
|
|
37
|
+
Provides-Extra: duckdb
|
|
38
|
+
Provides-Extra: frame
|
|
39
|
+
Provides-Extra: uniprot
|
|
40
|
+
Description-Content-Type: text/markdown
|
|
41
|
+
|
|
42
|
+
# Protein FASTA
|
|
43
|
+
|
|
44
|
+
`protein-fasta` provides one shared protein-FASTA boundary with deliberately granular APIs:
|
|
45
|
+
|
|
46
|
+
- a constant-memory Python iterator returning minimal normalized records; and
|
|
47
|
+
- an optional Polars frame reader that enriches homogeneous UniProtKB or RefSeq files from
|
|
48
|
+
Pydantic-validated JSON rules;
|
|
49
|
+
- backend-free hashing, digestion, comparison, and clustering analytics;
|
|
50
|
+
- reproducible source preparation, biological construction, and subsequent decoy generation;
|
|
51
|
+
- canonical peptide construction and comparison with memory, SQLite, or DuckDB execution;
|
|
52
|
+
- reproducible UniProt proteome catalogs and FASTA acquisition;
|
|
53
|
+
- SQLite or optional DuckDB indexing with materialized pair metrics; and
|
|
54
|
+
- a short, single-word Cyclopts command surface for each reproducible operation.
|
|
55
|
+
|
|
56
|
+
**[Online documentation](https://anndata-omics-bridge.github.io/protein-fasta/)**
|
|
57
|
+
|
|
58
|
+
The stable high-level Python record is exactly `id`, optional `description`, and normalized
|
|
59
|
+
`sequence`:
|
|
60
|
+
|
|
61
|
+
```python
|
|
62
|
+
from pathlib import Path
|
|
63
|
+
|
|
64
|
+
from protein_fasta.record import iter_proteins
|
|
65
|
+
|
|
66
|
+
for protein in iter_proteins(Path("proteins.fasta.gz")):
|
|
67
|
+
print(protein.id, protein.sequence)
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Normalization removes FASTA formatting whitespace, upper-cases the sequence, and removes exactly
|
|
71
|
+
one terminal `*`. Callers needing source text use the separately named lower-level
|
|
72
|
+
`read_records()` or header-only `read_headers()` operations; raw headers are never reconstructed
|
|
73
|
+
from normalized fields.
|
|
74
|
+
|
|
75
|
+
## Configured diagnostics
|
|
76
|
+
|
|
77
|
+
`ProteinDiagnostics` composes one `ProteinRecord` with the raw header, identifier namespace,
|
|
78
|
+
independent classification labels, normalization changes, and illegal residues:
|
|
79
|
+
|
|
80
|
+
```python
|
|
81
|
+
from pathlib import Path
|
|
82
|
+
|
|
83
|
+
from protein_fasta.compile import make_diagnostic_rules
|
|
84
|
+
from protein_fasta.documents import (
|
|
85
|
+
load_builtin_diagnostic_document,
|
|
86
|
+
load_builtin_entry_classifier_document,
|
|
87
|
+
)
|
|
88
|
+
from protein_fasta.record import iter_protein_diagnostics
|
|
89
|
+
|
|
90
|
+
rules = make_diagnostic_rules(
|
|
91
|
+
load_builtin_diagnostic_document(),
|
|
92
|
+
load_builtin_entry_classifier_document(),
|
|
93
|
+
)
|
|
94
|
+
diagnostics = iter_protein_diagnostics(Path("proteins.fasta"), rules)
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
Classifications overlap: a decoy contaminant can report both labels. Configured decorations are
|
|
98
|
+
peeled only from a temporary identifier used for diagnostics and database parsing; the public
|
|
99
|
+
record ID remains unchanged. The packaged classifier document contains only format-independent
|
|
100
|
+
decorations; application-specific marker conventions belong in an explicit classifier document
|
|
101
|
+
supplied to the configured APIs.
|
|
102
|
+
|
|
103
|
+
For a database-level report, stream those records into the aggregate API:
|
|
104
|
+
|
|
105
|
+
```python
|
|
106
|
+
from protein_fasta.diagnostic_summary import summarize_protein_diagnostics
|
|
107
|
+
|
|
108
|
+
summary = summarize_protein_diagnostics(diagnostics)
|
|
109
|
+
print(summary.namespace_counts, summary.classification_counts)
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
## Polars frames
|
|
113
|
+
|
|
114
|
+
Install `protein-fasta[frame]`. Applications that need one configured database frame select the
|
|
115
|
+
accepted public formats when constructing `ProteinDatabase`, then supply the ordered FASTA paths to
|
|
116
|
+
`parse()`:
|
|
117
|
+
|
|
118
|
+
```python
|
|
119
|
+
from pathlib import Path
|
|
120
|
+
|
|
121
|
+
from protein_fasta.api import ProteinDatabase, refseq, uniprotkb
|
|
122
|
+
|
|
123
|
+
protein_database = ProteinDatabase(uniprotkb, refseq)
|
|
124
|
+
proteins = protein_database.parse(
|
|
125
|
+
(Path("human.fasta"), Path("contaminants.fasta")),
|
|
126
|
+
)
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
The result is one row-wise enriched Polars frame. It includes `id`, `description`, `sequence`, the
|
|
130
|
+
columns selected by the format profiles, classifier columns, and stable path/checksum/source/record
|
|
131
|
+
provenance. Document loading and parser compilation remain private to `protein_fasta`.
|
|
132
|
+
|
|
133
|
+
Lower-level callers may choose the exact base table or automatic row-wise enrichment:
|
|
134
|
+
|
|
135
|
+
```python
|
|
136
|
+
from pathlib import Path
|
|
137
|
+
|
|
138
|
+
from protein_fasta.frame import read_basic_protein_frame, read_protein_frame
|
|
139
|
+
|
|
140
|
+
base = read_basic_protein_frame(Path("mixed.fasta"))
|
|
141
|
+
best = read_protein_frame(Path("uniprot.fasta"))
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
`read_basic_protein_frame()` always returns exactly `id`, `description`, and `sequence`.
|
|
145
|
+
`read_protein_frame()` applies the sole matching built-in parser to each row. Unmatched or ambiguous
|
|
146
|
+
rows retain their base values and receive null parser fields. `read_strict_protein_frame()` requires
|
|
147
|
+
one format to match every row and otherwise returns the exact base schema. Built-in database rules
|
|
148
|
+
live in one JSON document per database.
|
|
149
|
+
|
|
150
|
+
## Table-export CLI
|
|
151
|
+
|
|
152
|
+
Install the CLI extra and select CSV, TSV, XLSX, or Parquet through the output suffix:
|
|
153
|
+
|
|
154
|
+
```bash
|
|
155
|
+
pip install 'protein-fasta[cli]'
|
|
156
|
+
protein-fasta table database.fasta proteins.xlsx --no-sequence
|
|
157
|
+
protein-fasta table database.fasta proteins-with-hashes.csv --checksums
|
|
158
|
+
protein-fasta table database.fasta proteins.csv --strict
|
|
159
|
+
protein-fasta basic database.fasta proteins.csv
|
|
160
|
+
protein-fasta formats database.fasta formats.csv
|
|
161
|
+
protein-fasta diagnostics database.fasta
|
|
162
|
+
protein-fasta digest database.fasta peptides.parquet
|
|
163
|
+
protein-fasta checksum database.fasta
|
|
164
|
+
protein-fasta uniprot-download UP000000589 opg
|
|
165
|
+
protein-fasta prepare human.fasta protein-input.parquet --id human-uniprot
|
|
166
|
+
protein-fasta build protein-input.parquet \
|
|
167
|
+
--output build --project 42261 --dbn 1 --description human
|
|
168
|
+
protein-fasta decoy biological.fasta.protein-inventory.parquet \
|
|
169
|
+
--output search.fasta --method reverse
|
|
170
|
+
protein-fasta peptides search-inventory.parquet --output peptide-products
|
|
171
|
+
protein-fasta prepare --request protein-input.parquet.request.json \
|
|
172
|
+
--output replayed-protein-input.parquet
|
|
173
|
+
protein-fasta index databases registry.sqlite3
|
|
174
|
+
protein-fasta index-inventory search-inventory.parquet registry.duckdb --config registry.json
|
|
175
|
+
protein-fasta registry registry.sqlite3 databases.csv
|
|
176
|
+
protein-fasta compare registry.sqlite3 12 comparison.csv
|
|
177
|
+
protein-fasta pairs registry.sqlite3 pairs.tsv
|
|
178
|
+
protein-fasta cluster registry.sqlite3 clustering.csv
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
Direct workflow commands write their validated authored `*.request.json` before computation.
|
|
182
|
+
Replay one explicitly with `--request`; authored requests, resolved `*.effective.json`, observed
|
|
183
|
+
`*.result.json`, and data artifacts remain separate.
|
|
184
|
+
|
|
185
|
+
The CLI also exposes aggregate diagnostics, theoretical digestion, checksums, database builds,
|
|
186
|
+
registry indexing, database comparisons, materialized pair exports, and clustering. See the
|
|
187
|
+
[build workflows](https://anndata-omics-bridge.github.io/protein-fasta/workflows/),
|
|
188
|
+
[CLI guide and executable walkthrough](https://anndata-omics-bridge.github.io/protein-fasta/cli_walkthrough/),
|
|
189
|
+
[API reference](https://anndata-omics-bridge.github.io/protein-fasta/api/), and maintained
|
|
190
|
+
[architecture](https://anndata-omics-bridge.github.io/protein-fasta/architecture/).
|
|
191
|
+
|
|
192
|
+
The package excludes site-specific curated contaminant/QC catalogs, GUI installation workflows,
|
|
193
|
+
protein inference, and AnnData/MuData persistence. Those consumers compose the typed artifacts and
|
|
194
|
+
APIs without owning FASTA, decoy, peptide, UniProt, or registry computation.
|
|
195
|
+
|
|
196
|
+
## Development
|
|
197
|
+
|
|
198
|
+
```bash
|
|
199
|
+
uv sync --group dev --extra cli --extra frame --extra duckdb
|
|
200
|
+
make check
|
|
201
|
+
make docs
|
|
202
|
+
```
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
# Protein FASTA
|
|
2
|
+
|
|
3
|
+
`protein-fasta` provides one shared protein-FASTA boundary with deliberately granular APIs:
|
|
4
|
+
|
|
5
|
+
- a constant-memory Python iterator returning minimal normalized records; and
|
|
6
|
+
- an optional Polars frame reader that enriches homogeneous UniProtKB or RefSeq files from
|
|
7
|
+
Pydantic-validated JSON rules;
|
|
8
|
+
- backend-free hashing, digestion, comparison, and clustering analytics;
|
|
9
|
+
- reproducible source preparation, biological construction, and subsequent decoy generation;
|
|
10
|
+
- canonical peptide construction and comparison with memory, SQLite, or DuckDB execution;
|
|
11
|
+
- reproducible UniProt proteome catalogs and FASTA acquisition;
|
|
12
|
+
- SQLite or optional DuckDB indexing with materialized pair metrics; and
|
|
13
|
+
- a short, single-word Cyclopts command surface for each reproducible operation.
|
|
14
|
+
|
|
15
|
+
**[Online documentation](https://anndata-omics-bridge.github.io/protein-fasta/)**
|
|
16
|
+
|
|
17
|
+
The stable high-level Python record is exactly `id`, optional `description`, and normalized
|
|
18
|
+
`sequence`:
|
|
19
|
+
|
|
20
|
+
```python
|
|
21
|
+
from pathlib import Path
|
|
22
|
+
|
|
23
|
+
from protein_fasta.record import iter_proteins
|
|
24
|
+
|
|
25
|
+
for protein in iter_proteins(Path("proteins.fasta.gz")):
|
|
26
|
+
print(protein.id, protein.sequence)
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Normalization removes FASTA formatting whitespace, upper-cases the sequence, and removes exactly
|
|
30
|
+
one terminal `*`. Callers needing source text use the separately named lower-level
|
|
31
|
+
`read_records()` or header-only `read_headers()` operations; raw headers are never reconstructed
|
|
32
|
+
from normalized fields.
|
|
33
|
+
|
|
34
|
+
## Configured diagnostics
|
|
35
|
+
|
|
36
|
+
`ProteinDiagnostics` composes one `ProteinRecord` with the raw header, identifier namespace,
|
|
37
|
+
independent classification labels, normalization changes, and illegal residues:
|
|
38
|
+
|
|
39
|
+
```python
|
|
40
|
+
from pathlib import Path
|
|
41
|
+
|
|
42
|
+
from protein_fasta.compile import make_diagnostic_rules
|
|
43
|
+
from protein_fasta.documents import (
|
|
44
|
+
load_builtin_diagnostic_document,
|
|
45
|
+
load_builtin_entry_classifier_document,
|
|
46
|
+
)
|
|
47
|
+
from protein_fasta.record import iter_protein_diagnostics
|
|
48
|
+
|
|
49
|
+
rules = make_diagnostic_rules(
|
|
50
|
+
load_builtin_diagnostic_document(),
|
|
51
|
+
load_builtin_entry_classifier_document(),
|
|
52
|
+
)
|
|
53
|
+
diagnostics = iter_protein_diagnostics(Path("proteins.fasta"), rules)
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Classifications overlap: a decoy contaminant can report both labels. Configured decorations are
|
|
57
|
+
peeled only from a temporary identifier used for diagnostics and database parsing; the public
|
|
58
|
+
record ID remains unchanged. The packaged classifier document contains only format-independent
|
|
59
|
+
decorations; application-specific marker conventions belong in an explicit classifier document
|
|
60
|
+
supplied to the configured APIs.
|
|
61
|
+
|
|
62
|
+
For a database-level report, stream those records into the aggregate API:
|
|
63
|
+
|
|
64
|
+
```python
|
|
65
|
+
from protein_fasta.diagnostic_summary import summarize_protein_diagnostics
|
|
66
|
+
|
|
67
|
+
summary = summarize_protein_diagnostics(diagnostics)
|
|
68
|
+
print(summary.namespace_counts, summary.classification_counts)
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Polars frames
|
|
72
|
+
|
|
73
|
+
Install `protein-fasta[frame]`. Applications that need one configured database frame select the
|
|
74
|
+
accepted public formats when constructing `ProteinDatabase`, then supply the ordered FASTA paths to
|
|
75
|
+
`parse()`:
|
|
76
|
+
|
|
77
|
+
```python
|
|
78
|
+
from pathlib import Path
|
|
79
|
+
|
|
80
|
+
from protein_fasta.api import ProteinDatabase, refseq, uniprotkb
|
|
81
|
+
|
|
82
|
+
protein_database = ProteinDatabase(uniprotkb, refseq)
|
|
83
|
+
proteins = protein_database.parse(
|
|
84
|
+
(Path("human.fasta"), Path("contaminants.fasta")),
|
|
85
|
+
)
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
The result is one row-wise enriched Polars frame. It includes `id`, `description`, `sequence`, the
|
|
89
|
+
columns selected by the format profiles, classifier columns, and stable path/checksum/source/record
|
|
90
|
+
provenance. Document loading and parser compilation remain private to `protein_fasta`.
|
|
91
|
+
|
|
92
|
+
Lower-level callers may choose the exact base table or automatic row-wise enrichment:
|
|
93
|
+
|
|
94
|
+
```python
|
|
95
|
+
from pathlib import Path
|
|
96
|
+
|
|
97
|
+
from protein_fasta.frame import read_basic_protein_frame, read_protein_frame
|
|
98
|
+
|
|
99
|
+
base = read_basic_protein_frame(Path("mixed.fasta"))
|
|
100
|
+
best = read_protein_frame(Path("uniprot.fasta"))
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
`read_basic_protein_frame()` always returns exactly `id`, `description`, and `sequence`.
|
|
104
|
+
`read_protein_frame()` applies the sole matching built-in parser to each row. Unmatched or ambiguous
|
|
105
|
+
rows retain their base values and receive null parser fields. `read_strict_protein_frame()` requires
|
|
106
|
+
one format to match every row and otherwise returns the exact base schema. Built-in database rules
|
|
107
|
+
live in one JSON document per database.
|
|
108
|
+
|
|
109
|
+
## Table-export CLI
|
|
110
|
+
|
|
111
|
+
Install the CLI extra and select CSV, TSV, XLSX, or Parquet through the output suffix:
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
pip install 'protein-fasta[cli]'
|
|
115
|
+
protein-fasta table database.fasta proteins.xlsx --no-sequence
|
|
116
|
+
protein-fasta table database.fasta proteins-with-hashes.csv --checksums
|
|
117
|
+
protein-fasta table database.fasta proteins.csv --strict
|
|
118
|
+
protein-fasta basic database.fasta proteins.csv
|
|
119
|
+
protein-fasta formats database.fasta formats.csv
|
|
120
|
+
protein-fasta diagnostics database.fasta
|
|
121
|
+
protein-fasta digest database.fasta peptides.parquet
|
|
122
|
+
protein-fasta checksum database.fasta
|
|
123
|
+
protein-fasta uniprot-download UP000000589 opg
|
|
124
|
+
protein-fasta prepare human.fasta protein-input.parquet --id human-uniprot
|
|
125
|
+
protein-fasta build protein-input.parquet \
|
|
126
|
+
--output build --project 42261 --dbn 1 --description human
|
|
127
|
+
protein-fasta decoy biological.fasta.protein-inventory.parquet \
|
|
128
|
+
--output search.fasta --method reverse
|
|
129
|
+
protein-fasta peptides search-inventory.parquet --output peptide-products
|
|
130
|
+
protein-fasta prepare --request protein-input.parquet.request.json \
|
|
131
|
+
--output replayed-protein-input.parquet
|
|
132
|
+
protein-fasta index databases registry.sqlite3
|
|
133
|
+
protein-fasta index-inventory search-inventory.parquet registry.duckdb --config registry.json
|
|
134
|
+
protein-fasta registry registry.sqlite3 databases.csv
|
|
135
|
+
protein-fasta compare registry.sqlite3 12 comparison.csv
|
|
136
|
+
protein-fasta pairs registry.sqlite3 pairs.tsv
|
|
137
|
+
protein-fasta cluster registry.sqlite3 clustering.csv
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
Direct workflow commands write their validated authored `*.request.json` before computation.
|
|
141
|
+
Replay one explicitly with `--request`; authored requests, resolved `*.effective.json`, observed
|
|
142
|
+
`*.result.json`, and data artifacts remain separate.
|
|
143
|
+
|
|
144
|
+
The CLI also exposes aggregate diagnostics, theoretical digestion, checksums, database builds,
|
|
145
|
+
registry indexing, database comparisons, materialized pair exports, and clustering. See the
|
|
146
|
+
[build workflows](https://anndata-omics-bridge.github.io/protein-fasta/workflows/),
|
|
147
|
+
[CLI guide and executable walkthrough](https://anndata-omics-bridge.github.io/protein-fasta/cli_walkthrough/),
|
|
148
|
+
[API reference](https://anndata-omics-bridge.github.io/protein-fasta/api/), and maintained
|
|
149
|
+
[architecture](https://anndata-omics-bridge.github.io/protein-fasta/architecture/).
|
|
150
|
+
|
|
151
|
+
The package excludes site-specific curated contaminant/QC catalogs, GUI installation workflows,
|
|
152
|
+
protein inference, and AnnData/MuData persistence. Those consumers compose the typed artifacts and
|
|
153
|
+
APIs without owning FASTA, decoy, peptide, UniProt, or registry computation.
|
|
154
|
+
|
|
155
|
+
## Development
|
|
156
|
+
|
|
157
|
+
```bash
|
|
158
|
+
uv sync --group dev --extra cli --extra frame --extra duckdb
|
|
159
|
+
make check
|
|
160
|
+
make docs
|
|
161
|
+
```
|