Hello Nathan,

Thank you for your reply to my request!

I have scoured the Internet and found a FORTRAN code for reading (not writing) the XPLOR format:

The link is: http://nmr.cit.nih.gov/xplor-nih/xplorMan/node333.html (appended below!)

I also append its content at the very end of this message, and I had added the original posting for complete info within the same message.

Although it says it is for electron density, I believe that the same format is used for electrostatics.

The format states that is is a ZYX format for "Z sections." THere are some numbers at the top which I believe describe the cube grid at least which would require the reading of all the file in one go perhaps into an array in order to obtain these values.

There is a file within the examples provided for the software that requires this format as shown below in the original posting, in which I have placed the beginning of the file, which is called "cva21_delphi.xplor" within the samples archive embedded within the download archive 
http://bilbo.bio.purdue.edu/~viruswww/Rossmann_home/softwares/river_programs/rivem.tar.gz (480 Mb) (located within the within "rivem/rappture" folder.)

The sample portion of that file which I originally placed in the original post (see below) shows the beginning of section 0, and I figured that 
each section is labelled ahead of the data with the following command removing all of the    + and - signs for the data:

$ cat cva21_delphi.xplor |fgrep -v "+" | fgrep -v "-"           

       1
qdiffxas: qdiffxs4 with an improved surfacing routine       
ZYX
       0
       1
       2
       3
       4
       5
       6
[ . . . . . .]
     252
     253
     254
     255
     256

So I conclude that there are 257 "Z sections"

I hope that this may be useful information to perhaps make a simple converter, or even add the format to the software.

THank you for your cooperation,

Sincerely,

Jean-Yves Sgro - jsgro@wisc.edu -




From: "Baker, Nathan" <Nathan.Baker@pnnl.gov>
To: "jsgro@wisc.edu" <jsgro@wisc.edu>; "apbs-users@lists.sourceforge.net" <apbs-users@lists.sourceforge.net> 
Sent: Friday, April 6, 2012 6:46 PM
Subject: RE: [apbs-users] Fwd: APBS to Xplor format
Hello --

If you can provide a link to the XPLOR format, then we can try to develop a conversion script.

Thanks,

__________________________________________________
Nathan Baker
Pacific Northwest National Laboratory
Tel:  +1-509-375-3997
http://nabaker.me


-----Original Message-----
From: Jean-yves Sgro [mailto:jsgro@wisc.edu]
Sent: Thursday, April 05, 2012 2:36 PM
To:apbs-users@lists.sourceforge.net;jsgro@wisc.edu
Subject: [apbs-users] Fwd: APBS to Xplor format

Hello,

here is the original posting: http://sourceforge.net/mailarchive/forum.php?thread_name=28EDF831672B644C9E370B53D001F50701235CEB3974%40EMAIL05.pnl.gov&forum_name=apbs-users

I am still trying to find ways to get an electrostatic file output from APBS to an Xplor format in cubic form...


I had some help with a Python program, but that does not quite do the job (file is not compatible).


Is there any converter that can output an XPLOR file ?


Thanks for any pointers....


Jean-Yves Sgro -jsgro@wisc.edu-


-----------ORIGINAL POSTING:

March 23, 2011


Greetings,

I am trying to use a software that requires input of the electrostatic potential map as a .xplor file

http://bilbo.bio.purdue.edu/~viruswww/Rossmann_home/softwares/river_programs/rivem.php

The original paper (Xiao and Rossmann, j. Structural Biology 158(2007) 182-187 mentions that they calculated the map with Delphi. 
However, looking on the web site for Delphi that format does not seem to be the standard output.


I have clalcuated a .dx file that I was able to open within  UCSF Chimera in the hope that I could re-export it with that format, 
but that is not an option.

Is there a way to go from a .dx file to a .xplor file describing the electrostatic?


I have looked to what I believe is "everywhere" via Google but I cannot find any information on how one might do that. 
More confusing is the fact that xplor has multiple file formats, including PDB-like files.


The example file provided by the Riverm software (URL above) is about 200 Mb and has the following format at the top of the file 
(first line is blank):


     1
qdiffxas: qdiffxs4 with an improved surfacing routine       
     256     -74     182     256    -128     128     256     132     388
 0.12800E+03 0.12800E+03 0.12800E+03 0.90000E+02 0.90000E+02 0.90000E+02
ZYX
       0
 0.82800E-02 0.80512E-02 0.78926E-02 0.77350E-02 0.75803E-02 0.74275E-02
 0.72770E-02 0.71290E-02 0.69833E-02 0.68407E-02 0.67005E-02 0.65627E-02
 0.64282E-02 0.62969E-02 0.61677E-02 0.60427E-02 0.59206E-02 0.58022E-02
 0.56875E-02 0.55752E-02 0.54681E-02 0.53639E-02 0.52638E-02 0.51684E-02


and continues on for a long long time....

Thanks for anyone that can help with this new Format issue, so typical in the computer world.


Sincerely


Jean-Yves Sgro

----------------

From: http://nmr.cit.nih.gov/xplor-nih/xplorMan/node333.html

Electron Density Map File

The output file of the xrefin map statement contains information about the unit cell, indexing of the map, and the actual electron density map. It can be read by a modified version of MAPPAGE to provide a ``DSN6'' file for FRODO. Modified versions of this program are included in the directory ``[.VAX.FRODOMAP]" for the VAX/VMS system and ``sgi/fft" for the SGI systems. The grid size of the map is determined by the GRID parameter in the FFT statement. The following is a FORTRAN example of how to read the formatted (QFORM=.TRUE.) or unformatted (QFORM=.FALSE.) version of the electron density maps:
C
C read title
      IF (QFORM) THEN
      READ(UNIT,'(/I8)',END=6,ERR=7) NTITLE
      IF (NTITLE .LE. 0) THEN
      READ( UNIT, '(A)',END=6,ERR=7) 
      ELSE
      DO J = 1, NTITLE
      TITLE(J) = ' '
      READ (UNIT, '(A)',END=6,ERR=7) TITLE(J)
      ENDDO
      ENDIF
      ELSE 
      DO J=1,MXTITL
      TITLE(J)=' '
      END DO
      READ(UNIT,END=6,ERR=7) NTITLE,(TITLE(J)(1:80),J=1,NTITLE)
      END IF
C
C read sectioning information
      IF (QFORM) THEN
      READ(U,'(9I8)',END=6,ERR=7)
     &  NA,AMIN,AMAX,NB,BMIN,BMAX,NC,CMIN,CMAX
      ELSE
      READ(U,END=6,ERR=7)
     &  NA,AMIN,AMAX,NB,BMIN,BMAX,NC,CMIN,CMAX
      END IF
C
C read unit cell constants in angstroms and degrees
      IF (QFORM) THEN
      READ(U,'(6E12.5)',END=6,ERR=7) (CELL(I),I=1,6)
      ELSE 
      READ(U,END=6,ERR=7) (CELL(I),I=1,6)
      END IF
      END IF
C
C read matrix mode
      IF (QFORM) THEN
      READ(U,'(3A)',END=6,ERR=7) MODE 
      ELSE
      READ(U,END=6,ERR=7) MODE 
      END IF
      IF (MODE.NE.'ZYX') THEN 
      CALL WRNDIE(-5,'RMAP','error in matrix mode')
      GOTO 7
      END IF 
C           
C read density matrix, c is slowest ("z-sections"). 
      DO C=CMIN,CMAX
C
C read next section
      IF (QFORM) THEN
      READ(U,'(I8)',END=6,ERR=7) KSECT
      READ(U,'(6E12.5)',END=6,ERR=7)
     &  ((MAP(A,B,C),A=AMIN,AMAX),B=BMIN,BMAX)
      ELSE
      READ(U,END=6,ERR=7) KSECT
      READ(U,END=6,ERR=7)
     &  ((MAP(A,B,C),A=AMIN,AMAX),B=BMIN,BMAX)
      END IF
      END DO
The following lines show the beginning of a typical electron density map file:
       2 !NTITLE
 REMARKS FILENAME=""                                                                                                                          
 REMARKS DATE:18-Jun-90  12:24:08       created by user:                                                                            
 XMAP: extend NA=(  30   4  12) NB=(  15   5  10) NC=(  16   2  12) 
      30       4      12      15       5      10      16       2      12
 XMAP: a= 40.96, b= 18.65, c= 22.52, alpha= 90.00, beta= 90.77, gamma= 90.00
 0.40960E+02 0.18650E+02 0.22520E+02 0.90000E+02 0.90770E+02 0.90000E+02
 XMAP: written in ZYX mode (z-sections)
ZYX
 XMAP: section #   0 average density=-0.336     sigma= 0.907    
       0
-0.97086E+00-0.49927E+00-0.82774E+00-0.13491E+01-0.57034E+00-0.71253E-01
-0.19491E+00 0.61017E+00 0.10064E+01-0.22888E+01-0.94020E+00 0.77451E+00
 0.57539E+00-0.31211E-01-0.27430E+00-0.36526E+00 0.34772E+00 0.81884E+00
-0.19954E+01-0.10117E+01 0.18038E+01 0.19008E+01 0.11886E+00-0.41646E+00
 0.47560E-01 0.48855E+00 0.57606E+00-0.22320E+00-0.12787E+01 0.47590E+00


Xplor-NIH 2012-01-27