#!/usr/bin/env python # coding: utf-8 # # QCPortal # # Full [QCPortal documentation](http://docs.qcarchive.molssi.org/projects/QCPortal) is available. # # QCPortal is a data viewer for a QCFractal server. QCPortal can be used with any QCFractal server including one that you build on your own, but for these examples we will use the MolSSI QCArchive server. To begin we first construct a client that points to a QCFractal server instance, here we explicitly add the `molssi.org` server. # In[1]: import qcportal as ptl client = ptl.FractalClient("api.qcarchive.molssi.org") client # ## Finding Collections # # One of the main ways to explore the QCArchive is to examine `Collection`s which are structures that allow easy manipulation of data in preset ways. Several example of `Collection`s contained within the QCArchive are as follows: # # - `Dataset` - A dataset where each record is a single molecule and many methods can be applied to each record. # - `ReactionDataset` - A dataset where each record is a combinations of molecule (e.g. interaction and reaction energies) and many methods can be applied to each record. # - `OpenFFWorkflow` - A workflow collection for torsiondrives and contstrained optimization developed with the [Open Force Field Iniative](https://openforcefield.org). # - `TorsionDriveDataset` - A datas set which organizes many molecular torsion scans together for data exploration, analysis, and methodology comparison (see the TorsionDrive Dataset example for more details). # In[2]: client.list_collections().head() # Specific `Collection` types can be queried to limit the amount of collections to browse through: # In[4]: client.list_collections("ReactionDataset").head() # ## Exploring Collections # # Collections can be obtained by pulling their data from the centeral server. A collection is primarily metadata and extremely large collections can be pulled in a few seconds. For this example we will explore S22 dataset which is a small interaction energy dataset of 22 common dimers such as the water dimer, methane dimer, and more. To obtain this collection: # In[5]: ds = client.get_collection("ReactionDataset", "S22") print(ds) # ## Stastistics and Visualization # # Visual statics and plotting can be generated by the ``visualize`` command: # In[6]: ds.visualize(method="B2PLYP", basis=["def2-svp", "def2-tzvp"], bench="S220", kind="violin") # ## Conclusion # # These are just some of the capabilities QCPortal offers; # check out [more examples](https://qcarchive.molssi.org/examples/) # and the [QCPortal documentation](http://docs.qcarchive.molssi.org/projects/QCPortal). # If you like the project, consider starring us on [GitHub](https://github.com/MolSSI/QCFractal) # or if you have any questions, join our [Slack](https://join.slack.com/t/qcdb/shared_invite/enQtNDIzNTQ2OTExODk0LWM3OTgxN2ExYTlkMTlkZjA0OTExZDlmNGRlY2M4NWJlNDlkZGQyYWUxOTJmMzc3M2VlYzZjMjgxMDRkYzFmOTE) channel.