Skip to content

alternative_splicing_events/altsplice_test crash with TypeError on real data (numpy.bool_ index) #49

Description

@YalanBi

Discovered while re-running the tutorial notebooks against a freshly reconstructed real ENCODE chr8 transcriptome (not a fixture artifact -- reproduces on any gene with an exon-skipping-type alternative splicing event).

Error

TypeError: tuple indices must be integers or slices, not numpy.bool

Raised from SegmentGraph.find_splice_bubbles (splice_graph.py), at:

inB_sets[i + 1][unspliced and node_id == i].add(transcript_id)

unspliced = self[i].end == node_B.start -- when exon coordinates are numpy int64 (as they are for real alignment-derived data, not just plain Python int fixtures), this comparison yields numpy.bool_ instead of Python bool. Python only accepts bool/int as a sequence index; numpy.bool_ is not a subclass of int and is rejected.

Impact

This breaks Transcriptome.alternative_splicing_events(), Transcriptome.altsplice_test() (differential splicing), and likely Transcriptome.coordination_test(), for any real transcriptome with numpy-typed exon coordinates -- i.e. essentially all real-world usage.

Fix

Coerce to Python bool at the indexing site.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions