Package: asaplib
ASAPAutomatic Selection And Prediction tools for materials and moleculesDocumentation(in progress)Mapping Materials and Molecules(Paper link)Cheng B, Griffiths RR, Wengert S, Kunkel C, Stenczel T, Zhu B, Deringer VL, Bernstein N, Margraf JT, Reuter K, Csanyi G. Mapping Materials and Molecules. Accounts of Chemical Research. 2020 Aug 14:12697-705.This tutorial style paper covers:A concise summary of the theory of representing chemical environments, an a simple yet practical conceptual approach for generating structure maps in a generic and automated manner.Several illustrative examples on mapping material and chemical datasets, including crystalline and amorphous materials, interfaces, and organic molecules. The datasets of these examples are in thisrepo.Snippets ofasapcommands that were used to analyze the examples and make figures.Basic usageTypeasapand use the sub-commands for various tasks.To get help string:asap --help.or.asap subcommand --help.or.asap subcommand subcommand --helpdepending which level of help you are interested in.asap gen_desc: generate global or atomic descriptors based on the inputASE) xyze file.asap map: make 2D plots using the specified design matrix. Currently PCApca, sparsified kernel PCAskpca, UMAPumap, and t-SNEtsneare implemented.asap cluster: perform density based clustering. Currently supports DBSCANdbscanandFast search of density peaksfdb.asap fit: fast fit ridge regressionridgeor sparsified kernel ridge regression modelkernelridgebased on the input design matrix and labels.asap kde: quick kernel density estimation on the design matrix. Several versions of kde available.asap select: select a subset of frames using sparsification algorithms.Quick & basic exampleStep 1: generate a design matrixThe first step for a machine-learning analysis or visualization is to generate a "design matrix" made from either global descriptors or atomic descriptors. To do this, we supplyasap gen_descwith an input file that contains the atomic coordintes. Many formats are supported; anything can be read usingase.iois supported. You can use a wildcard to specify the list of input files that matches the pattern (e.g.POSCAR*,H*, or*.cif). However, it is most robust if you use an extended xyz file format (units in angstrom, additional info and cell size in the comment line).As a quick example, in the folder ./tests/to generate SOAP descriptors:asapgen_desc--fxyzsmall_molecules-1000.xyzsoapfor columb matrix:asapgen_desc-fsmall_molecules-1000.xyz--no-periodiccmStep 2: generate a low-dimensional mapAfter generating the descriptors, one can make a two-dimensional map (asap map), or regression model (asap fit), or clustering (asap cluster), or select a subset of frames (asap select), or do a clustering analysis (asap cluster), or estimate the probablity of observing each sample (asap kde).For instance, to make a pca map:asapmap-fsmall_molecules-SOAP.xyz-dm'[SOAP-n4-l3-c1.9-g0.23]'-cdft_formation_energy_per_atom_in_eVpcaYou can specify a list of descriptor vectors to include in the design matrix, e.g.'[SOAP-n4-l3-c1.9-g0.23, SOAP-n8-l3-c5.0-g0.3]'one can use a wildcard to specify the name of all the descriptors to use for the design matrix, e.g.asapmap-fsmall_molecules-SOAP.xyz-dm'[SOAP*]'-cdft_formation_energy_per_atom_in_eVpcaor evenasapmap-fsmall_molecules-SOAP.xyz-dm'[*]'-cdft_formation_energy_per_atom_in_eVpcaStep 2+: interactive visualizationUsingasap map, a png figure is generated. In addition, the code also output the low-dimensional coordinates of the structures and/or atomic environments. The default output is extended xyz file. One can also specify a different output format using--outputor-oflag. and the available options arexyz,matrixandchemiscope.If one selectchemiscopeformat, a*.json.gzfile will be writen, which can be directly used as the input ofchemiscopeIf the output is inxyzformat, it can be visualized interactively usingprojection_viewer.Installation & requirementspython 3Installation:python3setup.pyinstall--userThis should automatically install any depedencies.List of requirements:numpy scipy scikit-learn json ase dscribe umap-learn PyYAML clickAdd-Ons:(for finding symmetries of crystals) spglib(for annotation without overlaps) adjustTextThe FCHL19 representation requires code from the development brach of the QML package. Instructions on how to install the QML package can be found onhttps://www.qmlcode.org/installation.html.Additional toolsIn the directory ./scripts/ you can find a selection of other python tools.Tab completionTab completion can be enabled by sourcing theasap_completion.shscript in the ./scripts/ directory.
If a conda environment is used, you can copy this file to$CONDA_PREFIX/etc/conda/activate.d/to automatically load the completion upon environment activation.