cdview ver.3.17

Features

cdview3 CAN:
  • Display particles' position, obtained from a molecular dynamics (MD) simulation, on the screen.
  • Make data easily by providing particles' position in text format.
  • Display particles' position successively by preparing data files. (simple animation function)
  • Draw bonds between particles.
  • Set particle color and radius freely.
  • Save images in BMP (Can also create movie by using movie making software)
  • PDB files are supported.
  • Draw scalar quantity (e.g. 3D potential energy)
  • Display spheroidal particle (for liquid-crystal etc)
  • Change position of particle.

Download and Install

How To Use

Just drag and drop a file (or files) onto cdview3.exe icon.

cdview3 can also be executed by a command-line.
Type "cdview3 [FILENAME(s)]"
Enter the file name of coordinate data file into [FILENAME(s)].
This command also accepts wild cards.

Basic Operation

By using mouse, cdview can change viewing angle or viewpoint, and select particle.

Left Click + Drag Rotate angle
Right Click + Drag Move forward and backward
Left & Right Click + Drag Move parallel to screen
CTRL+Left Drag Tilt angle
Point Particle + Left Click Select particle

Keyboard shortcuts and commands are available. Type '/' to access Command Mode.

All available shortcuts/commands are shown in The Details of Operation.

Coordinate Data Files

The following three formats are acceptable for data file.

  • cdview format (extension ".cdv")
    Text data with 3D coordinate of particle
  • fdview format (".fdv")
    Text data with scalar quantity of 3D space
  • PDB format (".pdb")
    Coordinate data, frequently-used for protein
  • Amber prep file (".in", ".prep")
    Molecule structure data for Amber

cdview Format

The recommended file extension is "cdv". Any file extension is acceptable, except "fdv" and/or "pdb".

Basically, provide each particle information per line. Format is:

  [serial number] [particle type] [x] [y] [z]

The followings are examples of Data File.

0 0 379.434700 344.410400 391.625700
1 0 363.349400 396.798000 354.886200
2 0 363.111300 382.512500 408.103700
3 0 363.352600 344.300500 360.257600

Particle colors are defined based on the particle type. The default setting for colors:

  0:red 1:green 2:blue 3:cyan 4:magenta 5:yellow
6:dark green 7:gray 8:white 9:hide (non-display)

For more details, please see: cdview Format Details

fdview Format

File extension is "fdv".

This is the format for displaying scalar quantity on 3D lattice in contour line or surface. In the beginning of the file, number of lattices should be written as follows:

  ' fv_xn=[number of x lattice] fv_yn=[number of y lattice] fv_zn=[number of z lattice]

Data Format looks like:

  [x-lattice] [y-lattice] [z-lattice] [x] [y] [z] [scalar quantity]

Lattice coordinate should be smaller integer value than the number of lattice. Coordinates and Scalar quantities should be real-valued.

The followings are examples of Data File

' fv_xn=27 fv_yn=27 fv_zn=27
0 0 0  -67.426294 -67.426294 -66.649452  3.593000
0 0 1  -67.426294 -67.426294 -61.470506  2.258000
0 0 2  -67.426294 -67.426294 -56.291561  1.573000
0 0 3  -67.426294 -67.426294 -51.112615  0.768000
0 0 4  -67.426294 -67.426294 -45.933669 -0.395000
  ...

For more details, please see: fdview Format Details

Regarding displaying fdview file, Cursor Up/Down Shift cross-section, Cursor Right/Left Change displayed contour surface

pdb Format

File extension is "pdb".

pdb format is used exclusively for showing protein structure. The followings are examples of Data File.

ATOM      1  N   LYS     1      41.863  28.070  11.605  1.00  0.00
ATOM      2  H1  LYS     1      41.406  28.282  12.480  1.00  0.00
ATOM      3  H2  LYS     1      42.854  28.243  11.702  1.00  0.00
ATOM      4  H3  LYS     1      41.708  27.076  11.510  1.00  0.00
ATOM      5  CA  LYS     1      41.314  28.960  10.570  1.00  0.00
ATOM      6  HA  LYS     1      40.242  28.776  10.629  1.00  0.00
ATOM      7  CB  LYS     1      41.562  30.453  10.774  1.00  0.00
ATOM      8  HB2 LYS     1      42.494  30.795  10.323  1.00  0.00
  ...

For more details, please see:Worldwide Protein Data Bank

As to PDB file, type 'e' to select protein display mode, 'w' to select water display mode.

The Applied Operation

The keyboard shortcuts are available. The followings are operative examples:

Simple Animation Function and Movie

cdview can display particle motion easily and make movies of them since it was made for showing the simulation results of molecular dynamics etc.

To use the Simple Animation Function, prepare sequentially-numbered particle coordinate files (or PDBs) like "pos001.cdv, pos002.cdv,pos003.cdv ..." and go through the following procedure.

  • Drag & Drop pos001.cdv, the beginning file, on cdview3
  • Type 'z', 'c' to switch files
  • Type 'Z', 'C' to switch files sequentially
  • Type 'x' to stop sequential switching files
  • Type 'a' to jump to the beginning file , and 's' to the last file

File switching speed increases by loading all the data into memory. The procedure is as follows.

  1. Type '/' to access Command Mode
  2. Type "mem"
  3. Specify file loading interval (default:1)

When there are too many files, it is recommended to set interval wider in order to save memory.

When the Simple Animation Function is active, follow the procedure below to output image files for making movies.

  • Type 'S' (or alt+'s') to output images while switching sequentially in ascending order.
  • Type 'A' (or alt+'a') to output images while switching sequentially in descending order.

From output image files, you can make movies by using FFmpeg or other applications.
alt+'s' (or alt+'a') give sequential file number which begins 1. (For FFmpeg)

When FFmpeg command is set in an environment variable CDVIEW_MAKE_MOVIE_COMMAND, the command is automatically performed after alt+'s' or alt+'a' key. FFmpeg should be installed in a path which is set in the PATH environment variable. FFmpeg command should be included special words %IN% and %OUT%. The former is replaced with the input file name and the latter is replaced with the output file name which not include the file extension. The followings are command examples.

Command Format
ffmpeg -y -r 15 -i %IN% -vcodec libx264 -pix_fmt yuv420p %OUT%.mp4 frame-rate:15, file format:mp4
fmpeg -y -r 15 -i %IN% -b 2000k -vcodec wmv2 %OUT%.wmv frame-rate:15, bit-rate:200kbps, file format:wmv

When CDVIEW_REMOVE_BMP_AFTER_MAKING_MOVIE is set 1, bmp files for the making movie are removed automatically.

When command line option -auto [keys] is set, [keys] are automatically inputed. If you set -auto DDDvvs+q, 'D' is inputed 3 times, 'v' is inputed 2 times, alt+'s' is inputed, and 'q' is inputed to finish cdview3. Then, you can make many movie files, if you make a batch file.

Searching of Particles

Type 'l' to show particle labels. When displayed particles are few, it is easy to find particles with specific labels.

When displayed particles are many, follow the procedure below.

  1. Type 'f' to move to particle search mode
  2. Enter a label number of the particle
  3. Type 'g' to display only selected particle
  4. Type 'g' again to display selected particle and its surroundings
  5. Type 'j' to focus the selected particles

Type again 'j' to cancel particle focusing, 'g' to display all particles.

Change Particle Position (particle migration mode)

To change particle position, follow the procedure below.

  • Enter 'm' to run particle migration mode.
  • Use Left Drag to select a particle, and move in 2D area
  • Use Left Drag somewhere else to change viewing angle and area
  • Enter '?' to undo the last migration.
  • Enter 'o' to save changed particle file.

When the particle with bond are moved, combined particles are also moved together without changing bond-length. This is useful for editing PDB files. Refer to Add/Delete bond for more information on making bonds.

Add or Delete Bond

To add/delete bond, follow the procedure below.

  • Select 2 particles to add/delete bond.
  • Type '/' to access Command Mode. Then type "make_b" to set bond length and add bond.
  • Type '/' to access Command Mode, and "rm_b" to delete bond.

Complement missing residues in PDB file

When there are missing residues, you can complement them by adding the residue to missing part. The procedure is as follows.

  • Type '/' to access Command Mode, and enter "add_rn".
  • Enter 3-letter Residue name (With space delimited, more than one name can be entered)
  • Added residues will be straightened. See Particle Move Mode to move them appropriately.
  • To connect to other residues, see Add/Delete bond and make bonds.

The above is the way to add Residue in C-direction (ascending order). To add Residue in N-direction (descending order), type command 'add_rp'.

The Details of Operation

Mouse Operation

Left ClickShow details of clicked particle
"SHIFT-Click" is acceptable to select multiple items.
Left Drag Rotate angle
Right Drag (Up and Down) Move forward and backward
Left & Right Click + Drag Move parallel to screen
CTRL + Left Drag (Rotate) Tilt angle (rotate vertically to screen)

Keyboard Operation

KeyFunction
ESCQuit
SPCChange atom type column (for "cdview" files)
-Show/Hide of all the atom types (for "cdview" files)
/Use Command Mode
0Show all atom types
1-9Show/Hide particles (type: 0 - 8) (from 10 to 18, use +alt)
=Show/Hide particles (type : 9, as to 19, use +alt)
>Move selected residue in ascending order (for "pdb" files)
<Move selected residue in descending order (for "pdb" files)
?Cancel to move particles
aGo to the first file
AMove file sequentially in descending order with outputting bmp (for making movie)
bChange to Perspective/Orthographic projection
cMove file in ascending order
CMove file in descending order
dDecrease particle details
DIncrease particle details
eChange Drawing Mode in ascending order (for "pdb" files)
EChange Drawing Mode in descending order (for "pdb" files)
fSearch particle(s)
FSearch residue(s) (for "pdb" files)
gChange display mode of selected atom
hShow/Hide additional surface data
HMake additional surface data translucent
iChange Color Mode in ascending order (for "pdb" files)
IChange Color Mode in descending order (for "pdb" files)
jFocus on selected particle
JShow/Hide axis index
kChange Cell's Display Mode in ascending order
KChange Cell's Display Mode in descending order
lChange Label Display Mode in ascending order
LChange Label Display Mode in descending order
mParticle Move Mode
nChange particle name (for "pdb" files)
oOutput file
OOutput BMP file
qQuit
rDecrease particle size
RIncrease particle size
sGo to last file
SMove file sequentially in ascending order with outputting bmp (for making movie)
tTranslate selected 2 particles in the same position
uShow/Hide isosurface
UChange isosurface draw mode
vChange text display level in ascending order
VChange text display level in descending order
wChange water display mode in ascending order (for "pdb" files)
WChange water display mode in descending order (for "pdb" files)
xStop sequentially file changing
yFit/Don't Fit to reference file (for "pdb" files)
YShow/Hide reference file
zMove file in descending order
ZMove file sequentially in descending order
[Change Background Color (White/Black)
DELDelete Selected Particle(s)
F1Show Keyboard Operation Help
F2Show Command Help

Command List

CommandShort CommandFunction
calc rmsdrmsdCalculate RMSD (for pdb files)
calc rmsfrmsfCalculate RMSF (for pdb files)
calc distancedisCalculate time-dependent distance between 2 particles
del distanceddisDelete distance calculation window
store memorymemLoad memory of multiple files
set skipskipSet skip numbers of file moving
set time_unittuSet time unit [fs/ps/ns]
show linelineDisplay particles bond line
hide lineline_offHide bond line
show particleparticleDisplay particle
hide particleparticle_offHide particle
calc solvent_exclude_surfacesesCalculate solvent exclude surface (SES)
calc solvent_exclude_surface_allses_allCalculate SES all flames
add texttextShow arbitrary text
find particle_labellabelSearch Particles
output bmpbmpOutput BMP file in 'O'
output povpovOutput POV file in 'O'(shadow off)
output pov_shadowpov_shadowOutput POV file in 'O'(shadow on)
calc densitydenDensity calculation
fit axis [x|y|z]fita [x|y|z]Fit selected 2 particles to axis
add residue nextadd_rnAdd residue in descending order
add residue prevadd_rpAdd residue in ascending order
change residuecrChange residue name (side chain is deleted)
change atomchange_aChange atom name (for pdb files)
make bondmake_bAdd bond between selected 2 particles
remove bondrm_bDelete bond between selected 2 particles
change level_maxlmaxChange max level of isosurface
change level_minlminChange min level of isosurface
gr particlegrCalculate radial distribution function
gr monomergr monoCalculate monomer radial distribution function
adjust depthdepthAdjust display depth
output prepprepOutput prep file
move dummymv_dMove dummy particles in prep file
change show_selected_particle_rangechange s_rangeSet range around selected particle
set clip_planeclipSet clip plane( x??, y?? or z?? )
add clip_planeadd_clipAdd clip plane( x??, y?? or z?? )
rotaterotCoordinate Rotation: rot [x|y|z] angle (cNum): Num is chain number
translatetransMove Coordinate: trans [x|y|z] length (cNum): Num is chain number
set c_colorc_colorSet number of continuous color columns: num [min] [max]
num: number of columns follow on coordinate (Max:4)
min,max: Minimum/Maximum of color value
set eye_angleeye_angleSet eye angle (default 30 deg.)
rotate moleculerot_molRotate selected molecule (for PDB file)

Details of cdview Format

Format

The followings are examples of Data File
0 0 379.434700 344.410400 391.625700 0 0 0 2
1 0 363.349400 396.798000 354.886200 0 0 0 0
2 0 363.111300 382.512500 408.103700 0 0 0 3
3 0 363.352600 344.300500 360.257600 1 9 9 9
4 0 372.181800 401.394000 350.105200 0 0 0 0
5 0 406.834800 394.561500 374.777800 2 0 9 9
Format is:
[serial number] [particle type 0] [x] [y] [z] [particle type 1] [particle type 2] ...

Particle type should be integer number, and colors are specified by the integer numbers.

Maximum number of particle type column is 6. Those can be switched by space-key.

When the particle type column of particle is just 1, the format is:
[serial number] [particle type] [x] [y] [z]

Comments and Commands in Comment Lines

Lines locate in the beginning of files and start with ' or # are identified as comments.

The followings are available commands in comment lines.

box_sx=[num]x of the start point of the simulation cell box
box_sy=[num]y of the start point of the simulation cell box
box_sz=[num]z of the start point of the simulation cell box
box_ex=[num]x of the end point of the simulation cell box
box_ey=[num]y of the end point of the simulation cell box
box_ez=[num]z of the end point of the simulation cell box
box_wt=[num]Thickness of the simulation cell box
box_c=([num1],[num2],[num3])Specify the color of the simulation cell box. num1 for red, num2 for green, num3 for blue When the background is white, specify colors in box_c2.
r?=[num]Put integer value into "?" to specify the radius of the particle type "?"
c?=([num1],[num2],[num3])Put integer value into "?" to specify the color of particle type "?". num1 for red, num2 for green, num3 for blue
bond_file=[file_name]Specify the name of file with bond information.
bond?_c=([num1],[num2],[num3])Put integer value into "?" to specify the color of bonds. num1 for red, num2 for green, num3 for blue
bond?_wt=[num]Put integer value into "?" to specify the thickness of bonds.
face_file=[file_name]Specify the name of file with face display information
face?_c=([num1],[num2],[num3])Put integer value into "?" to specify the color of face. num1 for red, num2 for green, num3 for blue
st?=[str]Put integer value into "?". Type in strings of adequate characters into [str].
st?_pos=([num1],[num2])Display position of strings of characters (recommended range: from -2.5 to 2.5)
light_position=([num1],[num2],[num3])Specify the light-source direction. Default: (1.2,1.0,1.1)
c_color=[num]Set number of columns to change color of particles continuously.
c_color_start=([num1],[num2],[num3])The start color of continuous color changing.
c_color_end=([num1],[num2],[num3])The end color of continuous color changing.

The default setting for colors:
0:red 1:green 2:blue 3:cyan 4:magenta 5:yellow 6:dark green 7:gray 8:white 9:hide (non-display) 11-99:gray

Display Bonds

You can draw bond between any particles by specifying bond file with command in comment line. (for cdview file)

In the bond file, two serial numbers of particles and bond type should be provided. When the bond type is omitted, it is treated as bond type "0".

You can also display bond between particles by writing bond information with same format in cdv or pdb file. In this case, use "CDVIEW_BOND" in the beginning of line. (Use "REMARK CDVIEW_BOND" for pdb file.)

Display Faces

You can draw a triangle among any 3 particles by specifying face file with command in comment line. (for cdview file)

In the face file, three serial numbers of particles and face type should be provided. When the face type is omitted, it is treated as face type "0".

You can also display face between particles by writing face information with same format in cdv file. In this case, use "CDVIEW_FACE" in the beginning of line.

Display Spheroids

When you set particle's radius as r0=(1.0,2.0,3.0), you can display spheroids with each of their radius is x-axis:1.0, y-axis:2.0, z-axis:3.0

Particle angle can be set by entering quaternion (ξ,η,ζ,χ )  next to the x, y, z-coordinates. The relation between quaternion and Euler angle is given by the following equations.

          θ    ψ  - ϕ
	 ξ  =   sin--sin------
         2       2
	 η  =   sin θ-cos ψ---ϕ
         2       2
         θ    ψ + ϕ
	 ζ  =   cos -sin ------
         2      2
	 χ  =   cos θcos ψ-+-ϕ-
         2      2

Start-up Options

You can set start-up options when start from command line.

-level_numNumber of isosurfaces (for fdview)
-level_maxMaximum value of isosurfaces (for fdview)
-level_minMinimum value of isosurfaces (for fdview)
-detailDefault value of details for polygon (default 6)
-c [file_name][file_name]:Information file of header
-eye_posSet default viewpoint
-rot_posSet center of rotation
-w[num][num]:Window width (default 448)
-h[num][num]:Window height (default 448)
-x[num][num]:X of the window (default 50)
-y[num][num]:Y of the window (default 0)
-ax[num][num]:View angle around the X axis of the rotation. (default 0)
-ay[num][num]:View angle around the Y axis of the rotation. (default 0)
-az[num][num]:View angle around the Z axis of the rotation. (default 0)
-jOrthographic mode
-fullFull-Screen mode
-stereoStereo mode
-eye_angleView angle (default 30)
-auto

Environment Variable

CDVIEW_PARTICLE_SIZE_SCALEThe radius value of particle in cdview file. The default setting is 0.7
CDVIEW_ENABLE_AXISSet 1 to display the axis index by default.
CDVIEW_LIGHT_POSITION_XX in light-source direction
CDVIEW_LIGHT_POSITION_YY in light-source direction
CDVIEW_LIGHT_POSITION_ZZ in light-source direction
CDVIEW_DISABLE_ERROR_HIT_ENTER Disable Hit Enter Key when an error message is showed
CDVIEW_MAKE_MOVIE_COMMAND Command to make FFmpeg movie after alt+'s' and alt+'a' key
CDVIEW_REMOVE_BMP_AFTER_MAKING_MOVIE Set 1 to remove bmp files for FFmpeg movie

Download and Install

Download

cdview317.zip (Windows)

An alternative binary in which you should use alt+left click to select a particle is made, because the particle selection is very slow if your graphic board dose not have hardware acceleration for the polygon selection. Please use the following binary, if the particle selection is very slow.
cdview317_alt_pick.zip (Windows)

Install

Put the unzip file folder to someplace appropriately.

The program is written in OpenGL and glut. freeglut is used in ver. 3.15 or later. Any additional dlls are not required because of static link. glut32.dll is needed in ver. 3.15 or later.

Source code

Source code is in http://sourceforge.net/projects/cdview/
Please change Makefile according to your environment.

History