Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configurable segment / "node" shapes #211

Open
fedarko opened this issue Feb 10, 2022 · 1 comment
Open

Configurable segment / "node" shapes #211

fedarko opened this issue Feb 10, 2022 · 1 comment
Assignees

Comments

@fedarko
Copy link
Member

fedarko commented Feb 10, 2022

Thought I'd opened another issue for this here in the past, but seems like I hadn't.

The GFA files output from certain assemblers (flye, spades IIRC, and probably more) are kind of inaccurate -- in the sense that they define "segments" and "links", but these segments really correspond to edges in a de Bruijn / repeat graph (rather than nodes) and the links really correspond to nodes (rather than edges). In spite of this, most tools (e.g. Bandage, MetagenomeScope) will visualize segments as nodes and links as edges.

This is fine -- the structures are essentially mostly equivalent, and it's possible to convert between them. (Also, AGB visualizes these graphs as you would expect.) However, for convenience's sake, it might be nice to add a simple option to just draw segments as arrows rather than as these uh pentagon-ish contig shapes -- this is doable in Cytoscape.js by adjusting the shape-polygon-points parameter. This would look something like the following hastily-drawn figure (except, you know, less gross).

arrow-schematic

This could range from just a simple toggle (pentagons vs. arrows) or actually allowing the user to specify custom strings for Cytoscape.js' shape-polygon-points parameter. Probably the former is sufficient for now.

@fedarko
Copy link
Member Author

fedarko commented Mar 31, 2022

Modifying the polygon points to do this is actually pretty feasible. See before (current pentagons) and after (arrows) below.

For reference, the polygon points:

// left <--
                                "1 0.4 -0.2 0.4 -0.2 0.8 -1 0 -0.2 -0.8 -0.2 -0.4 1 -0.4",
// right -->
                                "-1 0.4 0.2 0.4 0.2 0.8 1 0 0.2 -0.8 0.2 -0.4 -1 -0.4",

mgsc-2022-03-31T00_03_12

mgsc-2022-03-31T00_03_19

fedarko added a commit to fedarko/MetagenomeScope-1 that referenced this issue Mar 22, 2023
needs testing, and this will crash downstream b/c the layout code/etc
expects nodes to have lengths. But overall, this is a good start.

from there -- need to allow other parsers to create multidigraphs (not
just this one) -- marbl#202. and, for DOT graphs, draw nodes as circles w/
uniform sizes (marbl#211). once these (and the requisite other hurdles i
haven't thought of r/n) are passed, we've got something going.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant