- AiiDA profile with graph to render
- GePhi >= 0.9.1
You can import the graph from AiiDA into GePhi either via .dot
files or by connecting GePhi directly to the AiiDA database.
- Generate
.dot
files for every graph you would like to include. E.g.
from aiida.orm import WorkCalculation
from aiida.orm.data.structure import StructureData
import os
# Query for all structures of interest
qb = QueryBuilder()
qb.append(WorkCalculation, filters={ 'attributes.function_name': {'==': 'collect_outputs'} }, tag='collect')
qb.append(StructureData, project=['*'], edge_filters={'label': 'ref_structure'}, input_of='collect')
results=qb.all()
structures = [ r[0] for r in results]
# Generate graph for all those structures
for s in structures:
os.system("verdi graph generate {}".format(s.pk))
- Open GePhi, select File => Open and select all
.dot
files
- Open GePhi, select File => import Database => Edge list
- Fill databasei connection info with your AiiDA profile connection info
- Write appropriate queries as seen below
- In "Overview" select e.g. Layout => ForceAtlas2
- In "Preview" select e.g. "Dark Background"
Enjoy!
- There are powerful filter methods available in Overview => Filters => Topology (e.g. remove all but the largest one by selecting "Giant component")
- The apparent brightness of node edges can be affected by resolution of the PNG export (e.g. a finer resolution might, correctly, render the edges as thinner). In this case, you can play with the edge thickness to counteract this.
- Removing unexpected rectangles: With the default merge policy "sum", the weight of some edges can grow very large. In the Data Laboratory, click on "Edges" and sort by "Weight" to edit.
Thanks go to Jens Bröder for the original idea and Giovanni Pizzi for SQL assistance.