Closed flatstik closed 2 years ago
I have added a small fix for this, let me know if this causes any other issues.
It did cause other issues:
WARNING: NMR shift calculation currently ignores the instruction to exclude atoms from analysis
C shifts for isomer 0:
20.887, 34.117, 151.840, 133.375, 133.377, 130.582, 133.377, 133.375
H shifts for isomer 0:
1.376, 1.160, 1.160, 2.714, 2.714, 7.417, 7.515, 7.415, 7.515, 7.417
Reading experimental NMR data...
[PosixPath('exper/test/Proton'), PosixPath('exper/test/Carbon')]
Processing Proton Spectrum
minimisation time = 0.631831963857015 mins
number of protons = 10
==============================
*** Open Babel Error in ReadFile
Cannot read from Smiles_Mol_0_0
number of labile protons = 0
the best fit number of protons is 10
/scratch/project_2003067/DP5/DP5/Proton_processing.py:1563: 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)
/scratch/project_2003067/DP5/DP5_env/lib/python3.9/site-packages/numpy/lib/function_base.py:4454: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tupl
e 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.
arr = asarray(arr)
Processing Carbon Spectrum
/scratch/project_2003067/DP5/DP5_env/lib/python3.9/site-packages/scipy/stats/_continuous_distns.py:366: RuntimeWarning: Mean of empty slice.
loc = data.mean()
/scratch/project_2003067/DP5/DP5_env/lib/python3.9/site-packages/numpy/core/_methods.py:189: RuntimeWarning: invalid value encountered in double_scalars
ret = ret.dtype.type(ret / rcount)
/scratch/project_2003067/DP5/DP5_env/lib/python3.9/site-packages/scipy/stats/_continuous_distns.py:371: RuntimeWarning: Mean of empty slice.
scale = np.sqrt(((data - loc)**2).mean())
/scratch/project_2003067/DP5/DP5_env/lib/python3.9/site-packages/scipy/interpolate/fitpack2.py:667: ComplexWarning: Casting complex values to real discards the imaginary part
self._data = dfitpack.fpcurf0(x, y, k, w=w, xb=bbox[0],
Assigning proton spectrum...
Plotting proton spectrum...
Assigning carbon spectrum...
Plotting carbon spectrum...
Calculating DP5 probabilities...
Smiles_Mol_0_0
Solvent = chloroform
Force Field = mmff
DFT optimisation Functional = b3lyp
DFT optimisation Basis = 6-31g(d,p)
DFT energy Functional = m062x
DFT energy Basis = def2tzvp
DFT NMR Functional = mPW1PW91
DFT NMR Basis = 6-311g(d)
Number of isomers = 1
Number of conformers for isomer 1 = 1
Assigned C shifts for isomer 1:
label, calc, corrected, exp, error,prob
C1 20.89 15.80 15.60 -0.20 0.60
C2 34.12 28.96 28.88 -0.09 0.61
C6 130.58 124.91 125.57 0.66 0.62
C4 133.38 127.69 127.83 0.14 0.54
C8 133.38 127.69 127.83 0.14 0.61
C5 133.38 127.69 128.29 0.59 0.69
C7 133.38 127.69 128.29 0.59 0.70
C3 151.84 146.06 144.21 -1.84 0.27
Results of DP5 using Carbon:
Isomer 1: 71.6%
Multiple structures required for DP4 probability calculations...
PyDP4 process completed successfully.
Traceback (most recent call last):
File "/scratch/project_2003067/DP5/DP5/PyDP4.py", line 841, in <module>
main(settings)
File "/scratch/project_2003067/DP5/DP5/PyDP4.py", line 542, in main
return NMRData, Isomers, settings, DP4data, DP5data
UnboundLocalError: local variable 'DP4data' referenced before assignment
This is not an issue with the software, PyDP4 is saying exactly why the it has exited. if you submit the workflow option s PyDP4 tries to calculate DP4 probabilities. To calculate DP4 probabilities you need to submit more than one structure as this metric is comparative. If you submit one structure and ask for DP4 probability the program will quit. DP5 is not comparative and can complete calculation on one structure, which is exactly what has been provided here, the result 71.6% is the final DP5 probability showing that this calculation has been completed correctly.
I am closing this issue as this calculation has clearly completed correctly.
Trying to run the program with ethylbenzene (smiles: CCc1ccccc1) and Carbon experimental data:
PyDP4.py -f mmff -w gnomesw -s chloroform -m t --Smiles ./ebb.smiles ./exper/test/
Edit: same results with InChI. If I add other heteroatom there, it runs the program. Edit2:
CCCCc1ccccc1 <-- works CCCc1ccccc1 <-- doesn't work CCc1ccccc1 <-- doesn't work Cc1ccccc1 <-- doesn't work c1ccccc1 <--- doesnt't work
Basically anything smaller than CCCc1ccccc1 doesn't work.