Package: robocrys
Robocrystallographer is a tool to generate text descriptions of crystal
structures. Similar to how a real-life crystallographer would analyse a
structure, robocrystallographer looks at the symmetry, local environment, and
extended connectivity when generating a description. The package includes
utilities for identifying molecule names, component orientations,
heterostructure information, and more...UsageRobocrystallographer can be used from the command-line or from a python API.
The package integrates with theMaterials Projectto for allow generation of structure descriptions directly from Materials Project
ids. For example, to generate the description of SnO2(mp-856), one
can simply run:robocrysmp-856Alternatively, a structure file can be specified in place of a Materials Project id.
Robocrystallographer supports the same file formats aspymatgen, including the Crystallographic Information
Format (CIF), and common electronic structure package formats such as POSCAR files.
More information can be found on thecommand-line interface page.Python interfaceThe two core classes in robocrystallographer are:StructureCondenser: to condense the structure into an descriptive JSON
representation.StructureDescriber: to turn the condensed structure into a text description.A minimal working example for generating text descriptions is simply:frompymatgenimportStructurefromrobocrysimportStructureCondenser,StructureDescriberstructure=Structure.from_file("my_structure.cif")# other file formats also supported# alternatively, uncomment the lines below to use the MPRester object# to fetch structures from the Materials Project database# from pymatgen import MPRester# structure = MPRester(API_KEY=None).get_structure_by_material_id("mp-856")condenser=StructureCondenser()describer=StructureDescriber()condensed_structure=condenser.condense_structure(structure)description=describer.describe(condensed_structure)Wherestructureis a pymatgen Structure object. Both classes have many
options for customising the output of the structure
descriptions. More information is provided in themodule documentation.Intermediate JSON formatThe format of the intermediate JSON representation is detailed on thecondensed structure format page.Example outputAn example of the output generated by robocrystallographer for SnO2(mp-856) is given below:SnO2 is Rutile structured and crystallizes in the tetragonal P4_2/mnm space
group. The structure is three-dimensional. Sn(1) is bonded to six equivalent
O(1) atoms to form a mixture of edge and corner-sharing SnO6 octahedra. The
corner-sharing octahedral tilt angles are 51°. All Sn(1)–O(1) bond lengths
are 2.09 Å. O(1) is bonded in a trigonal planar geometry to three equivalent
Sn(1) atoms.How to cite robocrystallographerPlease considering citing the following publication if using robocrystallographer in your work:Ganose, A., & Jain, A. (2019). Robocrystallographer: Automated crystal structure  text descriptions and analysis. MRS Communications, 9(3), 874-881.https://doi.org/10.1557/mrc.2019.94InstallationRobocrystallographer can be installed using pip:pipinstallrobocrysRobocrystallographer requires Python 3.7+. TheOpenBabelpackage is required to determine molecule names. This is an optional
requirement but its use is recommended for best
results. If you are using theCondapackage management
system, OpenBabel can be installed using:condainstall-cconda-forgeopenbabelWhat’s new?Track changes to robocrystallographer through theChangelog.ContributingRobocrystallographer is in early development but we still welcome your
contributions. Please read ourcontribution guidelinesfor more information. We maintain a list of all
contributorshere.LicenseRobocrystallographer is released under a modified BSD license;
the full text can be foundhere.AcknowledgementsLogo by Somewan from the Noun Project.