Goodman-lab / DP5

Python workflow for DP5 and DP4 analysis of organic molecules
Other
173 stars 99 forks source link

openbabel fail #46

Closed gkxiao closed 3 years ago

gkxiao commented 3 years ago
  1. Command

    PyDP4.py -w moenas -m t -f mmff ANPN-D-4-60 NMRexp
    
  2. Results

    ==========================
    PyDP4 script,
    integrating Tinker/MacroModel,
    Gaussian/NWChem and DP4
    v1.0
    

Copyright (c) 2015-2019 Kristaps Ermanis, Alexander Howarth, Jonathan M. Goodman Distributed under MIT license

Settings read from settings.cfg: TinkerPath: /home/cloudam/software/tinker NWChemPath: /public/software/.local/easybuild/software/NWChem/7.0.0-intel-2019b-Python-3.7.4/bin/nwchem GausPath: g16 ['ANPN-D-4-60'] NMRexp NMR_path /home/cloudam/work/dp4/tinker/NMRexp Current working directory: /home/cloudam/work/dp4/tinker Initial input files: ['ANPN-D-4-60'] NMR file: [PosixPath('/home/cloudam/work/dp4/tinker/NMRexp/Carbon'), PosixPath('/home/cloudam/work/dp4/tinker/NMRexp/Proton')] Workflow: moenas Generated input files: ['ANPN-D-4-60']

Assuming all computations are done? ... False Using preexisting DFT data? ... False Performing conformational search using Tinker

Setting up Tinker files... Tinker input for ANPN-D-4-60 prepared.

Running Tinker... Output files for ANPN-D-4-60 already exist, skipping. ANPN-D-4-60 is matching conformational search output for ANPN-D-4-60 Reading ANPN-D-4-60 Number of accepted conformers by energies: 3

Pruning conformers... ANPN-D-4-60: 3 conformers after pruning with 0A RMSD cutoff

Setting up geometry optimization calculations...

Running geometry optimization calculations...

Running Gaussian DFT geometry optimizations locally... There were no jobs to run.

Reading DFT optimized geometries...

Setting up energy calculations...

Running energy calculations...

Running Gaussian DFT energy calculations locally... There were no jobs to run.

Reading data from the output files... Energies: ANPN-D-4-60: [-884.521215126, -884.527271401, -884.527271572]

Setting up NMR calculations...

Running NMR calculations...

Running Gaussian DFT NMR calculations locally... There were no jobs to run.

Reading data from the output files... ANPN-D-4-60ginp001.out 39 ANPN-D-4-60ginp002.out 39 ANPN-D-4-60ginp003.out 39 Shieldings: ANPN-D-4-60: [62.3194, 60.3087, 51.997, 23.6829, 73.2423, 43.2175, 164.7148, 139.8852, 63.7769, 105.4664, 161.8472, 179.3392, 275.6734, 148.0947, 105.6224, 96.5315, 276.0126, 165.2217, 160.5147, 24.8764, 25.4464, 25.3536, 30.1592, 29.6195, 29.6452, 30.5386, 30.8459, 31.0085, 30.2244, 29.7763, 29.7107, 28.0947, 31.5766, 31.4717, 30.7825, 30.2332, 31.3648, 31.0032, 30.9445] [61.2745, 59.7375, 51.8604, 25.5316, 73.5456, 42.8489, 164.7852, 143.0776, 63.5141, 106.318, 161.7994, 180.8671, 276.0335, 147.9975, 106.9287, 94.5876, 271.0432, 163.3829, 160.6511, 24.8264, 25.5456, 25.2899, 30.1417, 29.6307, 29.6567, 30.5276, 30.8155, 31.0478, 30.1424, 29.7762, 30.006, 28.199, 30.0001, 30.9683, 30.8965, 30.4719, 31.153, 31.0626, 30.8774] [61.2721, 59.7377, 51.8605, 25.5324, 73.5454, 42.8487, 164.7849, 143.086, 63.5146, 106.3177, 161.799, 180.8647, 276.0393, 147.9986, 106.928, 94.5878, 271.0428, 163.3817, 160.6509, 24.8264, 25.5456, 25.2899, 30.1416, 29.6311, 29.6564, 30.5275, 30.8155, 31.0477, 30.1423, 29.7764, 30.0061, 28.199, 29.9998, 30.9681, 30.8965, 30.4721, 31.1529, 31.0627, 30.8774] Energies: ANPN-D-4-60: [-884.521215126, -884.527271401, -884.527271572]

Setting TMS computational NMR shielding constant references Setting TMS references to 188.029225 and 32.1352666667

Converting DFT data to NMR shifts... [0.0008182710704141058, 0.4995456245645381, 0.49963610436504774] WARNING: NMR shift calculation currently ignores the instruction to exclude atoms from analysis C shifts for isomer 0: 126.779, 128.315, 136.194, 162.529, 114.506, 145.207, 23.249, 124.538, 81.727, 26.235, 40.039, 81.117, 93.458, 24.650, 27.383 H shifts for isomer 0: 7.309, 6.590, 6.846, 1.994, 2.504, 2.479, 1.608, 1.320, 1.088, 1.993, 2.359, 2.130, 3.936, 2.134, 1.167, 1.239, 1.664, 0.982, 1.073, 1.258

Reading experimental NMR data... [PosixPath('/home/cloudam/work/dp4/tinker/NMRexp/Carbon'), PosixPath('/home/cloudam/work/dp4/tinker/NMRexp/Proton')] Processing Spectrum autocorrelation distance = 3 convolution initial peak picking generating binary map estimating phase angles peak picking by region /home/cloudam/rdkit2020/lib/python3.6/site-packages/scipy/stats/_continuous_distns.py:354: RuntimeWarning: Mean of empty slice. loc = data.mean() /home/cloudam/rdkit2020/lib/python3.6/site-packages/numpy/core/_methods.py:170: RuntimeWarning: invalid value encountered in double_scalars ret = ret.dtype.type(ret / rcount) /home/cloudam/rdkit2020/lib/python3.6/site-packages/scipy/stats/_continuous_distns.py:359: RuntimeWarning: Mean of empty slice. scale = np.sqrt(((data - loc)**2).mean()) Linear regression final phasing /home/cloudam/rdkit2020/lib/python3.6/site-packages/scipy/interpolate/fitpack2.py:627: ComplexWarning: Casting complex values to real discards the imaginary part xe=bbox[1], s=0) length y data 130792 length xdata 130792 Processing Spectrum autocorrelation distance = 7 done done done corrected peak picking gradient peak picking done resetting region boundries, distance = 490 done region 1of50 done region 2of50 done region 3of50 done region 4of50 done region 5of50 done region 6of50 done region 7of50 done region 8of50 done region 9of50 done region 10of50 done region 11of50 done region 12of50 done region 13of50 done region 14of50 done region 17of50 done region 18of50 done region 16of50 done region 15of50 done region 19of50 done region 20of50 done region 21of50 done region 22of50 done region 23of50 done region 24of50 done region 25of50 done region 26of50 done region 28of50 done region 27of50 done region 29of50 done region 30of50 done region 31of50 done region 32of50 done region 33of50 done region 34of50 done region 35of50 done region 36of50 done region 37of50 done region 38of50 done region 41of50 done region 42of50 done region 43of50 done region 44of50 done region 46of50 done region 45of50 done region 48of50 done region 50of50 done region 49of50 done region 40of50 done region 39of50 done region 47of50 minimisation time = 0.3921358108520508 mins simulating spectrum number of protons = 20

*** Open Babel Error in ReadFile Cannot read from ANPN-D-4-60 number of labile protons = 0 exact [0.01, 0.01, 0.04, 0.51, 0.02, 0.11, 0.02, 0.02, 0.04, 0.03, 14.69, 14.53, 0.02, 0.08, 0.37, 0.16, 0.03, 0.4, 0.05, 0.59, 0.01, 0.49, 281.46, 0.49, 1.35, 11.11, 0.01, 0.01, 0.02, 0.2, 10.55, 11.59, 144.65, 0.05, 0.71, 0.53, 0.01, 0.04, 1.18, 0.32, 16.83, 10.61, 269.95, 141.41, 13.07, 2.82, 1.49, 2.32, 0.24] the best fit number of protons is 24 /home/cloudam/software/DP4-AI/Proton_processing.py:1581: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray whdel = np.where(picked_peaks == peaks_to_remove) /home/cloudam/software/DP4-AI/Proton_processing.py:1581: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray whdel = np.where(picked_peaks == peaks_to_remove) /home/cloudam/rdkit2020/lib/python3.6/site-packages/numpy/core/_asarray.py:83: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray return array(a, dtype, copy=False, order=order) /home/cloudam/rdkit2020/lib/python3.6/site-packages/numpy/core/_asarray.py:83: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray return array(a, dtype, copy=False, order=order) /home/cloudam/rdkit2020/lib/python3.6/site-packages/numpy/core/_asarray.py:83: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray return array(a, dtype, copy=False, order=order)

Assigning carbon spectrum...

Plotting carbon spectrum... qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found. This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: eglfs, minimal, minimalegl, offscreen, vnc, webgl, xcb.

Aborted

  1. Problem

A open babel error occurs showed as following:

minimisation time = 0.3921358108520508 mins
simulating spectrum
     number of protons = 20
==============================
*** Open Babel Error  in ReadFile
  Cannot read from ANPN-D-4-60
     number of labile protons = 0
KristapsE commented 3 years ago

From the output it looks like the calculations finished normally, and the problem is with NMR analysis or/and the visualization side of the things. I will therefore let @HowarthA weigh in, as he is much more familiar with those parts of the code.

Could you perhaps do 'tree' on the job folder and post the output here? Would help us verify that all the expected files are there.

Also openbabel version would be useful to know - I have tested the calculations with the new OpenBabel v3.0, but I'm not entirely sure about the NMR analysis.

Finally - have you tried running the analysis on one of the datasets from the paper? I understand those are entirely different software packages, but it would help verify that your installation is able to get through the analysis, if it has all the right input data. It would also give you more familiarity with how a job folder should look like after a successful computation run. The data can be found at https://www.repository.cam.ac.uk/handle/1810/303161

gkxiao commented 3 years ago

Hi Kristaps,

Here is the tree results:

(/home/cloudam/rdkit2020) [cloudam@master tinker]$ tree
.
├── ANPN-D-4-60.arc
├── ANPN-D-4-60.key
├── ANPN-D-4-60.sdf
├── ANPN-D-4-60.tout
├── ANPN-D-4-60.xyz
├── cmd.log
├── e
│   ├── ANPN-D-4-60ginp001.chk
│   ├── ANPN-D-4-60ginp001.com
│   ├── ANPN-D-4-60ginp001_err.31
│   ├── ANPN-D-4-60ginp001.out
│   ├── ANPN-D-4-60ginp001_out.31
│   ├── ANPN-D-4-60ginp001.sbatch
│   ├── ANPN-D-4-60ginp002.chk
│   ├── ANPN-D-4-60ginp002.com
│   ├── ANPN-D-4-60ginp002_err.32
│   ├── ANPN-D-4-60ginp002.out
│   ├── ANPN-D-4-60ginp002_out.32
│   ├── ANPN-D-4-60ginp002.sbatch
│   ├── ANPN-D-4-60ginp003.chk
│   ├── ANPN-D-4-60ginp003.com
│   ├── ANPN-D-4-60ginp003_err.33
│   ├── ANPN-D-4-60ginp003.out
│   ├── ANPN-D-4-60ginp003_out.33
│   └── ANPN-D-4-60ginp003.sbatch
├── Graphs
│   └── ANPN-D-4-60
├── nmr
│   ├── ANPN-D-4-60ginp001.chk
│   ├── ANPN-D-4-60ginp001.com
│   ├── ANPN-D-4-60ginp001_err.34
│   ├── ANPN-D-4-60ginp001.out
│   ├── ANPN-D-4-60ginp001_out.34
│   ├── ANPN-D-4-60ginp001.sbatch
│   ├── ANPN-D-4-60ginp002.chk
│   ├── ANPN-D-4-60ginp002.com
│   ├── ANPN-D-4-60ginp002_err.35
│   ├── ANPN-D-4-60ginp002.out
│   ├── ANPN-D-4-60ginp002_out.35
│   ├── ANPN-D-4-60ginp002.sbatch
│   ├── ANPN-D-4-60ginp003.chk
│   ├── ANPN-D-4-60ginp003.com
│   ├── ANPN-D-4-60ginp003_err.36
│   ├── ANPN-D-4-60ginp003.out
│   ├── ANPN-D-4-60ginp003_out.36
│   └── ANPN-D-4-60ginp003.sbatch
├── NMRexp
│   ├── Carbon
│   │   ├── acqu
│   │   ├── acqu_1
│   │   ├── acqus
│   │   ├── acqus_1
│   │   ├── audita_1.txt
│   │   ├── audita.txt
│   │   ├── cpdprg2
│   │   ├── cpdprg2_1
│   │   ├── fid
│   │   ├── fid_1
│   │   ├── format_1.temp
│   │   ├── format.temp
│   │   ├── fq1list
│   │   ├── fq1list_1
│   │   ├── pdata
│   │   │   └── 1
│   │   │       ├── 1i
│   │   │       ├── 1i_1
│   │   │       ├── 1r
│   │   │       ├── 1r_1
│   │   │       ├── auditp_1.txt
│   │   │       ├── auditp.txt
│   │   │       ├── outd
│   │   │       ├── outd_1
│   │   │       ├── proc
│   │   │       ├── proc_1
│   │   │       ├── procs
│   │   │       ├── procs_1
│   │   │       ├── thumb_1.png
│   │   │       ├── thumb.png
│   │   │       ├── title
│   │   │       └── title_1
│   │   ├── prosol_History
│   │   ├── prosol_History_1
│   │   ├── pulseprogram
│   │   ├── pulseprogram_1
│   │   ├── scon2
│   │   ├── scon2_1
│   │   ├── shimvalues
│   │   ├── shimvalues_1
│   │   ├── specpar
│   │   ├── specpar_1
│   │   ├── uxnmr_1.info
│   │   ├── uxnmr_1.par
│   │   ├── uxnmr.info
│   │   └── uxnmr.par
│   └── Proton
│       ├── acqu
│       ├── acqu_1
│       ├── acqus
│       ├── acqus_1
│       ├── audita_1.txt
│       ├── audita.txt
│       ├── fid
│       ├── fid_1
│       ├── format_1.temp
│       ├── format.temp
│       ├── fq1list
│       ├── fq1list_1
│       ├── pdata
│       │   └── 1
│       │       ├── 1i
│       │       ├── 1i_1
│       │       ├── 1r
│       │       ├── 1r_1
│       │       ├── auditp_1.txt
│       │       ├── auditp.txt
│       │       ├── outd
│       │       ├── outd_1
│       │       ├── proc
│       │       ├── proc_1
│       │       ├── procs
│       │       ├── procs_1
│       │       ├── thumb_1.png
│       │       ├── thumb.png
│       │       ├── title
│       │       └── title_1
│       ├── prosol_History
│       ├── prosol_History_1
│       ├── pulseprogram
│       ├── pulseprogram_1
│       ├── scon2
│       ├── scon2_1
│       ├── shimvalues
│       ├── shimvalues_1
│       ├── specpar
│       ├── specpar_1
│       ├── uxnmr_1.info
│       ├── uxnmr_1.par
│       ├── uxnmr.info
│       └── uxnmr.par
├── opt
│   ├── ANPN-D-4-60ginp001.chk
│   ├── ANPN-D-4-60ginp001.com
│   ├── ANPN-D-4-60ginp001_err.28
│   ├── ANPN-D-4-60ginp001.out
│   ├── ANPN-D-4-60ginp001_out.28
│   ├── ANPN-D-4-60ginp001.sbatch
│   ├── ANPN-D-4-60ginp002.chk
│   ├── ANPN-D-4-60ginp002.com
│   ├── ANPN-D-4-60ginp002_err.29
│   ├── ANPN-D-4-60ginp002.out
│   ├── ANPN-D-4-60ginp002_out.29
│   ├── ANPN-D-4-60ginp002.sbatch
│   ├── ANPN-D-4-60ginp003.chk
│   ├── ANPN-D-4-60ginp003.com
│   ├── ANPN-D-4-60ginp003_err.30
│   ├── ANPN-D-4-60ginp003.out
│   ├── ANPN-D-4-60ginp003_out.30
│   └── ANPN-D-4-60ginp003.sbatch
└── Pickles
    └── ANPN-D-4-60
        ├── carbondata
        └── protondata

14 directories, 148 files

HowarthA commented 3 years ago

Hi, It does look like all your files are present and everything has run correctly. Openbabel likes to complain but it has read the .sdf file because DP4-AI has worked out how many protons your structure has. The NMR analysis has finished since it is trying to plot the spectra. The problem must reside in the final visualisation and it seems to be coming from pyqt, "qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found." This might be an issue with your pyqt installation, more specifically it looks like pyqt is unsure where to look for the required plugins, are you running this inside a conda environment?

gkxiao commented 3 years ago

Hi Kristaps:

Yes, I run the DP4-AI under conda environmnet.

I try to reproduce the case of IP4 from your paper. Here is the results.

  1. command

    PyDP4.py -s chloroform -w gmns -m t -f mmff  -OutputFolder MM -S /none  IP4_.sdf NMR_folder
    
  2. output

    ==========================
    PyDP4 script,
    integrating Tinker/MacroModel,
    Gaussian/NWChem and DP4
    v1.0
    

Copyright (c) 2015-2019 Kristaps Ermanis, Alexander Howarth, Jonathan M. Goodman Distributed under MIT license

Settings read from settings.cfg TinkerPath: /home/cloudam/software/tinker NWChemPath: /public/software/.local/easybuild/software/NWChem/7.0.0-intel-2019b-Python-3.7.4/bin/nwchem GausPath: g16 ['IP4_.sdf'] NMR_folder NMR_path /home/cloudam/work/dp4/IP4_tinker/NMR_folder Current working directory: /home/cloudam/work/dp4/IP4tinker Initial input files: ['IP4.sdf'] NMR file: [PosixPath('/home/cloudam/work/dp4/IP4_tinker/NMR_folder/Carbon'), PosixPath('/home/cloudam/work/dp4/IP4_tinker/NMR_folder/Proton')] Workflow: gmns

Generating diastereomers... Getting inchi from file IP4.sdf Getting inchi from file IP4.sdf Number of diastereomers to be generated: 2 Isomer 0 inchi = InChI=1S/C6H10O/c1-5-3-2-4-6(5)7/h2-3,5-7H,4H2,1H3/t5-,6-/m0/s1/f/ Isomer 1 inchi = InChI=1S/C6H10O/c1-5-3-2-4-6(5)7/h2-3,5-7H,4H2,1H3/t5-,6+/m0/s1/f/ Generated input files: ['IP4_1', 'IP4_2']

Assuming all computations are done? ... False Using preexisting DFT data? ... False Performing conformational search using Tinker

Setting up Tinker files... Tinker input for IP4_1 prepared. Tinker input for IP4_2 prepared.

Running Tinker... /home/cloudam/software/tinker/bin/scan IP4_1 /home/cloudam/software/tinker/params/mmff.prm 0 10 20 0.00001 | tee ./IP4_1.tout Tinker job 1 of 2 completed. /home/cloudam/software/tinker/bin/scan IP4_2 /home/cloudam/software/tinker/params/mmff.prm 0 10 20 0.00001 | tee ./IP4_2.tout Tinker job 2 of 2 completed. IP4_1 is matching conformational search output for IP4_1 Reading IP4_1 Number of accepted conformers by energies: 3 IP4_2 IP4_1 Nope IP4_1 IP4_2 Nope IP4_2 is matching conformational search output for IP4_2 Reading IP4_2 Number of accepted conformers by energies: 5

Pruning conformers... IP4_1: 3 conformers after pruning with 0A RMSD cutoff IP4_2: 5 conformers after pruning with 0A RMSD cutoff

Setting up NMR calculations...

Running NMR calculations...

Running Gaussian DFT NMR calculations locally... g16 < IP4_1ginp001.com > IP4_1ginp001.out Gaussian job 1 of 8 completed. g16 < IP4_1ginp002.com > IP4_1ginp002.out Gaussian job 2 of 8 completed. g16 < IP4_1ginp003.com > IP4_1ginp003.out Gaussian job 3 of 8 completed. g16 < IP4_2ginp001.com > IP4_2ginp001.out Gaussian job 4 of 8 completed. g16 < IP4_2ginp002.com > IP4_2ginp002.out Gaussian job 5 of 8 completed. g16 < IP4_2ginp003.com > IP4_2ginp003.out Gaussian job 6 of 8 completed. g16 < IP4_2ginp004.com > IP4_2ginp004.out Gaussian job 7 of 8 completed. g16 < IP4_2ginp005.com > IP4_2ginp005.out Gaussian job 8 of 8 completed. 8 Gaussian jobs completed successfully.

Reading data from the output files... IP4_1ginp001.out 17 IP4_1ginp002.out 17 IP4_1ginp003.out 17 IP4_2ginp001.out 17 IP4_2ginp002.out 17 IP4_2ginp003.out 17 IP4_2ginp004.out 17 IP4_2ginp005.out 17 Shieldings: IP4_1: [52.7722, 142.6171, 106.6766, 137.7624, 44.3868, 262.827, 169.0847, 29.3631, 29.358, 30.1239, 27.8744, 26.3857, 26.1915, 31.7494, 31.5088, 30.8564, 30.9325] [51.1922, 147.0431, 106.3846, 133.0215, 45.775, 264.1159, 169.3307, 29.4695, 29.7624, 29.6988, 27.8628, 26.3143, 26.2597, 31.6062, 31.5343, 30.9341, 31.0055] [52.137, 144.3506, 107.3824, 134.4597, 45.1125, 256.7894, 169.721, 29.3409, 29.4651, 29.8112, 28.2077, 26.3773, 26.2689, 30.9988, 31.5238, 30.8044, 30.9704] IP4_2: [52.5388, 147.5788, 111.0206, 142.2785, 45.1509, 290.3178, 172.6921, 29.6835, 29.5192, 29.4242, 27.249, 26.4213, 26.3882, 31.3379, 31.1798, 31.191, 31.1351] [53.7533, 143.4332, 112.0511, 142.9355, 44.3782, 280.9794, 172.8862, 29.8359, 29.2278, 29.4755, 27.2404, 26.4982, 26.3565, 31.3338, 31.2015, 31.1403, 30.7387] [51.0884, 141.8932, 111.8456, 140.8611, 45.4508, 282.0051, 173.2361, 29.7459, 29.3937, 29.3827, 28.0109, 26.3166, 26.4308, 31.3822, 30.8604, 31.2061, 30.909] [50.6992, 144.5118, 112.3286, 140.6304, 45.8269, 292.8349, 175.1699, 29.5901, 29.4615, 29.4456, 27.7753, 26.259, 26.4269, 31.5163, 30.8012, 31.0402, 31.2906] [52.0485, 140.3173, 112.6003, 140.7324, 44.5731, 275.5866, 174.18, 30.0199, 29.3096, 29.4031, 27.7075, 26.3135, 26.3433, 31.8847, 30.9336, 30.8427, 30.8826] Energies: IP4_1: [-309.846746815, -309.847000013, -309.84796168] IP4_2: [-309.846569715, -309.845282065, -309.847936169, -309.847324945, -309.845372601]

Setting TMS computational NMR shielding constant references Setting TMS references to 188.452125 and 32.1243166667

Converting DFT data to NMR shifts... [0.16868266031562812, 0.22056307264384922, 0.6107542670405226] [0.12478659650566838, 0.03190753672627494, 0.5305053012973622, 0.27768200381002867, 0.03511856166066578] WARNING: NMR shift calculation currently ignores the instruction to exclude atoms from analysis C shifts for isomer 0: 136.442, 43.808, 81.424, 53.763, 143.343, 18.928 H shifts for isomer 0: 2.751, 2.612, 2.285, 4.049, 5.760, 5.871, 0.865, 0.601, 1.283, 1.153 C shifts for isomer 1: 137.198, 45.137, 76.557, 47.425, 143.026, 14.728 H shifts for isomer 1: 2.417, 2.704, 2.715, 4.309, 5.805, 5.706, 0.694, 1.227, 0.981, 1.088

Reading experimental NMR data... [PosixPath('/home/cloudam/work/dp4/IP4_tinker/NMR_folder/Carbon'), PosixPath('/home/cloudam/work/dp4/IP4_tinker/NMR_folder/Proton')] Processing Spectrum autocorrelation distance = 3 convolution initial peak picking generating binary map estimating phase angles peak picking by region /home/cloudam/rdkit2020/lib/python3.6/site-packages/scipy/stats/_continuous_distns.py:354: RuntimeWarning: Mean of empty slice. loc = data.mean() /home/cloudam/rdkit2020/lib/python3.6/site-packages/numpy/core/_methods.py:170: RuntimeWarning: invalid value encountered in double_scalars ret = ret.dtype.type(ret / rcount) /home/cloudam/rdkit2020/lib/python3.6/site-packages/scipy/stats/_continuous_distns.py:359: RuntimeWarning: Mean of empty slice. scale = np.sqrt(((data - loc)**2).mean()) Linear regression final phasing /home/cloudam/rdkit2020/lib/python3.6/site-packages/scipy/interpolate/fitpack2.py:627: ComplexWarning: Casting complex values to real discards the imaginary part xe=bbox[1], s=0) length y data 130796 length xdata 130796 fit_s_peaks [78.67381419 78.35521334 78.03661249] Processing Spectrum autocorrelation distance = 7 done done done corrected peak picking gradient peak picking done resetting region boundries, distance = 588 done region 1of29 done region 2of29 done region 3of29 done region 4of29 done region 5of29 done region 6of29 done region 7of29 done region 8of29 done region 9of29 done region 10of29 done region 11of29 done region 12of29 done region 14of29 done region 15of29 done region 17of29 done region 19of29 done region 16of29 done region 22of29 done region 21of29 done region 18of29 done region 20of29 done region 23of29 done region 24of29 done region 27of29 done region 29of29 done region 26of29 done region 13of29 done region 28of29 done region 25of29 minimisation time = 3.0320031960805256 mins simulating spectrum number of protons = 10

*** Open Babel Error in ReadFile Cannot read from IP4_1 number of labile protons = 0 exact [0.22, 0.03, 0.17, 0.08, 0.4, 0.01, 0.09, 0.01, 0.06, 0.11, 0.26, 0.05, 242.06, 0.07, 1.04, 14.59, 0.34, 2.46, 0.46, 19.2, 9.77, 0.01, 109.45, 117.51, 265.26, 155.8, 62.4, 3.31, 0.26, 375.58, 2.1, 0.41] the best fit number of protons is 12 /home/cloudam/software/DP4-AI/Proton_processing.py:1581: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray whdel = np.where(picked_peaks == peaks_to_remove) /home/cloudam/software/DP4-AI/Proton_processing.py:1581: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray whdel = np.where(picked_peaks == peaks_to_remove) /home/cloudam/rdkit2020/lib/python3.6/site-packages/numpy/core/_asarray.py:83: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray return array(a, dtype, copy=False, order=order) /home/cloudam/rdkit2020/lib/python3.6/site-packages/numpy/core/_asarray.py:83: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray return array(a, dtype, copy=False, order=order) /home/cloudam/rdkit2020/lib/python3.6/site-packages/numpy/core/_asarray.py:83: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray return array(a, dtype, copy=False, order=order)

Assigning carbon spectrum...

Plotting carbon spectrum... qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found. This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: eglfs, minimal, minimalegl, offscreen, vnc, webgl, xcb.

Aborted

  1. files and folders
    .
    ├── cmd.log
    ├── IP4_1.arc
    ├── IP4_1.inchi
    ├── IP4_1.key
    ├── IP4_1.sdf
    ├── IP4_1.tout
    ├── IP4_1.xyz
    ├── IP4_2.arc
    ├── IP4_2.inchi
    ├── IP4_2.key
    ├── IP4_2.sdf
    ├── IP4_2.tout
    ├── IP4_2.xyz
    ├── IP4_.sdf
    ├── MM
    │   ├── Graphs
    │   │   └── IP4_1
    │   └── Pickles
    │       └── IP4_1
    │           ├── carbondata
    │           └── protondata
    ├── nmr
    │   ├── IP4_1ginp001.chk
    │   ├── IP4_1ginp001.com
    │   ├── IP4_1ginp001.out
    │   ├── IP4_1ginp002.chk
    │   ├── IP4_1ginp002.com
    │   ├── IP4_1ginp002.out
    │   ├── IP4_1ginp003.chk
    │   ├── IP4_1ginp003.com
    │   ├── IP4_1ginp003.out
    │   ├── IP4_2ginp001.chk
    │   ├── IP4_2ginp001.com
    │   ├── IP4_2ginp001.out
    │   ├── IP4_2ginp002.chk
    │   ├── IP4_2ginp002.com
    │   ├── IP4_2ginp002.out
    │   ├── IP4_2ginp003.chk
    │   ├── IP4_2ginp003.com
    │   ├── IP4_2ginp003.out
    │   ├── IP4_2ginp004.chk
    │   ├── IP4_2ginp004.com
    │   ├── IP4_2ginp004.out
    │   ├── IP4_2ginp005.chk
    │   ├── IP4_2ginp005.com
    │   └── IP4_2ginp005.out
    └── NMR_folder
    ├── Carbon
    │   ├── acqu
    │   ├── acqus
    │   ├── audita.txt
    │   ├── cpdprg2
    │   ├── fid
    │   ├── format.temp
    │   ├── fq1list
    │   ├── pdata
    │   │   └── 1
    │   │       ├── 1i
    │   │       ├── 1r
    │   │       ├── auditp.txt
    │   │       ├── outd
    │   │       ├── proc
    │   │       ├── procs
    │   │       ├── thumb.png
    │   │       └── title
    │   ├── pulseprogram
    │   ├── scon2
    │   ├── shimvalues
    │   ├── specpar
    │   ├── uxnmr.info
    │   └── uxnmr.par
    ├── corr_distance
    ├── grouped_peaks
    ├── peak_regions
    ├── picked_peaks
    ├── Proton
    │   ├── acqu
    │   ├── acqus
    │   ├── audita.txt
    │   ├── fid
    │   ├── format.temp
    │   ├── fq1list
    │   ├── pdata
    │   │   └── 1
    │   │       ├── 1i
    │   │       ├── 1r
    │   │       ├── auditp.txt
    │   │       ├── outd
    │   │       ├── proc
    │   │       ├── procs
    │   │       ├── thumb.png
    │   │       └── title
    │   ├── pulseprogram
    │   ├── scon2
    │   ├── shimvalues
    │   ├── specpar
    │   ├── uxnmr.info
    │   └── uxnmr.par
    ├── region_params
    ├── spectral_xdata_ppm
    ├── spectral_ydata
    ├── threshold
    ├── total_params
    ├── total_spectral_ydata
    └── uc

13 directories, 92 files

It seems that there is still some thing wrong with the experimental NMR processing. Is the GUI required to extract experiment NMR data?

KristapsE commented 3 years ago

As @HowarthA mentioned, this still looks like a faulty PyQt installation or something else wrong with your python environment or libraries. I don't think GUI is required for extracting the NMR data, but it is probably required for plotting the results. Can the script access the display or perhaps you are running it in an ssh session? Perhaps one of these threads are of help?

https://forum.qt.io/topic/93247/qt-qpa-plugin-could-not-load-the-qt-platform-plugin-xcb-in-even-though-it-was-found/14

https://forum.qt.io/topic/111553/solved-qt-qpa-plugin-could-not-find-the-qt-platform-plugin-xcb-in

HowarthA commented 3 years ago

From what I can find, it seems this problem can arise when the versions of Qt on your system and anaconda don't match up. Since you are not using the GUI, it must be matplotlib that is calling Qt and failing, in which case could you try adding:

import matplotlib matplotlib.use('Agg')

At the top of Carbon_plotting.py and Proton_plotting.py

This will force matplotlib to use the Agg backend and might stop it from calling any Qt code on your computer.
if this doesn't work have a look at this thread, where reinstalling qt etc has seemed to help.

https://stackoverflow.com/questions/33051790/could-not-find-or-load-the-qt-platform-plugin-xcb

hope this helps

gkxiao commented 3 years ago

Hi Howarth,

It works. Thank you very much.

And Here is the IP4 case:

PyDP4.py -s chloroform -w gmns -m t -f mmff IP4_.sdf NMR_folder
==========================
PyDP4 script,
integrating Tinker/MacroModel,
Gaussian/NWChem and DP4
v1.0

Copyright (c) 2015-2019 Kristaps Ermanis, Alexander Howarth, Jonathan M. Goodman
Distributed under MIT license
==========================

Settings read from settings.cfg:

  TinkerPath: /home/cloudam/software/tinker
  NWChemPath: /public/software/.local/easybuild/software/NWChem/7.0.0-intel-2019b-Python-3.7.4/bin/nwchem
  GausPath: g16
['IP4_.sdf']
NMR_folder
NMR_path
/home/cloudam/work/dp4/IP4_tinker/NMR_folder
Current working directory: /home/cloudam/work/dp4/IP4_tinker
Initial input files: ['IP4_.sdf']
NMR file: [PosixPath('/home/cloudam/work/dp4/IP4_tinker/NMR_folder/Carbon'), PosixPath('/home/cloudam/work/dp4/IP4_tinker/NMR_folder/Proton')]
Workflow: gmns

Generating diastereomers...
Getting inchi from file  IP4_.sdf
Getting inchi from file  IP4_.sdf
Number of diastereomers to be generated: 2
Isomer 0 inchi = InChI=1S/C6H10O/c1-5-3-2-4-6(5)7/h2-3,5-7H,4H2,1H3/t5-,6-/m0/s1/f/
Isomer 1 inchi = InChI=1S/C6H10O/c1-5-3-2-4-6(5)7/h2-3,5-7H,4H2,1H3/t5-,6+/m0/s1/f/
Generated input files: ['IP4_1', 'IP4_2']

Assuming all computations are done? ...  False
Using preexisting DFT data? ...  False
Performing conformational search using Tinker

Setting up Tinker files...
Tinker input for IP4_1 prepared.
Tinker input for IP4_2 prepared.

Running Tinker...
Output files for IP4_1 already exist, skipping.
Output files for IP4_2 already exist, skipping.
IP4_1 is matching conformational search output for IP4_1
Reading IP4_1
Number of accepted conformers by energies: 3
IP4_2 IP4_1 Nope
IP4_1 IP4_2 Nope
IP4_2 is matching conformational search output for IP4_2
Reading IP4_2
Number of accepted conformers by energies: 5

Pruning conformers...
IP4_1: 3 conformers after pruning with 0A RMSD cutoff
IP4_2: 5 conformers after pruning with 0A RMSD cutoff

Setting up NMR calculations...

Running NMR calculations...

Running Gaussian DFT NMR calculations locally...
There were no jobs to run.

Reading data from the output files...
IP4_1ginp001.out 17
IP4_1ginp002.out 17
IP4_1ginp003.out 17
IP4_2ginp001.out 17
IP4_2ginp002.out 17
IP4_2ginp003.out 17
IP4_2ginp004.out 17
IP4_2ginp005.out 17
Shieldings:
IP4_1:
[52.7725, 142.6171, 106.6767, 137.7624, 44.3868, 262.8271, 169.0847, 29.3631, 29.358, 30.1239, 27.8744, 26.3857, 26.1914, 31.7494, 31.5088, 30.8564, 30.9325]
[51.1922, 147.0432, 106.3846, 133.0215, 45.7752, 264.1163, 169.3307, 29.4695, 29.7625, 29.6988, 27.8628, 26.3143, 26.2597, 31.6062, 31.5343, 30.9341, 31.0055]
[52.1369, 144.3506, 107.3824, 134.4598, 45.1125, 256.7895, 169.721, 29.3409, 29.4651, 29.8111, 28.2077, 26.3773, 26.2689, 30.9988, 31.5238, 30.8044, 30.9704]
IP4_2:
[52.5388, 147.5788, 111.0206, 142.2785, 45.1509, 290.3178, 172.6921, 29.6835, 29.5192, 29.4242, 27.249, 26.4213, 26.3882, 31.3379, 31.1798, 31.191, 31.1351]
[53.7533, 143.4332, 112.0511, 142.9355, 44.3782, 280.9794, 172.8862, 29.8359, 29.2278, 29.4755, 27.2404, 26.4982, 26.3565, 31.3338, 31.2015, 31.1403, 30.7387]
[51.0884, 141.8932, 111.8456, 140.8611, 45.4508, 282.0051, 173.2361, 29.7459, 29.3937, 29.3827, 28.0109, 26.3166, 26.4308, 31.3822, 30.8604, 31.2061, 30.909]
[50.699, 144.5118, 112.3287, 140.6304, 45.8268, 292.835, 175.1699, 29.5901, 29.4615, 29.4456, 27.7753, 26.259, 26.4269, 31.5163, 30.8012, 31.0402, 31.2906]
[52.0486, 140.3173, 112.6003, 140.7325, 44.5733, 275.5862, 174.1799, 30.0199, 29.3096, 29.4031, 27.7075, 26.3135, 26.3433, 31.8847, 30.9336, 30.8427, 30.8827]
Energies:
IP4_1: [-309.84674683, -309.847000007, -309.847961686]
IP4_2: [-309.846569715, -309.845282065, -309.847936164, -309.847324941, -309.845372646]

Setting TMS computational NMR shielding constant references
Setting TMS references to 188.452125 and 32.1243166667

Converting DFT data to NMR shifts...
[0.16868446982677085, 0.22056053309520496, 0.6107549970780243]
[0.12478688500156183, 0.03190761049375939, 0.5305037184618006, 0.277681469399478, 0.03512031664340019]
WARNING: NMR shift calculation currently ignores the instruction to exclude atoms from analysis
C shifts for isomer 0:
136.442, 43.808, 81.424, 53.763, 143.343, 18.928
H shifts for isomer 0:
2.751, 2.612, 2.285, 4.049, 5.760, 5.871, 0.865, 0.601, 1.283, 1.153
C shifts for isomer 1:
137.198, 45.137, 76.557, 47.425, 143.026, 14.728
H shifts for isomer 1:
2.417, 2.704, 2.715, 4.309, 5.805, 5.706, 0.694, 1.227, 0.981, 1.088

Reading experimental NMR data...
[PosixPath('/home/cloudam/work/dp4/IP4_tinker/NMR_folder/Carbon'), PosixPath('/home/cloudam/work/dp4/IP4_tinker/NMR_folder/Proton')]
Cshifts [16877, 24398, 27885, 35275, 36948, 41526, 44704, 45401, 48935, 49415, 49494, 50315, 51088, 51312, 52165, 52748, 52866, 52924, 52967, 53041, 53446, 53492, 53797, 53892, 54317, 54566, 56173, 56629, 56817, 56866, 56916, 57006, 57260, 57585, 57629, 59516, 60025, 62380, 74728, 76429, 76985, 78309, 80656, 80954, 81834, 81886, 81995, 82055, 82156, 82247, 82804, 83202, 83742, 83834, 84531, 84971, 88667, 88872, 92159, 94973, 96204, 96290, 96392, 97478, 98130, 98381, 98466, 98885, 99220, 99411, 99539, 99647, 99667, 99746, 100137, 100234, 100334, 100702, 100929, 101103, 101319, 101365, 101402, 101596, 102180, 103160, 104388, 105039, 108737, 109250, 110025, 110449, 111396, 111600, 111829, 111913, 112591, 112813, 113438, 113480, 113943, 114030, 114676, 115240, 127011]

Assigning carbon spectrum...

Plotting carbon spectrum...

Assigning proton spectrum...

Plotting proton spectrum...

Calculating DP4 probabilities...
none
No stats model provided, using default
number of c protons = 10
number of c carbons = 6
number of e protons = 10
number of e carbons = 6
IP4_1

Solvent = chloroform
Force Field = mmff

DFT NMR Functional = mPW1PW91
DFT NMR Basis = 6-311g(d)

Number of isomers = 2
Number of conformers for isomer 1 = 3
Number of conformers for isomer 2 = 5

Assigned C shifts for isomer 1:
label, calc, corrected, exp, error
C7      18.93  15.82  16.23   0.41
C2      43.81  39.16  39.34   0.18
C4      53.76  48.50  47.15  -1.35
C3      81.42  74.44  75.43   0.99
C1     136.44 126.05 125.26  -0.79
C5     143.34 132.52 133.08   0.56

Assigned C shifts for isomer 2:
label, calc, corrected, exp, error
C7      14.73  15.72  16.23   0.51
C2      45.14  43.41  39.34  -4.07
C4      47.43  45.50  47.15   1.65
C3      76.56  72.03  75.43   3.40
C1     137.20 127.26 125.26  -2.00
C5     143.03 132.57 133.08   0.51

Assigned H shifts for isomer 1:
label, calc, corrected, exp, error
H15      0.60   0.71   0.95   0.24
H14      0.86   0.95   1.66   0.71
H17      1.15   1.22   0.95  -0.27
H16      1.28   1.34   0.95  -0.39
H10      2.29   2.27   2.18  -0.10
H9       2.61   2.58   2.55  -0.02
H8       2.75   2.71   2.55  -0.15
H11      4.05   3.91   3.91  -0.01
H12      5.76   5.50   5.54   0.04
H13      5.87   5.61   5.54  -0.06

Assigned H shifts for isomer 2:
label, calc, corrected, exp, error
H14      0.69   0.73   1.66   0.93
H16      0.98   1.00   0.95  -0.05
H17      1.09   1.10   0.95  -0.15
H15      1.23   1.23   0.95  -0.28
H8       2.42   2.35   2.18  -0.17
H9       2.70   2.62   2.55  -0.07
H10      2.72   2.63   2.55  -0.08
H11      4.31   4.13   3.91  -0.23
H13      5.71   5.45   5.54   0.10
H12      5.81   5.54   5.54   0.00

Results of DP4 using Proton:
Isomer 1: 97.2%
Isomer 2:  2.8%

Results of DP4 using Carbon:
Isomer 1: 99.3%
Isomer 2:  0.7%

Results of DP4:
Isomer 1: 100.0%
Isomer 2:  0.0%

PyDP4 process completed successfully.

KristapsE commented 3 years ago

Good to hear that the issue was resolved!

gkxiao commented 3 years ago

Hi Kristaps:

Thank you for your help! And thanks Howarth again.

Gaokeng