Menu

Saving thickness Map image in Membplugin and .dx file specification

Sneha
2018-01-02
2020-05-11
  • Sneha

    Sneha - 2018-01-02

    Greetings!

    Can we save the average membrane thickness colour map generated by Membplugin as an image file?
    Also, what is the file format of the average volumetric data file (.dx file)? Shouldn't the number of lines in the .dx file correspond to the number of lines for 1 frame in the .dat?

    Any help would be appreciated.

    Thanks

     
    • Ismael Rodriguez Espigares

      Dear Sneha,
      Membrane thickness image export option is not implemented yet, but running the following commands while having the colour map window opened in a TK console (in Extensions menu) should generate a save as postcript file dialog:

      set tmap_canvas .mtthicknessgui.tmap.canvas;
      lassign [split [lindex [split [winfo geometry $tmap_canvas] +] 0] x] width height;
      ::membranetool_common_gui::save_plot $tmap_canvas $width $height;
      

      Regarding the .dx file, it contains the same data as the colour map as it shows the average along frames while .dat file contains the thickness (Zmeasure) per frame.

      The format of the APBS DX potential maps file is

      # Comments
      .
      .
      .
      object "Dataset name" class field
      object 1 class gridpositions counts xn yn zn
      origin xorg yorg zorg
      delta xdel 0 0
      delta 0 ydel 0
      delta 0 0 zdel
      object 2 class gridconnections counts xn yn zn
      object 3 class array type double rank 0 items [ xn*yn*zn ] data   follows
      f1 f2 f3
      f4 f5 f6
      .
      .
      .
      

      Where xn, yn, and zn are the number of data points along each axis forming a grid;
      xorg, yorg, and zorg is the origin of the grid, in angstroms;
      xdel, ydel, and zdel are the scaling factors to convert grid units to angstroms.
      Grid data follows with three (this is an arbitrary number) values per line ordered z first, y second and x third.

      Summarizing, data is listed in order and x, y and z coordinates are obtained by the following equations:

      pos = data position (starting by 0)
      x = int(pos / (yn * zn)) * xdel + xorg
      y = int((pos mod (yn * zn)) / zn) * ydel + yorg
      z = ((pos mod (yn * zn)) mod zn) * zdel + zorg

      In the case of the membrane thickness tool, the value of thickness is repeated with identical value "zn = 2" times along the z axis as DX files does not support 2D maps.

      VMD has no support for handling multi-frame volume maps.

      Source: http://www.ks.uiuc.edu/Research/vmd/plugins/molfile/dxplugin.html

      See wiki for further information.

       

      Related

      Wiki: MembraneThickness


      Last edit: Ismael Rodriguez Espigares 2019-01-07
      • Yasser Almeida

        Yasser Almeida - 2019-01-07

        Thank you, for the explanation.

        I have a case were I get zn = 2, so I have two grids.

        Any ideas?

         
        • Ismael Rodriguez Espigares

          Dear Yasser Almeida,

          zn = 2 and zdel = 2.0 is hardcoded to workarround the fact that DX files does not support 2D data and to ease visualization in VMD by setting the Z axis width of the represented VOLMAP to 2 angstroms.

          The value of thickness/deformation is repeated with identical value "zn = 2" times along the z axis.

           

          Last edit: Ismael Rodriguez Espigares 2019-01-07
          • Yasser Almeida

            Yasser Almeida - 2019-01-07

            Dear Ismael,

            I am affraid I still don't get the idea of the format.
            Attached is my .dx file. It contains 2x the values.
            My first basic question is, are those all Z values? If I split the file, the values of the second half is not identical to the first.
            Is there a way to get the X, Y, (averaged) Z values directly?

            Regards

             
            • Ismael Rodriguez Espigares

              DX file contains X,Y,Z and U values, where U is a function of X,Y and Z.
              X, Y and Z are spatial coordinates and U(X,Y,Z) are the written values in the file (thickness or deformation in this case).

              X, Y and Z coordinates are represented as 3D ordered regular-spaced grid points, but they are not directly written in the file. xdel, ydel and zdel are the spacing between points on each one of the axes and they are written in the header of the file. Minima of X, Y and Z (xorg, yorg and zorg) is also writen in the header.

              u(x,y,z) values, where x,y and z are the indexes (beginning by 0) of the grid points, are writen in Z, Y, X order NOT X, Y, Z. Here, I use u(x,y,z) to refer to U(X,Y,Z) values in function of indexes instead of coordinates.
              xn, yn and zn are the number of grid points on each one of the axes and they are also written in the header of the file.

              As VMD cannot represent VOLMAPS with a Z-width of zero, membrane thickness tool writes each U value twice in the Z dimension (zn = 2, so z < 2 and Z in [zorg,zorg+zdel]). The total number of U values written in the file is xnynzn.

              Hence, values are writen by membrane thickness tool in the following way:

              u(0,0,0) u(0,0,1) u(0,1,0)
              u(0,1,1) u(0,2,0) u(0,2,1)

              u(0,yn-1,0) u(0,yn-1,1) u(1,0,0)
              u(1,0,1) u(1,1,0) u(1,1,1)

              u(zn-1,yn-1,0) u(zn-1,yn-1,1)

              where u(x,y,0) = u(x,y,1).
              Arbitrary, 3 values are written on each line (except maybe for the last data line).

              Maybe you might prefer reading Multigrid OpenDX scalar data format specification in APBS user-guide:

              https://www.ics.uci.edu/~dock/manuals/apbs/html/user-guide/x2674.html

              Regards

               
  • Sneha

    Sneha - 2018-01-04

    Thank-you for the information.

    Regards,
    Sneha

     
  • Sneha

    Sneha - 2018-01-07

    How is membrane deformation defined?

     
  • Sneha

    Sneha - 2018-01-10

    Thank-you for the help. Membplugin is extremely useful!

    If I wish to compare deformation map for a leaflet of 2 different systems, I need to have the same color scale. Is it possible to do that? I tried loading the dx file in VMD and adjusting the color scale but it doesn't work.
    Can you suggest a way if possible? It would be very helpful.

    Thanks ,
    Sneha

     
  • Sneha

    Sneha - 2018-01-10

    I found a solution. Thank-you.

     
  • Sneha

    Sneha - 2018-01-27

    Can you tell me how is Zorg determined?

    Thanks,
    Sneha

     
    • Ismael Rodriguez Espigares

      I've check the source code of MEMBPLUGIN and this is how xorg, yorg and zorg are computed:

      xorg = min(x) of the first selected frame.

      yorg = min(y) of the first selected frame.

      x = x coordinates of the leaflet in the atom selection for deformation
      or for the two bilayers in the atom selection for thickness.

      y = y coordinates of the leaflet in the atom selection for deformation
      or for the two bilayers for thickness.

      zorg = average of zmid_int across frames for deformation
      or zmid of the last selected frame for thickness.

      zmid_int = average of z_int in a single frame.

      zmid = average of z in a single frame.

      z_int = interpolated z coordinates at each point of the grid dividing the plane of the selected leaflet region (for deformation).

      z = z coordinates for the membrane region in the atom selection.

      xdel = ydel = user specfied resolution
      zn = 2
      zdel = 2

      See wiki for further information.

       

      Related

      Wiki: MembraneThickness


      Last edit: Ismael Rodriguez Espigares 2018-01-29
  • Sneha

    Sneha - 2018-01-29

    This helps.
    Thank-you very much for the information.

     
  • Rabeta Yeasmin

    Rabeta Yeasmin - 2018-01-31

    Thanks so much for providing such a helpful plugin.
    I was facing same problem as Sneha about outputing the membraen thickness map in an image, thanks again for the information for saving the image in a posscript file.
    I am wondering if I can use the .dx file in APBS to creat the same plot. I have tried to open it in APBS but it could not open the file and showing error like-

    asc_getToken: Error occurred (bailing out).
    Vio_scanf: Format problem with input.
    Parsed input file.
    Got paths for 0 molecules
    You didn't specify any molecules (correctly)!
    Bailing out!
    Error reading molecules!

     
    • Ismael Rodriguez Espigares

      Dear Rabeta Yeasmin,

      As far as I know, APBS is not a visualitzation program. It computes electrostatics for structural protein models and other force-field defined molecules and uses DX files as output.

      Please read these thread about ploting MEMBPLUGIN thickness results.

      I hope this helps.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.