Skip to content

POC Creating new block groups in python without breaking node identity#110

Draft
bobvh wants to merge 14 commits into
jupyter-widget-tsfrom
python-roundtrip
Draft

POC Creating new block groups in python without breaking node identity#110
bobvh wants to merge 14 commits into
jupyter-widget-tsfrom
python-roundtrip

Conversation

@bobvh

@bobvh bobvh commented Apr 27, 2026

Copy link
Copy Markdown
Member

This is something Chris at brought up a long time ago when we first had the networkx export: can we also go the other way around and create blocks directly in a networkx graph? We can with the Block datatype I implemented here for Python, and I used it to have an AI create a notebook that implements the "reverse translation graph" that we've been toying around with only in idea form.

(supersedes PR109 which had the wrong merge base, but it looks like github still lists all commits since main. Only commits from 5e9bae5 and onwards are relevant here)

bobvh and others added 14 commits April 25, 2026 17:41
Introduces Cells highlight kind and cell_highlights storage in the
viewport graph, allowing sub-rectangle tinting of individual nodes.
Adds center_on_node_offset and highlight_match_range helpers to
gen_graph_widget for navigating to and highlighting exact sequence
match positions.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…nd add inline label placement with collision avoidance

Extends annotation_track.rs with full glyph rendering, inline label
placement, and multi-track layout. Updates gen-tui graph widget and
plotter to consume the new annotation data structures. Adds
inline_label_placement.rs for label collision avoidance.
…bool

Replace case_sensitive: bool params in search/build_index methods with
sequence_kind: str ("dna", "ssdna", "protein") to match the new
GenGraphMatcher API. Derive case_sensitive internally from SequenceKind
for SeedIndex header serialization.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Implements a Jupyter anywidget backed by a Rust serialization layer that
streams rendered frames to the browser. TypeScript sources in gen-python/js/
draw cells, box-drawing chars, and text onto a canvas. Includes pan/drag
interaction and zoom buttons. Compiled JS is checked in so npm is not
required at build time.
Introduces glyphs.ts with the full GLYPH_SPLIT map: mixed-weight
box-drawing codepoints decomposed into a heavy layer (cell fg) and a
light layer (neutral_fg), enabling true three-colour rendering without
bold font tricks. Adds circle rendering for NODE_GLYPH_CP (●) via
canvas arc. Updates renderer.ts to use both.
Adds flo11, yeast, and comprehensive API demo notebooks with
corresponding FASTA, GFF3, and VCF reference data. Updates
search_and_navigate.ipynb for the new widget API.
- implemented create_block_group_from_* methods on Repository
- moved block_group_to_* methods from Factory to BlockGroup (deleted
Factory)
- improved block_group_to_* nethods to include more fields from the core
model
- tests and notebook to prove round trip
@dkhofer

dkhofer commented Apr 28, 2026

Copy link
Copy Markdown
Member

This demonstrates translating a protein sequence graph to the corresponding DNA sequence graph, right @bobvh ?

@bobvh

bobvh commented Jun 1, 2026

Copy link
Copy Markdown
Member Author

This demonstrates translating a protein sequence graph to the corresponding DNA sequence graph, right @bobvh ?

Correct, it's demonstrated in the notebooks this PR added. Note that I pushed this as a POC, not intended to actually merge. Not deleting yet because I do want consider the upload-graph-from-networkx more if it fits in the API; or alternatively try to see if it's even possible to do the recodes without it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants