ngs-agent 0.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (113) hide show
  1. ngs_agent-0.2.0/.github/workflows/publish.yml +29 -0
  2. ngs_agent-0.2.0/.github/workflows/pylint.yml +23 -0
  3. ngs_agent-0.2.0/.github/workflows/test.yml +39 -0
  4. ngs_agent-0.2.0/.gitignore +42 -0
  5. ngs_agent-0.2.0/LICENSE +201 -0
  6. ngs_agent-0.2.0/PKG-INFO +290 -0
  7. ngs_agent-0.2.0/README.md +239 -0
  8. ngs_agent-0.2.0/agents/ai_decider/Dockerfile +13 -0
  9. ngs_agent-0.2.0/agents/ai_decider/main.py +173 -0
  10. ngs_agent-0.2.0/agents/align/Dockerfile +15 -0
  11. ngs_agent-0.2.0/agents/align/main.py +218 -0
  12. ngs_agent-0.2.0/agents/annotation_agent/Dockerfile +17 -0
  13. ngs_agent-0.2.0/agents/annotation_agent/main.py +139 -0
  14. ngs_agent-0.2.0/agents/base/Dockerfile +14 -0
  15. ngs_agent-0.2.0/agents/base/base_agent.py +14 -0
  16. ngs_agent-0.2.0/agents/bwa_agent/Dockerfile +15 -0
  17. ngs_agent-0.2.0/agents/bwa_agent/main.py +143 -0
  18. ngs_agent-0.2.0/agents/count/Dockerfile +15 -0
  19. ngs_agent-0.2.0/agents/count/main.py +73 -0
  20. ngs_agent-0.2.0/agents/coverage_agent/Dockerfile +14 -0
  21. ngs_agent-0.2.0/agents/coverage_agent/main.py +72 -0
  22. ngs_agent-0.2.0/agents/de/Dockerfile +14 -0
  23. ngs_agent-0.2.0/agents/de/main.py +68 -0
  24. ngs_agent-0.2.0/agents/de_agent/Dockerfile +29 -0
  25. ngs_agent-0.2.0/agents/de_agent/de_analysis.R +127 -0
  26. ngs_agent-0.2.0/agents/de_agent/main.py +59 -0
  27. ngs_agent-0.2.0/agents/gatk_agent/Dockerfile +22 -0
  28. ngs_agent-0.2.0/agents/gatk_agent/main.py +99 -0
  29. ngs_agent-0.2.0/agents/ingest/Dockerfile +14 -0
  30. ngs_agent-0.2.0/agents/ingest/main.py +110 -0
  31. ngs_agent-0.2.0/agents/insight_agent/Dockerfile +27 -0
  32. ngs_agent-0.2.0/agents/insight_agent/go_analysis.R +50 -0
  33. ngs_agent-0.2.0/agents/insight_agent/main.py +131 -0
  34. ngs_agent-0.2.0/agents/qc/Dockerfile +15 -0
  35. ngs_agent-0.2.0/agents/qc/main.py +455 -0
  36. ngs_agent-0.2.0/agents/report_agent/Dockerfile +12 -0
  37. ngs_agent-0.2.0/agents/report_agent/main.py +85 -0
  38. ngs_agent-0.2.0/agents/report_builder/Dockerfile +16 -0
  39. ngs_agent-0.2.0/agents/report_builder/main.py +75 -0
  40. ngs_agent-0.2.0/agents/trim/Dockerfile +15 -0
  41. ngs_agent-0.2.0/agents/trim/main.py +122 -0
  42. ngs_agent-0.2.0/demo_data/sample.log +7 -0
  43. ngs_agent-0.2.0/demo_data/sample.vcf +16 -0
  44. ngs_agent-0.2.0/ngs_agent/__init__.py +3 -0
  45. ngs_agent-0.2.0/ngs_agent/acmg.py +229 -0
  46. ngs_agent-0.2.0/ngs_agent/analyzer.py +221 -0
  47. ngs_agent-0.2.0/ngs_agent/backends/__init__.py +6 -0
  48. ngs_agent-0.2.0/ngs_agent/backends/anthropic.py +30 -0
  49. ngs_agent-0.2.0/ngs_agent/backends/base.py +24 -0
  50. ngs_agent-0.2.0/ngs_agent/backends/factory.py +80 -0
  51. ngs_agent-0.2.0/ngs_agent/backends/gemini.py +61 -0
  52. ngs_agent-0.2.0/ngs_agent/backends/ollama.py +38 -0
  53. ngs_agent-0.2.0/ngs_agent/backends/openai_compat.py +114 -0
  54. ngs_agent-0.2.0/ngs_agent/cli.py +212 -0
  55. ngs_agent-0.2.0/ngs_agent/common.py +85 -0
  56. ngs_agent-0.2.0/ngs_agent/config.py +156 -0
  57. ngs_agent-0.2.0/ngs_agent/debate.py +209 -0
  58. ngs_agent-0.2.0/ngs_agent/doctor.py +98 -0
  59. ngs_agent-0.2.0/ngs_agent/health.py +128 -0
  60. ngs_agent-0.2.0/ngs_agent/nibi.py +519 -0
  61. ngs_agent-0.2.0/ngs_agent/qc.py +130 -0
  62. ngs_agent-0.2.0/ngs_agent/reports.py +241 -0
  63. ngs_agent-0.2.0/ngs_agent/signatures/adapter_contamination.yaml +20 -0
  64. ngs_agent-0.2.0/ngs_agent/signatures/high_duplication.yaml +21 -0
  65. ngs_agent-0.2.0/ngs_agent/signatures/low_alignment_rate.yaml +20 -0
  66. ngs_agent-0.2.0/ngs_agent/signatures/low_coverage.yaml +21 -0
  67. ngs_agent-0.2.0/ngs_agent/signatures/poor_insert_size.yaml +21 -0
  68. ngs_agent-0.2.0/ngs_agent/tui.py +725 -0
  69. ngs_agent-0.2.0/ngs_agent/watcher.py +134 -0
  70. ngs_agent-0.2.0/pyproject.toml +108 -0
  71. ngs_agent-0.2.0/shared/__init__.py +0 -0
  72. ngs_agent-0.2.0/shared/cache.py +42 -0
  73. ngs_agent-0.2.0/shared/models.py +23 -0
  74. ngs_agent-0.2.0/shared/schemas.py +23 -0
  75. ngs_agent-0.2.0/shared/storage.py +36 -0
  76. ngs_agent-0.2.0/src/ngs_agent/__init__.py +5 -0
  77. ngs_agent-0.2.0/src/ngs_agent/agent/__init__.py +1 -0
  78. ngs_agent-0.2.0/src/ngs_agent/agent/executor.py +131 -0
  79. ngs_agent-0.2.0/src/ngs_agent/agent/models.py +93 -0
  80. ngs_agent-0.2.0/src/ngs_agent/agent/orchestrator.py +169 -0
  81. ngs_agent-0.2.0/src/ngs_agent/agent/planner.py +228 -0
  82. ngs_agent-0.2.0/src/ngs_agent/agent/reporter.py +129 -0
  83. ngs_agent-0.2.0/src/ngs_agent/agent/types.py +25 -0
  84. ngs_agent-0.2.0/src/ngs_agent/agent/verifier.py +58 -0
  85. ngs_agent-0.2.0/src/ngs_agent/artifacts/store.py +23 -0
  86. ngs_agent-0.2.0/src/ngs_agent/bioinformatics/__init__.py +1 -0
  87. ngs_agent-0.2.0/src/ngs_agent/bioinformatics/common/__init__.py +1 -0
  88. ngs_agent-0.2.0/src/ngs_agent/bioinformatics/rnaseq/__init__.py +1 -0
  89. ngs_agent-0.2.0/src/ngs_agent/bioinformatics/rnaseq/pipeline.py +72 -0
  90. ngs_agent-0.2.0/src/ngs_agent/cli/__init__.py +1 -0
  91. ngs_agent-0.2.0/src/ngs_agent/cli/app.py +231 -0
  92. ngs_agent-0.2.0/src/ngs_agent/config/settings.py +71 -0
  93. ngs_agent-0.2.0/src/ngs_agent/execution/__init__.py +1 -0
  94. ngs_agent-0.2.0/src/ngs_agent/execution/backends/__init__.py +1 -0
  95. ngs_agent-0.2.0/src/ngs_agent/execution/backends/apptainer_backend.py +21 -0
  96. ngs_agent-0.2.0/src/ngs_agent/execution/backends/base.py +19 -0
  97. ngs_agent-0.2.0/src/ngs_agent/execution/backends/docker_backend.py +21 -0
  98. ngs_agent-0.2.0/src/ngs_agent/execution/backends/native_backend.py +95 -0
  99. ngs_agent-0.2.0/src/ngs_agent/execution/models.py +24 -0
  100. ngs_agent-0.2.0/src/ngs_agent/execution/selector.py +57 -0
  101. ngs_agent-0.2.0/src/ngs_agent/observability/logging.py +25 -0
  102. ngs_agent-0.2.0/src/ngs_agent/reproducibility/checkpoint.py +34 -0
  103. ngs_agent-0.2.0/src/ngs_agent/tools/__init__.py +1 -0
  104. ngs_agent-0.2.0/src/ngs_agent/tools/base.py +68 -0
  105. ngs_agent-0.2.0/src/ngs_agent/tools/builtins/__init__.py +1 -0
  106. ngs_agent-0.2.0/src/ngs_agent/tools/builtins/bioinformatics_tools.py +643 -0
  107. ngs_agent-0.2.0/src/ngs_agent/tools/permissions.py +38 -0
  108. ngs_agent-0.2.0/src/ngs_agent/tools/registry.py +61 -0
  109. ngs_agent-0.2.0/tools/report_builder.py +42 -0
  110. ngs_agent-0.2.0/tools/templates/report.html.j2 +94 -0
  111. ngs_agent-0.2.0/workflows/__init__.py +0 -0
  112. ngs_agent-0.2.0/workflows/activities.py +186 -0
  113. ngs_agent-0.2.0/workflows/pipeline_workflow.py +505 -0
@@ -0,0 +1,29 @@
1
+ name: Publish to PyPI
2
+
3
+ on:
4
+ push:
5
+ tags: ["v*"]
6
+ workflow_dispatch: {}
7
+
8
+ permissions:
9
+ id-token: write # required for Trusted Publishing (no stored password)
10
+ contents: read
11
+
12
+ jobs:
13
+ publish:
14
+ runs-on: ubuntu-latest
15
+ steps:
16
+ - uses: actions/checkout@v4
17
+
18
+ - uses: actions/setup-python@v5
19
+ with:
20
+ python-version: "3.12"
21
+
22
+ - name: Install build tooling
23
+ run: python -m pip install --upgrade build
24
+
25
+ - name: Build distributions
26
+ run: python -m build
27
+
28
+ - name: Publish to PyPI
29
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,23 @@
1
+ name: Pylint
2
+
3
+ on: [push]
4
+
5
+ jobs:
6
+ build:
7
+ runs-on: ubuntu-latest
8
+ strategy:
9
+ matrix:
10
+ python-version: ["3.11", "3.12"]
11
+ steps:
12
+ - uses: actions/checkout@v4
13
+ - name: Set up Python ${{ matrix.python-version }}
14
+ uses: actions/setup-python@v5
15
+ with:
16
+ python-version: ${{ matrix.python-version }}
17
+ - name: Install dependencies
18
+ run: |
19
+ python -m pip install --upgrade pip
20
+ pip install pylint
21
+ - name: Analysing the code with pylint
22
+ run: |
23
+ pylint $(git ls-files '*.py')
@@ -0,0 +1,39 @@
1
+ name: Test
2
+
3
+ on:
4
+ push:
5
+ branches: [ main, master ]
6
+ pull_request:
7
+ branches: [ main, master ]
8
+
9
+ jobs:
10
+ test:
11
+ runs-on: ubuntu-latest
12
+ strategy:
13
+ matrix:
14
+ python-version: ["3.11", "3.12"]
15
+
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+
19
+ - name: Set up Python ${{ matrix.python-version }}
20
+ uses: actions/setup-python@v5
21
+ with:
22
+ python-version: ${{ matrix.python-version }}
23
+
24
+ - name: Install dependencies
25
+ run: |
26
+ python -m pip install --upgrade pip
27
+ pip install -e ".[dev,llm]"
28
+
29
+ - name: Run pytest
30
+ run: |
31
+ pytest tests/ -v --tb=short
32
+
33
+ - name: Run ruff check
34
+ run: |
35
+ ruff check ngs_agent/ agents/
36
+
37
+ - name: Run mypy
38
+ run: |
39
+ mypy ngs_agent/ --ignore-missing-imports
@@ -0,0 +1,42 @@
1
+ ```
2
+ # Dependencies
3
+ __pycache__/
4
+ *.pyc
5
+ *.pyo
6
+ *.pyd
7
+ .pytest_cache/
8
+ .mypy_cache/
9
+ .coverage
10
+ coverage/
11
+ htmlcov/
12
+
13
+ # Build and distribution artifacts
14
+ build/
15
+ dist/
16
+ *.egg-info/
17
+ *.whl
18
+ *.tar.gz
19
+ *.zip
20
+
21
+ # Environment files
22
+ .env
23
+ .env.local
24
+ *.env.*
25
+
26
+ # Logs and temporary files
27
+ *.log
28
+ # This small log is part of the documented demo command.
29
+ !demo_data/sample.log
30
+ *.tmp
31
+ *.swp
32
+
33
+ # Editors and IDEs
34
+ .vscode/
35
+ .idea/
36
+ *.swp
37
+ *.swo
38
+
39
+ # OS generated files
40
+ .DS_Store
41
+ Thumbs.db
42
+ ```
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2026 Muhammad Alyan Ashraf
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,290 @@
1
+ Metadata-Version: 2.5
2
+ Name: ngs-agent
3
+ Version: 0.2.0
4
+ Summary: Pipeline log watcher, VCF/QC interpreter, and multi-agent debate platform for wet-lab NGS teams
5
+ Project-URL: Homepage, https://github.com/ranaalyan1/NGS-Agent
6
+ Project-URL: Repository, https://github.com/ranaalyan1/NGS-Agent
7
+ Project-URL: Bug Tracker, https://github.com/ranaalyan1/NGS-Agent/issues
8
+ Author-email: Muhammad Alyan Ashraf <ranaaliyan887@gmail.com>
9
+ License: Apache-2.0
10
+ License-File: LICENSE
11
+ Keywords: agentic,bioinformatics,cli,ngs,rna-seq,variant,vcf,wet-lab,wgs
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Environment :: Console
14
+ Classifier: Intended Audience :: Science/Research
15
+ Classifier: License :: OSI Approved :: Apache Software License
16
+ Classifier: Operating System :: OS Independent
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
21
+ Requires-Python: >=3.11
22
+ Requires-Dist: click>=8.1.7
23
+ Requires-Dist: httpx>=0.28.1
24
+ Requires-Dist: pyyaml>=6.0.2
25
+ Requires-Dist: rich>=13.9.4
26
+ Requires-Dist: typing-extensions>=4.12.2
27
+ Provides-Extra: dev
28
+ Requires-Dist: boto3>=1.37.0; extra == 'dev'
29
+ Requires-Dist: mypy>=1.15.0; extra == 'dev'
30
+ Requires-Dist: pytest-cov>=6.0.0; extra == 'dev'
31
+ Requires-Dist: pytest>=8.3.5; extra == 'dev'
32
+ Requires-Dist: ruff>=0.9.9; extra == 'dev'
33
+ Provides-Extra: llm
34
+ Requires-Dist: anthropic>=0.49.0; extra == 'llm'
35
+ Requires-Dist: httpx>=0.28.1; extra == 'llm'
36
+ Requires-Dist: openai>=1.0.0; extra == 'llm'
37
+ Provides-Extra: swarm
38
+ Requires-Dist: boto3>=1.37.0; extra == 'swarm'
39
+ Requires-Dist: orjson>=3.10.15; extra == 'swarm'
40
+ Requires-Dist: pydantic-settings>=2.7.1; extra == 'swarm'
41
+ Requires-Dist: pydantic>=2.10.6; extra == 'swarm'
42
+ Requires-Dist: python-dotenv>=1.0.1; extra == 'swarm'
43
+ Requires-Dist: redis>=5.0.0; extra == 'swarm'
44
+ Requires-Dist: structlog>=24.4.0; extra == 'swarm'
45
+ Requires-Dist: temporalio>=1.8.0; extra == 'swarm'
46
+ Requires-Dist: tenacity>=9.0.0; extra == 'swarm'
47
+ Provides-Extra: tui
48
+ Requires-Dist: prompt-toolkit>=3.0; extra == 'tui'
49
+ Requires-Dist: pyfiglet>=1.0; extra == 'tui'
50
+ Description-Content-Type: text/markdown
51
+
52
+ # NGS-Agent
53
+
54
+ Agentic bioinformatics CLI for wet-lab NGS teams. Monitor pipeline logs in real time, parse and interpret VCF and QC outputs, and run three-perspective LLM debates on Variants of Uncertain Significance — all from a single `pip install`.
55
+
56
+ [![Python 3.11+](https://img.shields.io/badge/python-3.11%2B-blue)](https://www.python.org)
57
+ [![License: Apache 2.0](https://img.shields.io/badge/license-Apache%202.0-green)](LICENSE)
58
+ [![PyPI](https://img.shields.io/badge/pypi-ngs--agent-orange)](https://pypi.org/project/ngs-agent/)
59
+
60
+ ---
61
+
62
+ ## Installation
63
+
64
+ ```bash
65
+ pip install ngs-agent
66
+ ```
67
+
68
+ Core install pulls only `click`, `rich`, and `PyYAML`.
69
+
70
+ To use the `debate` command with an LLM:
71
+
72
+ ```bash
73
+ pip install "ngs-agent[llm]"
74
+ ```
75
+
76
+ To run the full Temporal-orchestrated swarm pipeline (RNA-Seq, WGS, WES end-to-end):
77
+
78
+ ```bash
79
+ pip install "ngs-agent[swarm]"
80
+ ```
81
+
82
+ ---
83
+
84
+ ## Usage
85
+
86
+ ```bash
87
+ ngsagent watch pipeline.log
88
+ ngsagent watch --tail pipeline.log
89
+ ngsagent analyze variants.vcf
90
+ ngsagent analyze variants.vcf --qc multiqc_summary.txt
91
+ ngsagent debate variants.vcf
92
+ ngsagent debate variants.vcf --gene BRCA2
93
+ ngsagent config wizard
94
+ ```
95
+
96
+ Try it immediately with the bundled demo files:
97
+
98
+ ```bash
99
+ ngsagent watch demo_data/sample.log
100
+ ngsagent analyze demo_data/sample.vcf
101
+ ```
102
+
103
+ ---
104
+
105
+ ## Commands
106
+
107
+ ### watch
108
+
109
+ Scans a pipeline log against five built-in failure signatures. Pass `--tail` to follow a log as it grows.
110
+
111
+ ```bash
112
+ ngsagent watch <logfile> [--tail] [--signatures <dir>]
113
+ ```
114
+
115
+ Each match prints the matched line, a plain-English explanation of the failure mode, and a concrete suggested fix. Signature severity levels are `critical` and `warning`. No LLM is involved.
116
+
117
+ Built-in signatures:
118
+
119
+ | Name | Severity | Fires when |
120
+ |---|---|---|
121
+ | Adapter Contamination | critical | Adapter sequence detected as overrepresented in reads |
122
+ | Low Alignment Rate | critical | Overall mapping rate below 80% |
123
+ | Low Mean Coverage | critical | Mean sequencing depth below 20x |
124
+ | High PCR Duplication | warning | Duplication rate above 30% |
125
+ | Poor Insert Size | warning | Median insert size below 150 bp |
126
+
127
+ You can supply your own YAML signatures directory with `--signatures`. The schema is the same as the built-in files under `ngs_agent/signatures/`.
128
+
129
+ ---
130
+
131
+ ### analyze
132
+
133
+ Parses a VCF file and renders a colour-coded variant report in the terminal. Accepts an optional QC summary text file (MultiQC output or any plaintext file containing metrics).
134
+
135
+ ```bash
136
+ ngsagent analyze <vcffile> [--qc <qcfile>]
137
+ ```
138
+
139
+ VCF parsing reads `GENE`, `CSQ`, `CLNSIG`, and `AF` from the INFO field, and `DP` and `AD` from the sample column to compute read depth and variant allele fraction. Variants are classified automatically:
140
+
141
+ `Pathogenic` — ClinVar `CLNSIG` contains "pathogenic" without "conflicting"
142
+ `VUS` — ClinVar `CLNSIG` contains "uncertain", "vus", or "unknown significance"
143
+ `Other` — everything else (benign, synonymous, unannotated)
144
+
145
+ QC parsing extracts mapping rate, mean coverage, duplication rate, and Q30 fraction using regex against the file text and grades each metric pass / warn / fail.
146
+
147
+ ---
148
+
149
+ ### debate
150
+
151
+ Submits every VUS in a VCF to three independent LLM personas simultaneously. Each persona evaluates the variant from a different disciplinary angle, then the tool builds a consensus and recommendation.
152
+
153
+ ```bash
154
+ ngsagent debate <vcffile> [--gene <GENE_SYMBOL>]
155
+ ```
156
+
157
+ The three personas:
158
+
159
+ `Population Geneticist` — evaluates allele frequency, gnomAD population context, and stratification
160
+ `Clinical Geneticist` — evaluates ClinVar classification, ACMG criteria, and phenotype fit
161
+ `Functional Geneticist` — evaluates predicted consequence, splice site impact, and protein-level effect
162
+
163
+ Consensus logic: if all three agree the variant is pathogenic, it's escalated for clinical follow-up. If all three call it benign, it's flagged for deprioritisation. Mixed opinions surface the disagreement verbatim so the reviewing scientist sees exactly where uncertainty lies.
164
+
165
+ Requires an LLM backend. Configure one with `ngsagent config wizard`.
166
+
167
+ ---
168
+
169
+ ### config
170
+
171
+ Manages `~/.ngsagent/config.yaml`.
172
+
173
+ ```bash
174
+ ngsagent config wizard
175
+ ngsagent config show
176
+ ngsagent config set llm anthropic
177
+ ngsagent config set anthropic_model claude-sonnet-4-20250514
178
+ ngsagent config set llm ollama
179
+ ngsagent config set ollama_model llama3.2
180
+ ngsagent config set ollama_host http://localhost:11434
181
+ ```
182
+
183
+ ---
184
+
185
+ ## LLM Setup
186
+
187
+ ### Anthropic
188
+
189
+ ```bash
190
+ pip install "ngs-agent[llm]"
191
+ export ANTHROPIC_API_KEY=sk-ant-...
192
+ ngsagent config set llm anthropic
193
+ ```
194
+
195
+ Default model is `claude-sonnet-4-20250514`. Override with `ngsagent config set anthropic_model <model>`.
196
+
197
+ ### Ollama (local, no API key)
198
+
199
+ ```bash
200
+ pip install "ngs-agent[llm]"
201
+ ollama pull llama3.2
202
+ ngsagent config set llm ollama
203
+ ```
204
+
205
+ Ollama talks to `http://localhost:11434` by default. Override the host and model via `config set`.
206
+
207
+ `watch` and `analyze` always work with no LLM configured. Only `debate` requires one.
208
+
209
+ ---
210
+
211
+ ## Swarm Pipeline (full RNA-Seq / WGS / WES)
212
+
213
+ NGS-Agent also ships a Temporal-orchestrated Docker swarm that runs complete genomics pipelines end to end. Each bioinformatics tool runs in its own container as an autonomous agent. Claude is embedded at decision points — QC verdict, trim parameter selection, alignment failure diagnosis, and biological interpretation — with deterministic heuristic fallbacks when no API key is set.
214
+
215
+ **Requirements:** Docker Engine, Python 3.11+, Linux or macOS (WSL2 on Windows)
216
+
217
+ **Setup:**
218
+
219
+ ```bash
220
+ cp .env.example .env
221
+ pip install "ngs-agent[swarm]"
222
+ docker compose up -d
223
+ bash scripts/build-agents.sh
224
+ python worker.py
225
+ ```
226
+
227
+ **Submit a paired-end RNA-Seq run:**
228
+
229
+ ```bash
230
+ python cli.py submit \
231
+ --experiment RNA-Seq \
232
+ --organism human \
233
+ --ref-genome data/ref/grch38_idx \
234
+ --gtf data/ref/genes.gtf \
235
+ --fastq-r1 data/fastq/R1.fastq.gz \
236
+ --fastq-r2 data/fastq/R2.fastq.gz \
237
+ --paired
238
+ ```
239
+
240
+ **Check run status:**
241
+
242
+ ```bash
243
+ python cli.py status <run-id>
244
+ ```
245
+
246
+ **RNA-Seq pipeline stages:**
247
+
248
+ Ingest (read count + paired/single detection) → QC (real FastQC + Claude verdict) → AI Decider (Trimmomatic parameters from Claude) → Trim (conditional) → Align (HISAT2 + samtools, with AI-guided re-trim retry on low mapping rate) → Count (featureCounts) → Differential Expression (DESeq2, PCA, MA plot, volcano, heatmap) → GO Enrichment (clusterProfiler + Claude biological narrative) → Report Builder (self-contained HTML) → Report Agent (OpenRouter narrative summary)
249
+
250
+ **WGS / WES pipeline stages:**
251
+
252
+ Ingest → QC → AI Decider → Trim → BWA-MEM2 (with per-region coverage from panel BED) → GATK (MarkDuplicatesSpark → BQSR → HaplotypeCaller) → Annotation (snpEff, variant CSV) → Coverage Gate (halts run if mean depth below threshold) → Report Builder → Report Agent
253
+
254
+ All file artifacts are uploaded to MinIO at `s3://ngs-artifacts/<run_id>/<agent>/`. Results are content-addressed using blake2b hashes of the inputs, so identical re-runs return from cache instantly without re-executing any container.
255
+
256
+ ---
257
+
258
+ ## Project Layout
259
+
260
+ ```
261
+ ngs_agent/ pip-installable CLI (watch, analyze, debate, config)
262
+ backends/ LLM provider abstraction: Anthropic, Ollama, NoBackend
263
+ signatures/ YAML failure signatures loaded by the watch command
264
+ agents/ Docker containers, one per pipeline step
265
+ base/base_agent.py Agent contract: reads AGENT_INPUTS + ROUTING_CONTEXT env vars, prints JSON to stdout
266
+ workflows/ Temporal workflow definitions and activity dispatcher
267
+ shared/ AgentResult model, MinIO storage helper, Redis+MinIO cache
268
+ cli.py Swarm pipeline CLI (submit, status, wizard)
269
+ worker.py Temporal worker process
270
+ demo_data/ sample.log and sample.vcf for testing without real data
271
+ ```
272
+
273
+ ---
274
+
275
+ ## Development
276
+
277
+ ```bash
278
+ git clone https://github.com/ranaalyan1/NGS-Agent.git
279
+ cd NGS-Agent
280
+ pip install -e ".[dev,llm]"
281
+ pytest
282
+ ruff check ngs_agent/
283
+ mypy ngs_agent/
284
+ ```
285
+
286
+ ---
287
+
288
+ ## License
289
+
290
+ Apache 2.0. See [LICENSE](LICENSE).