[gmx-users] editconf subroutine

Tsjerk Wassenaar tsjerkw at gmail.com
Thu Oct 9 09:14:07 CEST 2008


Hi Maria,

The answer is in the source code of course. But here's a python/pymol
function which does the same thing, and which I wrote after the
routine in editconf. It takes as input the definition as a list with
lengths x,y,z and angles a,b,c and returns the upper triangular
matrix:

def triclinic(L):
    B = [[0,0,0],[0,0,0],[0,0,0]]

    x, y, z, a, b, c = L[:6]

    B[0][0] = x
    if a == 90 and b == 90 and c == 90:
        B[1][1] = y
        B[2][2] = z
    else:
        a = a*pi/180
        b = b*pi/180
        c = c*pi/180
        B[1][0] = y*cos(c)
        B[1][1] = y*sin(c)
        B[2][0] = z*cos(b)
        B[2][1] = z*(cos(a)-cos(b)*cos(c))/sin(c)
        B[2][2] = sqrt(z*z-B[2][0]**2-B[2][1]**2)

    return B

Cheers,

Tsjerk
On Thu, Oct 9, 2008 at 6:04 AM, Maria Ratajczak <mkratajczak at gmail.com> wrote:
> Hello,
> I how does editconf subroutine calculate the triclinc box dimensions (v1(x),
> v2(y), v3(z), v1(y) etc) from, for example, a .pdf file that has
> lattice dimensions information (a, b, c, alpha, beta, gamma).
> I would really appreciate a mathematical formula for each of these elements
> (v1(x), v2(y), v3(z), v1(y) etc) or at least where can I find this
> information?
> Thank you
> maria
> _______________________________________________
> gmx-users mailing list    gmx-users at gromacs.org
> http://www.gromacs.org/mailman/listinfo/gmx-users
> Please search the archive at http://www.gromacs.org/search before posting!
> Please don't post (un)subscribe requests to the list. Use the
> www interface or send it to gmx-users-request at gromacs.org.
> Can't post? Read http://www.gromacs.org/mailing_lists/users.php
>



-- 
Tsjerk A. Wassenaar, Ph.D.
Junior UD (post-doc)
Biomolecular NMR, Bijvoet Center
Utrecht University
Padualaan 8
3584 CH Utrecht
The Netherlands
P: +31-30-2539931
F: +31-30-2537623



More information about the gromacs.org_gmx-users mailing list