Commit 63c3623
committed
fix: handle single-child transcripts in veff.Annotator.get_children (#840)
When a transcript has only one child (e.g. a single-exon non-coding
transcript), pandas DataFrame.loc returns a Series instead of a
DataFrame. This caused a TypeError when downstream code called
.sort_values('start') on the result.
Changes:
- Annotator.get_children() now always returns a DataFrame by converting
a Series result to a single-row DataFrame via .to_frame().T
- Annotator.get_effects() now raises an informative ValueError when a
transcript has no CDS or UTR children (non-coding), instead of
failing with a confusing error downstream
Closes #8401 parent bef737a commit 63c3623
1 file changed
Lines changed: 21 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
62 | 63 | | |
63 | 64 | | |
64 | 65 | | |
65 | | - | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
66 | 75 | | |
67 | 76 | | |
68 | 77 | | |
| |||
104 | 113 | | |
105 | 114 | | |
106 | 115 | | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
107 | 127 | | |
108 | 128 | | |
109 | 129 | | |
| |||
0 commit comments