Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] master from dacase:master #7

Merged
merged 4 commits into from
Jul 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/afnmr/getshifts-demon
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@ if( $reference eq "seg0" ){
$ref{"P"} = 300.0;
$ref{"S"} = 0.0;
$ref{"F"} = 130.3; #CFCl3
} elsif( $reference eq "ref_seg1" ){
$reference_set = "OLYP ref_seg1 ";
$ref{"H"} = 33.3; # TMS
$ref{"C"} = 181.3; # TMS
$ref{"N"} = 253.6; # CH3NO2 + 380.5
$ref{"P"} = 300.0;
$ref{"S"} = 0.0;
$ref{"F"} = 137.4; #CFCl3
}

if( $basename eq "header" ){
Expand Down
40 changes: 20 additions & 20 deletions src/afnmr/plotshifts.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env python2
from __future__ import division
#!/usr/bin/env python3


from argparse import ArgumentParser
from collections import OrderedDict
Expand Down Expand Up @@ -240,7 +240,7 @@ def calc_rmse(x, y):
if opt.details:
nucdata[key] = (xdata, ydata)

if opt.legend and len(datapoints.keys()) > 1:
if opt.legend and len(list(datapoints.keys())) > 1:
marker, color = symbols[i%LS], colors[i%LC]
else:
marker, color = symbols[0], colors[3]
Expand Down Expand Up @@ -288,28 +288,28 @@ def calc_rmse(x, y):
ax.text(opt.rlab[2*ii], opt.rlab[2*ii+1], lab,
fontsize=fontsizes['label'], transform=ax.transAxes)

print 'Plot %d' % ii
print '--------------------------------'
print 'Linear regression:'
print ' Slope = %.2f' % m
print ' Intercept = %.2f' % b
print ' Corr.Coef = %.3f' % r
print ' 2'
print ' R = %.3f' % (r * r)
print ' p = %.4f' % p
print ' Std. Err. = %.4f' % stderr
print ' RMSE = %.4f' % rmse
print('Plot %d' % ii)
print('--------------------------------')
print('Linear regression:')
print(' Slope = %.2f' % m)
print(' Intercept = %.2f' % b)
print(' Corr.Coef = %.3f' % r)
print(' 2')
print(' R = %.3f' % (r * r))
print(' p = %.4f' % p)
print(' Std. Err. = %.4f' % stderr)
print(' RMSE = %.4f' % rmse)
if opt.details:
# Now print out the R^2 and RMSE for each type of nucleus
print ''
print 'Nucleus | R^2 | RMSE'
print '--------+--------+-------'
print('')
print('Nucleus | R^2 | RMSE')
print('--------+--------+-------')
for key in nucdata:
xdata, ydata = nucdata[key]
m, b, r, p, stderr = linregress(xdata, ydata)
print ' %-4s | %.4f | %.4f' % (key, r*r, calc_rmse(xdata, ydata))
print ''
print '--------------------------------'
print(' %-4s | %.4f | %.4f' % (key, r*r, calc_rmse(xdata, ydata)))
print('')
print('--------------------------------')

if len(pls) > 1 and opt.legend:
if opt.printstats:
Expand Down