Closed uppittu11 closed 3 years ago
Okay so here's what I think would be really helpful. Obviously, If I plot the graph object I want to be able to see the edges and the sites for each atomtype. The current use supports that, so that's good. Need to write a little script to print out the tyes, but it's saved to each node. Then, I want to be able to pick a site and see all of the different angles, along with those parameters the site forms with neighbors. I want the same with dihedrals. Then, I want to be able to select a particular angle or dihedral, and be able to form a subgraph of the full networkx graph and visualize which atom_types make up the that particular angle or dihedral.
Okay so now onto what I think could be a useful way to generate this I think a simple method would be to use the attribute function available to nodes to save information for that node https://networkx.org/documentation/stable/tutorial.html#node-attributes
Alongside the typical atomtype information already save- see image below
-we add in an attribute for both the angle and dihedral information. For the angles, we can read in from a topology object the angle_type and the connection_members.
This would allow for selecting a single node, seeing it's connection members through nodes.angles.connection_members, and then use that selection to subselect the portion of the graph you'd like to visualize. An example of selecting atom_type.names is shown below.
In this case, we could save a specific angle by saving the connection members, and then use the networkx.subgraph(G,connection_members) to look at just the relevant atoms in the angle.
Probably going to have to make some functions that make parsing through all of this data selection more intuitive, but I think passing everything into one networkx.graph object is doable, which I think would make things much easier.
Originally posted by @RainierBarrett in https://github.com/mosdef-hub/gmso/issues/472#issuecomment-722664243
At the moment converting to/from networkX loses information about angles, dihedrals, impropers, etc. and subtopologies. Above is one solution for storing the missing information.
Let's brainstorm and evaluate some other ways to address the issue here.