Giter VIP home page Giter VIP logo

qchasm / aarontools.py Goto Github PK

View Code? Open in Web Editor NEW
34.0 4.0 7.0 7.77 MB

Python tools for automating routine tasks encountered when running quantum chemistry computations.

Home Page: https://aarontools.readthedocs.io/en/latest/

License: GNU General Public License v3.0

Python 99.01% DIGITAL Command Language 0.99%
quantum-chemistry-automation density-functional-theory quantum-chemistry catalysis python computational-chemistry dft dft-calculations steric-parameters sterimol-parameters

aarontools.py's Introduction

PyPI version Documentation Status

AaronTools.py

AaronTools provides a collection of tools for automating routine tasks encountered when running quantum chemistry computations.

These tools can be used either directly within a Python script using AaronTools objects, or via a series of command-line scripts.

Documentation

AaronTools documenation, including tutorials on the Python API, can be found on our Read-the-Docs Page.

Installation

  • with pypi: pip install AaronTools

See the installation guide for more details, including how to manually install from this GitHub repository.

Citation

If you use AaronTools, please cite:

V. M. Ingman, A. J. Schaefer, L. R. Andreola, and S. E. Wheeler "QChASM: Quantum Chemistry Automation and Structure Manipulation" WIREs Comp. Mol. Sci. 11, e1510 (2021)

Features

AaronTools has a wide variety of features that can be accessed through the Python API as well as command line scripts (CLSs). These features include, but are not limited to:

Features are explained in more detail in the documentation and in docstrings of the Python API.

Other Versions

ChimeraX Plugin

The majority of these features are also available with a graphical interface in the SEQCROW plugin for ChimeraX.

Perl

A Perl implementation of AaronTools is also available here. However, users are strongly urged to use the Python version since it has far more powerful features and, unlike the Perl version, will continue to be developed and supported.

Contact

If you have any questions or would like to discuss bugs or additional needed features, feel free to contact us at [email protected]

aarontools.py's People

Contributors

ajs99778 avatar landreola avatar swheele2 avatar vingman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

aarontools.py's Issues

problem parsing

AaronTools raises an error when reading this file.

gemfi_beta_uTS_22.out.zip

fr = FileReader(path, get_all=True, just_geom=False)

ValueError: could not convert string to float: 'SPECTRUM'

For what it is worth, this closely related job is read without problems.
gemfi_beta_uTS_21.out.zip

Given that the ValueError looks related to the frequencies, it is notable that gemfi_beta_uTS_22.out has two imaginary frequencies.

A bug in the AaronTools.geometry.Geometry.map_ligand() function

Hello, dear developers of AaronTools,

I am using the python version of AaronTools to map new ligands on the TS template, but I encountered a bug of the map_ligand() function here.

The substrates of the reaction will rotate after the ligand mapped (changes in position), especially for cases where two substrates are separated. This error does not occur when the reaction substrate is a whole. Below are pictures of the bug I encountered.

  1. Here is the situation where substrates (reactants) are a whole, no bug:
    tsa1:
    tsa1
    tsa1 after mapping:
    tsa1_map
    tsa1 and tsa1_mapped overlap together:
    tsa1-tsa1_amp

  2. Here is the situation where reactants are separated, a substrates movement bug will occur:
    ts1:
    Inkedts1_LI
    ts1 after mapping:
    Inkedts1_map_LI
    ts1 and ts1_mapped overlap together:
    ts1-ts1_map
    bug here:
    rotation_bug

That's all, the bug of this problem may be in geometry.py, but I can't solve it without your help. In addition, I also found that the "minimize" parameter in the map_ligand() function seems to be invalid, and when I set it to "True" and "False", there is no difference in the mapping results.

Looking forward to your reply, thank you!

Gaussian 16 log file doesn't parse correctly

Good day! I'm trying to implement AaronTools for local web server on our computational machine and currently i'm working on status check of calculation. When i'm trying to read file via FileReader class and try to check "finished" attrbute it's always equals "False", however end of .log file declares "Normal termination of Gaussian". Maybe i'm doing something wromg. Can you, please, provide some clarity about it?

Update: I've figured it out. if numpy version >1.23.5 and flag "just_geom" == false then error is raised duing parsing. Looks like np.float in spectrum script is causing problems

int grids ORCA 5

The theory tools for defining grids are not fully compatible with ORCA 5.0.3

when grids are set to'ultrafine', AaronTools writes ORCA inputs with:

%method
    AngularGrid  Lebedev590
    IntAcc            4.0
end

ORCA 5 uses 6 instead of Lebedev590.

Likewise 'superfinegrid' writes ! Grid7 FinalGrid7 which is not recognized in ORCA 5.0.3. The largest default grid in ORCA 5.0.3 is ! DefGrid3

Hashing and comparison

Hello again,

This is more of an open comment. Is there a native way to do comparisons/sorting between Geometry objects?

I think it would be useful to make Geometry objects (as well as Atoms) hashable based on their coordinates, and define an eq method, so that you could do quick comparisons between Geometry(es) using the standard python operators, or use Geometry(es) as dictionary keys to store QM properties. Is this something that sounds reasonable? I could potentially code the snippet if you feel it's coherent design-wise.

Thanks in advance, I don't want to come across as pushy - just an enthusiastic user!

Regards,

I failed map ligands in a purely organic system.

Hello, dear developers,

I am trying to use AaronTools.py to map ligands in a purely organic system (The TS template system I have tried is "Vinyl_boronic_acid_addition" reaction R/ts1.xyz in the code folder of AARON) it cannot give me a correct result. Results only the ligand which I want to add in the TS structure. So I tried to used perl version AaronTools, below is the perl program reporting error.

微信截图_20231010195010

So how could I specify the ligand atoms in the .xyz file? Is there any other way to map ligands by AaronTools python script in this purely organic reaction?

B2PLYP-D3 = B2PLYPD3

the hyphenated version is in ORCA. Would be nice if they were both accessible via the same keyword.

substitute using IUPAC/SMILES is buggy

A couple of bugs in substitute.py when using IUPAC or SMILES to specify substituent name.

  1. For some substituents the substituent is attached opposite the group being replaced.
    For example,
    fetchMolecule.py -i methane | substitute.py -s 2=iupac:phenyl
    works fine, but
    fetchMolecule.py -i methane | substitute.py -s 2=iupac:methyl
    does not.

  2. You can't specify a list of atoms to be substituted when using substituent from string.
    fetchMolecule.py -i methane | substitute.py -s 2,3=Ph
    works fine but
    fetchMolecule.py -i methane | substitute.py -s 2,3=iupac:phenyl
    does not.

Small bug in SubmitProcess

Hello,

Thanks for developing this library. I, for one, am excited to see Aaron2 come along.

I think that there is a small error in SubmitProcess for SLURM:

        elif QUEUE_TYPE == "SLURM":
            args = ["sbatch", "<", job_file]

the "<" should be removed, as far as I known, because the submission command is simply sbatch job_file. At least this is what works in my cluster at the moment.

Thanks in advance!

Better consistency between ORCA and Gaussian inputs

For ORCA inputs using "Gaussian's B3LYP", automatically include "NoCosx" keyword to more closely match Gaussian results (ORCA uses RIJCOSX by default).
Similarly, add option to do "ORCA's 6-31G*" that requests Gaussian use 6-31G(d) with 5d/7f rather than the default 6d/10f, and similar for other Pople-style basis sets.

parsing ORCA double hybrid with RI

FilerReader has problems with ORCA outputs computed with double hybrid methods using the (default) RI approximation

I could not open files that used
! pwpb95 def2-qzvpp def2-qZVPP/C tightscf or ! dsd-pbep86 d3 def2-qzvpp def2-qZVPP/C tightscf

Notably, I could open files that used a double hybrid method without the RI approximation, eg
! dsd-pbep86 d3 def2-qzvpP def2-qZVPP/C tightscf noRI

The difference is in the line
RI-MP2 CORRELATION ENERGY: -1.414209774 Eh with RI versus
MP2 CORRELATION ENERGY : -1.414382553 Eh without RI

I think the error basically boils down to the fact that there is no space separating ENERGY and : in
RI-MP2 CORRELATION ENERGY: whereas there is a space in
MP2 CORRELATION ENERGY :

File ~/anaconda3/envs/python/lib/python3.10/site-packages/AaronTools/fileIO.py:1105, in FileReader.read_file(self, get_all, just_geom, scan_read_all, freq_name, conf_name, nbo_name, max_length)
   1103     self.read_mol2(f)
   1104 elif self.file_type == "out":
...
-> 1686     item = line.split()[-6] + " correlation energy"
   1687     self.other[item] = float(line.split()[-2])
   1689 elif re.match("E\(\S+\)\s+...\s+-?\d+\.\d+$", line):

IndexError: list index out of range

all_geom

Does fr.all_geom access all geometries except the final geometry? The following ORCA job has 5 geometries and fr.all_geom accesses four of them.

! m062x 6-31+G** opt freq

* xyz 0 1
O   0.0000   0.0000   0.0000
H   1.0000   0.0000   0.0000
H   0.0000   1.0000   0.0000
*

This became confusing when parsing outputs of compound jobs, eg

* xyz 0 1
O   0.0000   0.0000   0.0000
H   1.0000   0.0000   0.0000
H   0.0000   1.0000   0.0000
*

%compound

New_Step
! m062x 6-31+G** opt freq # job1
Step_End

New_Step
! m062x 6-311+G** # job2
Step_End

New_Step
! b3lyp def2-tzvp # job3
Step_End
End

In this example:

fr = FileReader(path, get_all=True, just_geom=False)

ejob1 = fr.all_geom[-2][1]['energy']
ejob2 = fr.all_geom[-1][1]['energy']
ejob3 = fr['energy']

It would have helped me if the documentation said something like fr.all_geom returns the attributes of all geometries except the final geometry in the output.

(In the %compound job above, this is complicated by the fact that the last three single point energies in the file all correspond different calculations on the same geometry.)

thermochem error for T = 0K

We seem to be catching T = 0K as a special case, but then treating it incorrectly.
At 0K, H and G are equal to E + ZPVE, not E.

(To convince yourself of this, compare the output from grabThermo.py at T = 0 and T = 0.000001)

Radii for lanthanides/actinides

AaronTools is missing radii for the lanthanides and actinides, which prevents SEQCROW from opening ORCA output files for molecules containing such atoms.

basis/ecp

Part 1:

basis = BasisSet(
                [Basis(def2-svp, ['all', '!Ru']),
                 Basis('sdd', 'tm')], 
                [ECP("sdd", 'tm')])

for Gaussian files gives,

C H N O 0
6-31g*
****
Ru 0
sdd
****

Ru 0
sdd

and for ORCA files gives,

%basis
    newGTO            Ru "sdd" end
    newECP            Ru "sdd" end
end

This works for the Gaussian job, but ORCA will error out with Error: Pure ECPs not allowed in GTO definition

The ORCA job will work with

! b3lyp 6-31G*
%basis
    newECP            Ru "sdd" end
    newGTO            Ru "def2-svp" end
end

or with

! b3lyp def2-svp
%basis
    newECP            Ru "sdd" end
end

Part 2

basis = BasisSet(
                [Basis(def2-svp, AnyNonTransitionMetal),
                 Basis('lanl2dz', 'tm')], 
                [ECP("lanl2dz", 'tm')])

gives an error

File ~/anaconda3/envs/python/lib/python3.10/site-packages/AaronTools/theory/basis.py:149, in Basis.__init__(self, name, elements, aux_type, user_defined, oniom_layer, atoms)
    146     ele = ele.lstrip("!")
    147     not_any = True
--> 149 if ele.lower() == "all":
    150     if not_any:
    151         not_anys.append(AnyTransitionMetal())

AttributeError: type object 'AnyNonTransitionMetal' has no attribute 'lower'

The same problem arrises for AnyTransitionMetal


Part 3 (not important to me, but thought it would be worth reporting)

basis = BasisSet(
                [Basis(def2-svp, ['all', '!Ru']),
                 Basis('lanl2dz', 'tm')], 
                [ECP("lanl2dz", 'tm')])

for Gaussian files gives,

C H N O 0
6-31g*
****
Ru 0
lanl2dz
****

Ru 0
lanl2dz

and the orca file gives

%basis
    newGTO            Ru "lanl2dz" end
    newECP            Ru "lanl2dz" end
end

This works for the Gaussian file, but fails for ORCA with Unknown ECP requested! Please consult the manual for available ECPs.
The ORCA job will run with,

%basis
    newGTO            Ru "lanl2dz" end
    newECP            Ru "HayWadt" end
end

Loading Gaussian16 Scan

I am not entirely sure if this is a bug or not but when I load a gaussian 16 scan file it loads "all" of the structures and not just the "optimized" ones along the path (so a 72 point scan ends up having over 500 structures). Is there anyway to fix this? (ChimeraX1.4 and most recent SEQCROW on mac)

Thanks a bunch!

write orca SMD

When I use solvent = ImplicitSolvent("SMD", "water") to write an ORCA input file, the resulting file contains

! CPCM(water)
%cpcm
    smd    true
end

This input raises an error in ORCA 5.0.3

	 Error: Missing keyword in CPCM block
	 Missing keyword : SMDsolvent

A functional input looks like

! CPCM
%cpcm
    smd    true
    SMDsolvent "water"
end

It is fine to work around this by adding ORCA_BLOCKS={'cpcm':['SMDsolvent "water"']} to 'geom.write'. It would be nice if this was built in.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.