-
Notifications
You must be signed in to change notification settings - Fork 824
Description
link to issue on MDAnalysis discussion groups
https://groups.google.com/d/msg/mdnalysis-discussion/JVMNkH0DLR8/LWxoH_kfJwAJ
Expected behaviour
Writing Hbond information such as donor/acceptor id as seen in PSF files
Actual behaviour
I am able to extract several details (like donor acceptor idx, angles, distances.) I do see the digit 3 from the donor or acceptor name TIP3 (for waters) get prefixed onto the folowing column (please see below). The resnames in the PDB and PSF files are "TIP3" as opposed to :TIP 3". I also scrolled down the PSF/PDB files all the way to the bottom to make sure that the column which contains "TIP3" and the adjacent column does have a space. Not sure why MDAnalysis would write that in the output. This becomes a problem because, when I am trying to extract the identities of the waters associated with my protein I get a 3 added to the actual number defining the TIP3.
Code to reproduce the behaviour
import MDAnalysis as mda
import MDAnalysis
from MDAnalysis import *
import MDAnalysis.analysis.hbonds
import cPickle
import numpy
# u = mda.Universe(top, trj)
f1=open("../hbonds_TIP.txt",'w')
f1.write("#TIME donor_idx acceptor_idx donor_resnm donor_resid donor_atom acceptor_resnm acceptor_resid acceptor_atom distance angle")
f1.write("\n")
for x in range(1,5): #25
dcd_name='2frames.dcd'
u=Universe("../step3_pbcsetup.psf",dcd_name)
p1 = MDAnalysis.analysis.hbonds.HydrogenBondAnalysis(u,"protein","resname TIP3", distance=3.0, angle=120.0)
p1.run()
p1.generate_table()
p1.save_table(filename="../hbond_test_tip.pickle")
table1=cPickle.load(open("../3skx_open/hbond_test_tip.pickle"))
for i in range(0,len(table1)):
f1.write(str(table1[i][0])) # gives individual elements and convert to degrees
f1.write(" ")
f1.write(str(table1[i][1]))
f1.write(" ")
f1.write(str(table1[i][2]))
f1.write(" ")
f1.write(str(table1[i][3]))
f1.write(" ")
f1.write(str(table1[i][4]))
f1.write(" ")
f1.write(str(table1[i][5]))
f1.write(" ")
f1.write(str(table1[i][6]))
f1.write(" ")
f1.write(str(table1[i][7]))
f1.write(" ")
f1.write(str(table1[i][8]))
f1.write(" ")
f1.write(str(table1[i][9]))
f1.write(" ")
f1.write(str(table1[i][10]))
f1.write(" ")
f1.write("\n")
....Currently version of MDAnalysis:
(run python -c "import MDAnalysis as mda; print(mda.__version__)")