splicecraft 0.2.0__py3-none-any.whl

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,310 @@
1
+ Metadata-Version: 2.4
2
+ Name: splicecraft
3
+ Version: 0.2.0
4
+ Summary: Terminal-based circular plasmid map viewer, sequence editor, and Primer3/Golden Braid primer design workbench
5
+ Project-URL: Homepage, https://github.com/Binomica-Labs/SpliceCraft
6
+ Project-URL: Repository, https://github.com/Binomica-Labs/SpliceCraft
7
+ Project-URL: Issues, https://github.com/Binomica-Labs/SpliceCraft/issues
8
+ Project-URL: Changelog, https://github.com/Binomica-Labs/SpliceCraft/blob/master/CHANGELOG.md
9
+ Author: Binomica Labs
10
+ License: MIT License
11
+
12
+ Copyright (c) 2026 Binomica Labs
13
+
14
+ Permission is hereby granted, free of charge, to any person obtaining a copy
15
+ of this software and associated documentation files (the "Software"), to deal
16
+ in the Software without restriction, including without limitation the rights
17
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
18
+ copies of the Software, and to permit persons to whom the Software is
19
+ furnished to do so, subject to the following conditions:
20
+
21
+ The above copyright notice and this permission notice shall be included in all
22
+ copies or substantial portions of the Software.
23
+
24
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
25
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
27
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
29
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
30
+ SOFTWARE.
31
+ License-File: LICENSE
32
+ Keywords: bioinformatics,cloning,genbank,golden-braid,molecular-biology,plasmid,primer3,terminal,tui
33
+ Classifier: Development Status :: 4 - Beta
34
+ Classifier: Environment :: Console
35
+ Classifier: Intended Audience :: Science/Research
36
+ Classifier: License :: OSI Approved :: MIT License
37
+ Classifier: Operating System :: OS Independent
38
+ Classifier: Programming Language :: Python :: 3
39
+ Classifier: Programming Language :: Python :: 3.10
40
+ Classifier: Programming Language :: Python :: 3.11
41
+ Classifier: Programming Language :: Python :: 3.12
42
+ Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
43
+ Classifier: Topic :: Terminals
44
+ Requires-Python: >=3.10
45
+ Requires-Dist: biopython>=1.87
46
+ Requires-Dist: platformdirs>=4.2
47
+ Requires-Dist: primer3-py>=2.3.0
48
+ Requires-Dist: textual>=8.2.3
49
+ Provides-Extra: dev
50
+ Requires-Dist: build; extra == 'dev'
51
+ Requires-Dist: pytest-asyncio>=1.3; extra == 'dev'
52
+ Requires-Dist: pytest>=9.0; extra == 'dev'
53
+ Requires-Dist: twine; extra == 'dev'
54
+ Description-Content-Type: text/markdown
55
+
56
+ # SpliceCraft
57
+
58
+ ```
59
+ ╔═══════════════════════════════════════════════════════════════════════════════╗
60
+ ║ ⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶ ║
61
+ ║ ║
62
+ ║ ________ __________ _________ ____________ ║
63
+ ║ __ ___/__________ /__(_)____________ ____/____________ ___ __/_ /_ ║
64
+ ║ _____ \___ __ \_ /__ /_ ___/ _ \ / __ ___/ __ `/_ /_ _ __/ ║
65
+ ║ ____/ /__ /_/ / / _ / / /__ / __/ /___ _ / / /_/ /_ __/ / /_ ║
66
+ ║ /____/ _ .___//_/ /_/ \___/ \___/\____/ /_/ \__,_/ /_/ \__/ ║
67
+ ║ /_/ ║
68
+ ║ ║
69
+ ║ · I n - T e r m i n a l P l a s m i d W o r k b e n c h · ║
70
+ ║ ║
71
+ ║ ⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶ ║
72
+ ╚═══════════════════════════════════════════════════════════════════════════════╝
73
+ ```
74
+
75
+ ![SpliceCraft screenshot](https://raw.githubusercontent.com/Binomica-Labs/SpliceCraft/master/screenshot.jpg)
76
+
77
+ A terminal-based circular plasmid map viewer, sequence editor, **primer design
78
+ workbench**, and **Golden Braid parts domesticator** — rendered entirely in your
79
+ shell. Fetch any GenBank record by accession, load local files, annotate features
80
+ with pLannotate, design diagnostic / cloning / Golden Braid primers with Primer3,
81
+ and edit sequences — without ever leaving the terminal.
82
+
83
+ ---
84
+
85
+ ## Features
86
+
87
+ ### Core visualization & editing
88
+ - **Braille dot-matrix circular map** — plasmids rendered as crisp Unicode braille
89
+ rings with per-strand feature arcs, directional arrowheads, and proximity-placed
90
+ labels
91
+ - **Linear map view** — toggle with `v` for a horizontal strip layout
92
+ - **Dithered sequence panel** — per-base DNA viewer with feature bars, restriction
93
+ site overlays, and double-stranded display
94
+ - **Live NCBI fetch** — pull any GenBank record by accession number on demand
95
+ - **Local file support** — open `.gb` / `.gbk` files directly from disk
96
+ - **Free rotation** — spin the origin left or right with `[` / `]`
97
+ - **Restriction enzyme overlay** — 200+ NEB enzymes including Type IIS
98
+ (BsaI, BsmBI, BbsI, SapI) with visible recognition arcs + cut markers
99
+
100
+ ### Libraries (all persist to JSON)
101
+ - **Plasmid library** — SnapGene-style collection, auto-saves on import, survives
102
+ restarts, supports rename and handslip-protected delete
103
+ - **Parts Bin** — Golden Braid L0 parts catalog with user-domesticated parts
104
+ including sequences and primer pairs
105
+ - **Primer library** — all designed primers with Tm, length, date, status
106
+ (Designed / Ordered / Validated), multi-select for batch operations
107
+
108
+ ### Primer design (Primer3)
109
+ - **Detection primers** — diagnostic PCR; Primer3 picks the ideal pair within
110
+ a selected region, 450-550 bp product by default (configurable)
111
+ - **Cloning primers** — RE-site tails + GCGC padding; 30+ common enzymes or
112
+ type a custom recognition sequence
113
+ - **Golden Braid primers** — BsaI domestication for all L0 positions
114
+ (Promoter, 5' UTR, CDS, CDS-NS, C-tag, Terminator)
115
+ - **Generic primers** — simple binding primers, no tails
116
+ - Primers can be added to the plasmid map as `primer_bind` features
117
+ - Scrollable `TextArea` for custom sequence input; highlighted text = target
118
+
119
+ ### Annotation
120
+ - **pLannotate integration** — press `Shift+A` (or use the `◈` library button)
121
+ to auto-annotate a plasmid against pLannotate's curated feature database.
122
+ Optional — see install notes below
123
+
124
+ ### Feature operations
125
+ - **Feature sidebar** — click a row to highlight on map; click the map to
126
+ select the feature under the cursor
127
+ - **Undo/redo** — 50-deep snapshot stack for all sequence edits
128
+ - **Delete protection** — focus-aware Delete key; confirmation modal (default
129
+ focus = No) for library entries
130
+ - **Clipboard** — OSC-52 copy works in Windows Terminal, iTerm2, modern WSL
131
+
132
+ ### Data safety
133
+ - **Atomic saves** — all JSON files written via tempfile + `os.replace`
134
+ - **Automatic backups** — every save writes `*.json.bak` before overwriting
135
+ - **Corrupt-file recovery** — missing files don't crash; corrupt files auto-
136
+ restore from `.bak` with a warning notification on startup
137
+
138
+ ---
139
+
140
+ ## Installation
141
+
142
+ Requires **Python 3.10+**.
143
+
144
+ ### From PyPI (recommended)
145
+
146
+ ```bash
147
+ pip install splicecraft
148
+ splicecraft # empty canvas
149
+ splicecraft L09137 # fetch pUC19 from NCBI
150
+ splicecraft myplasmid.gb # open a local GenBank file
151
+ ```
152
+
153
+ All required dependencies (`textual`, `biopython`, `primer3-py`, `platformdirs`)
154
+ are pulled in automatically. User data (library, parts bin, primers) lives in
155
+ the platform-appropriate data directory:
156
+
157
+ | Platform | Path |
158
+ |---|---|
159
+ | Linux | `~/.local/share/splicecraft/` |
160
+ | macOS | `~/Library/Application Support/splicecraft/` |
161
+ | Windows | `%APPDATA%\splicecraft\` |
162
+
163
+ Override with `SPLICECRAFT_DATA_DIR=/path/to/dir splicecraft`.
164
+
165
+ ### From source
166
+
167
+ ```bash
168
+ git clone https://github.com/Binomica-Labs/SpliceCraft.git
169
+ cd SpliceCraft
170
+ pip install -e .
171
+ ```
172
+
173
+ ### Optional dependencies
174
+
175
+ **pLannotate** (for automatic plasmid annotation via `Shift+A`) — requires conda:
176
+
177
+ ```bash
178
+ conda create -n plannotate -c conda-forge -c bioconda plannotate
179
+ conda activate plannotate
180
+ plannotate setupdb # one-time ~500 MB BLAST database download
181
+ # then run SpliceCraft from the same conda env
182
+ ```
183
+
184
+ SpliceCraft runs fine without pLannotate — the annotation feature just
185
+ notifies the user how to install it if pressed.
186
+
187
+ ---
188
+
189
+ ## Usage
190
+
191
+ ```bash
192
+ # After pip install:
193
+ splicecraft # empty canvas
194
+ splicecraft L09137 # fetch pUC19 from NCBI on launch
195
+ splicecraft myplasmid.gb # open a local GenBank file
196
+ splicecraft --version # print version
197
+ splicecraft --help # quick usage hint
198
+ ```
199
+
200
+ If running from a git clone (`pip install -e .`), the same commands work;
201
+ you can also still run `python3 splicecraft.py` directly.
202
+
203
+ ---
204
+
205
+ ## Key Bindings
206
+
207
+ ### Main screen
208
+
209
+ | Key | Description |
210
+ |----------------|----------------------------------------|
211
+ | `[` / `]` | Rotate map origin left / right |
212
+ | `Shift+[/]` | Rotate coarse (10× step) |
213
+ | `Home` | Reset origin to 0 |
214
+ | `,` / `.` | Circular map aspect wider / taller |
215
+ | `v` | Toggle circular ↔ linear map |
216
+ | `l` | Toggle feature label connector lines |
217
+ | `r` | Toggle restriction-site overlay |
218
+ | `f` | Fetch a record from NCBI by accession |
219
+ | `o` | Open a `.gb` file from disk |
220
+ | `a` | Add current plasmid to the library |
221
+ | `Shift+A` | Annotate plasmid with pLannotate |
222
+ | `Shift+E` | Enter sequence editor mode |
223
+ | `Shift+S` | Save edits to file |
224
+ | `Delete` | Context-aware delete (feature or library entry) |
225
+ | `Ctrl+Z` | Undo |
226
+ | `Ctrl+Shift+Z` | Redo |
227
+ | `Ctrl+C` | Copy selection to clipboard |
228
+ | `q` | Quit |
229
+
230
+ ### Primer Design screen
231
+
232
+ | Key | Description |
233
+ |-------|------------------------------------------------|
234
+ | `esc` | Close primer screen |
235
+ | `m` | Mark / unmark primer under cursor (`★`) |
236
+ | `M` | Mark / unmark all primers |
237
+ | `S` | Cycle status: Designed → Ordered → Validated |
238
+ | `Tab` | Cycle focus between fields |
239
+
240
+ ### Mouse
241
+
242
+ | Action | Description |
243
+ |----------------|---------------------------------------------|
244
+ | Click | Place cursor / select feature under pointer |
245
+ | Double-click | Select full feature span |
246
+ | Drag | Select a sequence range |
247
+ | Scroll wheel | Rotate map (when over map panel) |
248
+
249
+ ---
250
+
251
+ ## Menus
252
+
253
+ | Menu | Items |
254
+ |------------|--------------------------------------------------------------------|
255
+ | File | Open .gb file · Fetch from NCBI · Add to Library · Save · Quit |
256
+ | Edit | Edit Sequence · Undo · Redo · Delete Feature |
257
+ | Enzymes | Show RE sites · Unique cutters · 6+/4+ bp sites · Connectors |
258
+ | Features | Add Feature · Delete Feature · Annotate with pLannotate |
259
+ | Primers | Opens the full-screen Primer Design workbench |
260
+ | Parts | Opens the Parts Bin (Golden Braid L0 parts catalog) |
261
+ | Constructor| Opens the Assembly Constructor for TU building |
262
+
263
+ ---
264
+
265
+ ## Requirements
266
+
267
+ | Package | Version | Purpose |
268
+ |-------------------|-------------------|----------------------------------------------|
269
+ | Python | ≥ 3.10 | Runtime |
270
+ | Textual | ≥ 8.2.3 | TUI framework and rendering engine |
271
+ | Rich | ≥ 14.0 | Terminal rendering (Textual dependency) |
272
+ | Biopython | ≥ 1.87 | GenBank parsing and NCBI Entrez fetch |
273
+ | primer3-py | ≥ 2.3.0 | Primer design (Tm, thermodynamic screening) |
274
+ | pytest | ≥ 9.0 | Test suite (dev only) |
275
+ | pytest-asyncio | ≥ 1.3 | Async test support (dev only) |
276
+ | **pLannotate** | optional, conda | Automatic plasmid annotation (`Shift+A`) |
277
+ | **BLAST+** | optional, conda | Required by pLannotate |
278
+ | **Primer3 CLI** | optional, `apt` | Not used directly — primer3-py bundles it |
279
+
280
+ ---
281
+
282
+ ## Data files
283
+
284
+ All user data persists as human-readable JSON in the repo directory:
285
+
286
+ | File | Purpose |
287
+ |-----------------------|---------------------------------------------|
288
+ | `plasmid_library.json`| Saved plasmid collection (GenBank + metadata) |
289
+ | `parts_bin.json` | User-domesticated Golden Braid parts |
290
+ | `primers.json` | Designed primer library |
291
+ | `*.json.bak` | Automatic backup — written before each save |
292
+
293
+ These files are in `.gitignore` — they're user-local data, not repo content.
294
+ A manual backup rotation happens on every save so accidental data loss is
295
+ always recoverable via the `.bak` file.
296
+
297
+ ---
298
+
299
+ ## Tests
300
+
301
+ ```bash
302
+ python3 -m pytest -q # full suite (246 tests, ~45 s)
303
+ python3 -m pytest tests/test_dna_sanity.py # biology correctness only (< 1s)
304
+ ```
305
+
306
+ ---
307
+
308
+ ## License
309
+
310
+ MIT
@@ -0,0 +1,6 @@
1
+ splicecraft.py,sha256=xZDyMqXTXzRRKtW9FcC3bQF5QTjs_ykagGwuObRZ6Vc,306228
2
+ splicecraft-0.2.0.dist-info/METADATA,sha256=aDAuu85OyzeWFbWXm_8KmI0zfxhN7TaIrItDUwlQ9PE,14497
3
+ splicecraft-0.2.0.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
4
+ splicecraft-0.2.0.dist-info/entry_points.txt,sha256=hlsNo4zfMMOW7R83IMp41R-kgkbcVETuA70ZKqowevA,49
5
+ splicecraft-0.2.0.dist-info/licenses/LICENSE,sha256=9CoLZDw87mJTrQ3lcL5WW4nWc6iEyPHtY6TneCzVCTA,1070
6
+ splicecraft-0.2.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.29.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ splicecraft = splicecraft:main
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Binomica Labs
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.