Re: how to calculate the box size

From: Axel Kohlmeyer (akohlmey_at_gmail.com)
Date: Tue Mar 06 2012 - 09:55:42 CST

On Tue, Mar 6, 2012 at 10:44 AM, Chris Harrison <charris5_at_gmail.com> wrote:
> There's no reason, if the user has the correct frame/structure loaded, with
> coordinates properly wrapped, that the measure minmax approach will differ
> from the molinfo command.  I strongly suspect a misunderstanding of the
> actual frame  loaded or a similar inadvertent user error in Mingjun's case.
>
>
> I'm advocating using *both* approaches, not just one.  If they don't match,
> find out why.

sorry, chris,

but measure minmax will be wrong, even if you
wrap all coordinates, unless you have by chance
always atoms *exactly* on the box boundaries
in all directions. similarly, if you have (partially)
unwrapped coordinates (even if only the water
molecules) there will always be atoms "sticking out".

thus measure minmax will be an approximation,
and depending on wrapping settings either under
or overestimate, but never give the exact box dimensions.

cheers,
     axel.

>
> Best,
> Chris
>
>
> On Tue, Mar 6, 2012 at 9:32 AM, Ajasja Ljubetič <ajasja.ljubetic_at_gmail.com>
> wrote:
>>
>> But this script is using measure minmax, so in principle this is the same
>> as trying to reconstruct the periodic box from atomic coordinates (correct
>> me if I'm wrong).
>> I think a better version is:
>>
>> proc get_cell {{molid top}} {
>>  puts "cellBasisVector1 [molinfo $molid get a] 0 0"
>>  puts "cellBasisVector2 0 [molinfo $molid get b] 0"
>>  puts "cellBasisVector3 0 0 [molinfo $molid get c]"
>>
>>  set all [atomselect $molid all]
>>  puts "cellOrigin  [measure center $all] "
>>  $all delete
>> }
>>
>> On Tue, Mar 6, 2012 at 16:23, Chris Harrison <charris5_at_gmail.com> wrote:
>>>
>>> And just in case JC's correct answer isn't enough for you ... this
>>> question was previously answered on Feb 9
>>> (http://www.ks.uiuc.edu/Research/namd/mailing_list/namd-l/15960.html),
>>> providing the below tcl scripted solution which should always work no matter
>>> what source file was used to load the frame.  Please remember to search the
>>> listserv (http://www.ks.uiuc.edu/Research/namd/mailing_list/) for possible
>>> answers.
>>>
>>> Best,
>>> Chris
>>>
>>> In the console enter the below function or
>>> else save it in a text file and from the console type: source
>>> directoryToYourTextFile/nameOfYourTextFile.
>>>
>>> proc get_cell {{molid top}} {
>>>  set all [atomselect $molid all]
>>>  set minmax [measure minmax $all]
>>>  set vec [vecsub [lindex $minmax 1] [lindex $minmax 0]]
>>>  puts "cellBasisVector1 [lindex $vec 0] 0 0"
>>>  puts "cellBasisVector2 0 [lindex $vec 1] 0"
>>>  puts "cellBasisVector3 0 0 [lindex $vec 2]"
>>>  set center [measure center $all]
>>>  puts "cellOrigin $center"
>>>  $all delete
>>> }
>>>
>>> Now make sure your molecule is the top molecule in VMD (ie has the T
>>> in it's line in the "VMD Main" window).  Then in the console type:
>>> get_cell.  The basis vectors for your system should be output.
>>>
>>>
>>> Best,
>>> Chris
>>>
>>>
>>> On Tue, Mar 6, 2012 at 9:00 AM, JC Gumbart <gumbart_at_ks.uiuc.edu> wrote:
>>>>
>>>> And to further clarify, VMD reads them from the dcd and can be accessed
>>>> using
>>>>
>>>> molinfo top get a (b and c)
>>>>
>>>> -----Original Message-----
>>>> From: owner-namd-l_at_ks.uiuc.edu [mailto:owner-namd-l_at_ks.uiuc.edu] On
>>>> Behalf
>>>> Of Axel Kohlmeyer
>>>> Sent: Tuesday, March 06, 2012 8:53 AM
>>>> To: Aron Broom
>>>> Cc: mjyang; namd-l_at_ks.uiuc.edu
>>>> Subject: Re: namd-l: how to calculate the box size
>>>>
>>>> On Tue, Mar 6, 2012 at 9:44 AM, Aron Broom <broomsday_at_gmail.com> wrote:
>>>> > What if for the water molecules in your system you calculate from the
>>>> > center of mass of the waters rather than just the atomic coordinates?
>>>> > I don't know what the real answer is, but that would shrink your box
>>>> > ever
>>>> so slightly.
>>>>
>>>> that is nonsense.  you cannot reconstruct the box size from the
>>>> positions of
>>>> the atoms. full stop. but the box dimensions are usually stored in the
>>>> dcd
>>>> trajectory file. those are the only ones you can use or those in a
>>>> proper
>>>> .xsc file.
>>>>
>>>> axel.
>>>>
>>>> >
>>>> >
>>>> > On Tue, Mar 6, 2012 at 2:48 AM, mjyang <mjyang_at_hku.hk> wrote:
>>>> >>
>>>> >> Dear NAMD users,
>>>> >>
>>>> >>     I performed a simulation by NAMD for a protein system solvated by
>>>> >> a cubic water box. Now I extracted the snapshots from NAMD trajectory
>>>> >> for postpone analysis, in which the protein should be centered in the
>>>> >> box. The box size was calculated by (max_x-min_x, max_y-min_y,
>>>> >> max_z-min_z), where max_x,y,z and min_x, y, z are the maximum and
>>>> >> minimum coordinate values of the extracted frame. However, the box
>>>> >> size calculated in this way is a little larger than the real one,
>>>> >> resulting in gaps in the recentered box. It seems that the box size
>>>> >> written out by NAMD in the *.xsc file is better than what I
>>>> >> calculated. But the NAMD output size (in *.xsc file) only corresponds
>>>> >> to the last frame of a segment of trajectory file and I need the size
>>>> >> for each frame in the traj. Could someone please tell me how NAMD
>>>> calculate the box along MD simulations?
>>>> >>
>>>> >>
>>>> >> Many thanks.
>>>> >>
>>>> >>
>>>> >> Mingjun
>>>> >>
>>>> >
>>>> >
>>>> >
>>>> > --
>>>> > Aron Broom M.Sc
>>>> > PhD Student
>>>> > Department of Chemistry
>>>> > University of Waterloo
>>>> >
>>>>
>>>>
>>>>
>>>> --
>>>> Dr. Axel Kohlmeyer
>>>> akohlmey_at_gmail.com  http://goo.gl/1wk0
>>>>
>>>> College of Science and Technology
>>>> Temple University, Philadelphia PA, USA.
>>>>
>>>>
>>>
>>>
>>>
>>> --
>>> Chris Harrison, Ph.D.
>>> NIH Center for Macromolecular Modeling and Bioinformatics
>>> Theoretical and Computational Biophysics Group
>>> Beckman Institute for Advanced Science and Technology
>>> University of Illinois, 405 N. Mathews Ave., Urbana, IL 61801
>>>
>>> http://www.ks.uiuc.edu/Research/namd      Voice: 773-570-6078
>>> http://www.ks.uiuc.edu/~char                         Fax: 217-244-6078
>>>
>>>
>>>
>>
>
>
>
> --
> Chris Harrison, Ph.D.
> NIH Center for Macromolecular Modeling and Bioinformatics
> Theoretical and Computational Biophysics Group
> Beckman Institute for Advanced Science and Technology
> University of Illinois, 405 N. Mathews Ave., Urbana, IL 61801
>
> http://www.ks.uiuc.edu/Research/namd      Voice: 773-570-6078
> http://www.ks.uiuc.edu/~char                         Fax: 217-244-6078
>
>
>

-- 
Dr. Axel Kohlmeyer
akohlmey_at_gmail.com  http://goo.gl/1wk0
College of Science and Technology
Temple University, Philadelphia PA, USA.

This archive was generated by hypermail 2.1.6 : Tue Dec 31 2013 - 23:21:44 CST