Re: [Biskit-general] entropy
Brought to you by:
graik
From: Raik G. <rai...@cr...> - 2011-03-05 18:55:19
|
On Fri, Mar 4, 2011 at 11:10 PM, Raik Gruenberg <rai...@cr...> wrote: > Hi again Carra, > > thanks for the detailed report. I´ll look into it in more detail. Some > first impression: > > On Fri, Mar 4, 2011 at 5:23 PM, Carra, Claudio (JSC-SK)[Affiliate] > <cla...@na...> wrote: >> Dear All, >> I'm trying to calculate the entropy of a flexible complex by using the quasi-harmonic approximation. >> After the BisKit installation, I run the test and it looked pretty good. >> >> ---------- >> SUMMARY: >> ======= >> >> A total of 92 tests from 106 modules were run. >> - 90 passed >> - 2 failed >> - error : Biskit.PDBParseNCBI.Test.test_PDBParseModel >> - error : Biskit.Dock.Intervor.TestDry.test_IntervorDry >> DONE > > That´s perfect. The intervor test case has to fail. That´s a known > bug. I don´t know what´s going wrong with the NCBI parser but neither > of those errors affect the entropy code. > >> >> ----------- >> Before using a_comEntropy.py, I tried to calculate the entropy with the following command >> >> a_trajEntropy.py -i dC_1ns_no-Na_ens.dat -o res.dat -ref dC_no-Na.PDBModel \ >> -parm dC_no-Na.top -crd dC_1ns_no-Na.mdcrd -log log -f_out ptraj.out \ >> -atoms CA -f_template ptraj.inp -debug -verbose >> >> I got the following error: >> >> ---------- >> rmsd fitting...#done >> rmsd fitting...#done >> rmsd fitting...#done >> Traceback (most recent call last): >> File "/usr/lib/python2.4/site-packages/Biskit/scripts/analysis/a_trajEntropy.py", line 144, in ? >> a.run() >> File "/usr/lib/python2.4/site-packages/Biskit/Executor.py", line 524, in run >> self.finish() >> File "/usr/lib/python2.4/site-packages/Biskit/AmberEntropist.py", line 761, in finish >> AmberCrdEntropist.finish( self ) >> File "/usr/lib/python2.4/site-packages/Biskit/AmberCrdEntropist.py", line 131, in finish >> self.result = self.parsePtrajResult( self.f_out ) >> File "/usr/lib/python2.4/site-packages/Biskit/AmberCrdEntropist.py", line 195, in parsePtrajResult >> raise EntropistError, 'unexpected end of ptraj output file.' >> Biskit.AmberCrdEntropist.EntropistError: unexpected end of ptraj output file. >> >> --------- >> >> however, in ptraj.out I get >> >> --------- >> freq. E Cv S >> cm**-1 kcal/mol cal/mol-kelvin cal/mol-kelvin >> -------------------------------------------------------------------------------- >> Total 7957550.797 nan 196.551 >> translational .888 2.979 45.315 >> rotational .888 2.979 44.438 >> vibrational 7957549.021 nan 106.798 >> 1 6.852 .592 1.986 8.755 >> >> --------- > > OK, then it looks as if the output of ptraj has changed between > versions and the script doesn´t recognice the successful result any > longer. Should be not too difficult to fix. Could you please file a > bug at the sourceforge project site? (there is a link on > biskit.sf.net) Please attach the full ptraj output file. > >> >> >> So I'm not sure what's wrong. >> All this if i use a small protein as a sample molecule. >> If I use a fragment of dna, let's say dC8, things get much worse. >> I've this error: >> >> ------------- >> >> Warning: invalid value encountered in divide >> Warning: invalid value encountered in divide >> Warning: invalid value encountered in divide >> Warning: invalid value encountered in divide >> Warning: invalid value encountered in divide >> Warning: invalid value encountered in divide >> Warning: invalid value encountered in divide >> Warning: invalid value encountered in divide >> Warning: invalid value encountered in divide >> done >> Traceback (most recent call last): >> File "/usr/lib/python2.4/site-packages/Biskit/scripts/analysis/a_trajEntropy.py", line 143, in ? >> a = AmberEntropist( f_in, **options ) >> File "/usr/lib/python2.4/site-packages/Biskit/AmberEntropist.py", line 192, in __init__ >> self.traj = self.prepareTraj( traj, self.ref, cast=self.cast ) >> File "/usr/lib/python2.4/site-packages/Biskit/AmberEntropist.py", line 572, in prepareTraj >> self.fit( t, ref ) >> File "/usr/lib/python2.4/site-packages/Biskit/AmberEntropist.py", line 253, in fit >> m_avg = traj[self.fit_s : self.fit_e ].avgModel() >> File "/usr/lib/python2.4/site-packages/Biskit/Trajectory.py", line 248, in avgModel >> result.setXyz( N.average( self.frames ) ) >> File "/usr/lib64/python2.4/site-packages/numpy/oldnumeric/functions.py", line 124, in average >> return np.average(a, axis, weights, returned) >> File "/usr/lib64/python2.4/site-packages/numpy/lib/function_base.py", line 447, in average >> scl = avg.dtype.type(a.size/avg.size) >> ZeroDivisionError: integer division or modulo by zero >> > > Right, I only had proteins in mind when writing the code. Most likely > I am filtering for protein-only atoms before doing the fit. And then > there is nothing to fit left for the DNA structure, which then leads > to the zero-division. This should actually be even easier to fix than > the other bug. Hi Claudio, let´s first look at the easy problem: The culprit for the DNA deletion is in Biskit/AmberEntropist.py. Please have a look at this module. It encapsulates the entropy calculation protocols and is well documented. I cannot fix it myself from the internet cafe PC but can only look at the code: http://biskit.svn.sourceforge.net/viewvc/biskit/trunk/Biskit/AmberEntropist.py?revision=933&view=markup Check out line 306 306 def __cleanAtoms( self, m ): 307 """ 308 Remove non protein atoms and H if needed. 310 @param m: model to clean 311 @type m: PDBModel 313 @return: cleaned model 314 @rtype: PDBModel 315 """ 316 m.keep( N.nonzero( m.maskProtein() ) ) 317 if self.heavy: 318 m.keep( N.nonzero( m.maskHeavy() ) ) 319 return m (indentation messed up during the paste). PDBModel.maskProtein returns a mask (of True or False) marking each atom in the structure that belongs to a protein. numpy.nonzero converts this into a list of atom positions and PDBModel.keep only keeps these positions. Best is if you get some interactive python prompt and play around with these functions yourself. My recommendation is to change line 316 into: m.keep( N.nonzero( m.maskProtein() or m.maskDNA() ) That´s getting a bit obfuscated though and I am not completely sure whether the or operation works the way I think. Alternative: mask = N.logical_or( m.maskProtein(), m.maskDNA() ) m.keep( mask ) In theory this should be enough to fix the DNA problem. Please test and tell me how it works. If successful, it would be cool if you could attach the corrected py file to the bug report -- it¨s going to be two months before I am back in front of a real work station, would be a shame if our changes get lost. Bug reports can be filed here: http://sourceforge.net/tracker/?group_id=150896&atid=779191 Good luck! Raik > > Have a nice weekend, > Raik > >> ------------ >> >> I had no prob to generate the traj2ensemble.py trajectories in both cases, and no >> errors for the corresponding PDBMoldel structures. >> I'm kind of lost here. >> If you guys have any idea, I would really appreciate some help >> thanks for your time >> Sincerely, >> Claudio >> >> >> >> ------------------------------------------------------------------------------ >> What You Don't Know About Data Connectivity CAN Hurt You >> This paper provides an overview of data connectivity, details >> its effect on application quality, and explores various alternative >> solutions. http://p.sf.net/sfu/progress-d2d >> _______________________________________________ >> Biskit-general mailing list >> Bis...@li... >> https://lists.sourceforge.net/lists/listinfo/biskit-general >> > |