Commit 6d1ce66
committed
Fix: Revert broken Copilot suggestions in canonical_transcript()
Two critical bugs were introduced in commit 66607b7:
1. API Misuse: Attempted to pass a list to genome_feature_children(parent: str)
- Changed: genome_feature_children(parent=transcript_ids, ...)
- Result: SyntaxError/TypeError in all tests
2. Missing coordinate adjustment: Removed +1 from exon length calculation
- Changed: (end - start) instead of (end - start + 1)
- Result: Incorrect transcript length calculations
This fix reverts to the original per-transcript iteration approach while
preserving the critical +1 for 1-based inclusive coordinates.
Test Results:
- All 35 genome_features tests pass (11 canonical + 24 existing)
- All pre-commit checks pass (ruff, black, flake8)
- Zero regressions1 parent 21474cf commit 6d1ce66
2 files changed
Lines changed: 18 additions & 25 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
424 | 424 | | |
425 | 425 | | |
426 | 426 | | |
427 | | - | |
428 | | - | |
429 | | - | |
430 | | - | |
431 | | - | |
432 | | - | |
433 | | - | |
434 | | - | |
435 | | - | |
436 | | - | |
437 | | - | |
438 | | - | |
439 | | - | |
440 | | - | |
441 | | - | |
442 | | - | |
443 | | - | |
444 | | - | |
445 | | - | |
446 | 427 | | |
447 | | - | |
448 | | - | |
449 | | - | |
450 | | - | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
451 | 442 | | |
452 | 443 | | |
453 | 444 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
338 | 338 | | |
339 | 339 | | |
340 | 340 | | |
| 341 | + | |
| 342 | + | |
341 | 343 | | |
342 | 344 | | |
343 | 345 | | |
| |||
359 | 361 | | |
360 | 362 | | |
361 | 363 | | |
362 | | - | |
| 364 | + | |
363 | 365 | | |
364 | 366 | | |
365 | 367 | | |
| |||
370 | 372 | | |
371 | 373 | | |
372 | 374 | | |
373 | | - | |
| 375 | + | |
374 | 376 | | |
375 | 377 | | |
376 | 378 | | |
| |||
0 commit comments