12 | The MolScript program is Open Source as of 1 Nov 2014. It is available
13 | under the MIT license.
14 |
15 |
16 |
17 | Top page
18 |
19 |
20 |
--------------------------------------------------------------------------------
/code/clib/angle.h:
--------------------------------------------------------------------------------
1 | /* angle.h
2 |
3 | Angle constants
4 |
5 | clib v1.0
6 |
7 | Copyright (C) 1997 Per Kraulis
8 | 29-Jan-1997 split out of MolScript
9 | 3-Dec-1997 changed PI to ANGLE_PI to avoid clashes
10 | */
11 |
12 | #ifndef ANGLE_H
13 | #define ANGLE_H 1
14 |
15 | #define ANGLE_PI 3.14159265358979323846
16 |
17 | #define to_radians(d) ((d)*ANGLE_PI/180.0)
18 | #define to_degrees(d) ((d)*180.0/ANGLE_PI)
19 |
20 | #define SQRT2 1.4142136
21 |
22 | #endif
23 |
--------------------------------------------------------------------------------
/examples/ras_gdp_balls.in:
--------------------------------------------------------------------------------
1 | ! MolScript v2.1 input file
2 |
3 | ! GDP using ball-and-stick.
4 |
5 | title "GDP ball-and-stick"
6 |
7 | plot
8 |
9 | window 16;
10 |
11 | read mol "ras.pdb";
12 |
13 | transform atom *
14 | by centre position in residue 200
15 | by rotation
16 | -0.746436 -0.361124 0.558947
17 | 0.235416 0.64233 0.729378
18 | -0.622425 0.676019 -0.394444
19 | ;
20 |
21 | ball-and-stick in residue 200;
22 |
23 | end_plot
24 |
--------------------------------------------------------------------------------
/code/image.h:
--------------------------------------------------------------------------------
1 | /* image.h
2 |
3 | MolScript v2.1.2
4 |
5 | Image file output definitions and routines.
6 |
7 | This implementation requires OpenGL, GLX (X windowing system) and
8 | the GLUT library. It relies on the 'opengl.c' code.
9 |
10 | Copyright (C) 1997-1998 Per Kraulis
11 | 11-Sep-1997 split out of jpeg.h
12 | */
13 |
14 | #ifndef IMAGE_H
15 | #define IMAGE_H 1
16 |
17 | void image_first_plot (void);
18 | void image_render (void);
19 | void image_close (void);
20 |
21 | #endif
22 |
--------------------------------------------------------------------------------
/code/clib/mol3d_chain.h:
--------------------------------------------------------------------------------
1 | #ifndef MOL3D_CHAIN_H
2 | #define MOL3D_CHAIN_H 1
3 |
4 | #include
5 | #include
6 |
7 | typedef struct s_mol3d_chain mol3d_chain;
8 |
9 | struct s_mol3d_chain {
10 | int length;
11 | res3d **residues;
12 | at3d **atoms;
13 | mol3d_chain *next;
14 | };
15 |
16 | mol3d_chain *
17 | mol3d_chain_find (mol3d *first_mol, char *atomname,
18 | double cutoff, int *res_sel);
19 |
20 | void
21 | mol3d_chain_delete (mol3d_chain *first_ch);
22 |
23 | #endif
24 |
--------------------------------------------------------------------------------
/examples/ras_frames.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | MolScript v2.1: Ras p21 VRML example
4 |
5 |
6 |
15 |
16 |
--------------------------------------------------------------------------------
/examples/ras_gdp_bonds.in:
--------------------------------------------------------------------------------
1 | ! MolScript v2.1 input file
2 |
3 | ! GDP using bonds.
4 |
5 | title "GDP bonds"
6 |
7 | plot
8 |
9 | window 16;
10 |
11 | read mol "ras.pdb";
12 |
13 | transform atom *
14 | by centre position in residue 200
15 | by rotation
16 | -0.746436 -0.361124 0.558947
17 | 0.235416 0.64233 0.729378
18 | -0.622425 0.676019 -0.394444
19 | ;
20 |
21 | set colourparts on,
22 | linewidth 2;
23 |
24 | bonds in residue 200;
25 |
26 | end_plot
27 |
--------------------------------------------------------------------------------
/code/eps_img.h:
--------------------------------------------------------------------------------
1 | /* eps_img.h
2 |
3 | MolScript v2.1.2
4 |
5 | Encapsulated PostScript (EPS) image file.
6 |
7 | This implementation relies on the 'image.c' code, and therefore
8 | implicitly on OpenGL and GLX.
9 |
10 | Copyright (C) 1997-1998 Per Kraulis
11 | 13-Sep-1997 working
12 | */
13 |
14 | #ifndef EPS_IMG_H
15 | #define EPS_IMG_H 1
16 |
17 | void eps_set (void);
18 | void eps_first_plot (void);
19 | void eps_finish_output (void);
20 | void eps_set_bw (void);
21 | void eps_set_scale (float new);
22 |
23 | #endif
24 |
--------------------------------------------------------------------------------
/examples/ras_coil.in:
--------------------------------------------------------------------------------
1 | ! MolScript v2.1 input file
2 |
3 | ! Show coil.
4 |
5 | title "c-H-ras p21 protein (1-166), complex with GDP and Mg"
6 |
7 | plot
8 |
9 | window 40;
10 |
11 | read mol "ras.pdb";
12 |
13 | transform atom *
14 | by centre position atom *
15 | by rotation
16 | 0.450861 0.724522 -0.521337
17 | 0.328525 0.408374 0.851647
18 | 0.829937 -0.555246 -0.0539039
19 | by translation -2 1 0
20 | ;
21 |
22 | set planecolour green;
23 | coil from 1 to 166;
24 |
25 | end_plot
26 |
--------------------------------------------------------------------------------
/examples/ras_trace.in:
--------------------------------------------------------------------------------
1 | ! MolScript v2.1 input file
2 |
3 | ! Show trace.
4 |
5 | title "c-H-ras p21 protein (1-166), complex with GDP and Mg"
6 |
7 | plot
8 |
9 | window 20;
10 |
11 | read mol "ras.pdb";
12 |
13 | transform atom *
14 | by centre position atom *
15 | by rotation
16 | 0.450861 0.724522 -0.521337
17 | 0.328525 0.408374 0.851647
18 | 0.829937 -0.555246 -0.0539039
19 | by translation -2 -8 0
20 | ;
21 |
22 | set linecolour red;
23 | trace from 1 to 166;
24 |
25 | end_plot
26 |
--------------------------------------------------------------------------------
/examples/ras_turn.in:
--------------------------------------------------------------------------------
1 | ! MolScript v2.1 input file
2 |
3 | ! Show turn.
4 |
5 | title "c-H-ras p21 protein (1-166), complex with GDP and Mg"
6 |
7 | plot
8 |
9 | window 40;
10 |
11 | read mol "ras.pdb";
12 |
13 | transform atom *
14 | by centre position atom *
15 | by rotation
16 | 0.450861 0.724522 -0.521337
17 | 0.328525 0.408374 0.851647
18 | 0.829937 -0.555246 -0.0539039
19 | by translation -2 1 0
20 | ;
21 |
22 | set planecolour cyan;
23 | turn from 1 to 166;
24 |
25 | end_plot
26 |
--------------------------------------------------------------------------------
/code/png_img.h:
--------------------------------------------------------------------------------
1 | /* png_img.h
2 |
3 | MolScript v2.1.2
4 |
5 | PNG image file.
6 |
7 | This implementation is based on the PNG Reference Library 1.0
8 | version 0.96 and zlib v1.0.4. It relies on the 'image.c' code,
9 | and therefore implicitly on OpenGL and GLX.
10 |
11 | Copyright (C) 1997-1998 Per Kraulis
12 | 12-Sep-1997 started
13 | */
14 |
15 | #ifndef PNG_IMG_H
16 | #define PNG_IMG_H 1
17 |
18 | void pngi_set (void);
19 | void pngi_first_plot (void);
20 | void pngi_finish_output (void);
21 | int pngi_set_compression (char *level);
22 |
23 | #endif
24 |
--------------------------------------------------------------------------------
/code/clib/element_lookup.h:
--------------------------------------------------------------------------------
1 | /* element_lookup.h
2 |
3 | Chemical element symbol lookup.
4 |
5 | clib v1.1
6 |
7 | Copyright (C) 1998 Per Kraulis
8 | 2-Mar-1998 first attempts
9 | 4-Mar-1998 written
10 | */
11 |
12 | #ifndef ELEMENT_LOOKUP_H
13 | #define ELEMENT_LOOKUP_H 1
14 |
15 | #include
16 |
17 | extern const int element_max_number;
18 |
19 | int element_number (const char *symbol);
20 | int element_number_convert (const char *symbol);
21 | int element_valid_number (int number);
22 | char *element_symbol (int element_number);
23 |
24 | #endif
25 |
--------------------------------------------------------------------------------
/examples/ras_mg_text.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | Ras p21: Mg ion
4 |
5 |
6 |
7 |
8 |
9 |
Mg ion
10 |
11 | A magnesium (Mg) ion is a required constituent of the catalytically
12 | competent enzyme, and seems to be present in all physiologically
13 | relevant forms of the protein. It is possible to substitute in
14 | vitro the Mg for certain other divalent metal ions, such as
15 | manganese (Mn).
16 |
11 | The two long loops closest to the Mg ion display the largest
12 | conformational differences when comparing the GDP and GTP forms of ras
13 | p21. These loops are also the most variable, as illustrated
14 | in this VRML model,
15 | where the colours indicate variability (blue=well-defined,
16 | red=variable). These loops are the main sites of interactions with
17 | other proteins, such as SOS and rasGAP.
18 |
11 | The GDP molecule consists of three moieties: The guanine ring, which
12 | is a nitrogen-containing heterocycle; the ribose sugar ring; and the
13 | diphosphate group, with purple atoms being phosphorus. The
14 | abbreviation GDP stands for guanosine diphosphate. The active, "on" form
15 | of the ras protein contains the triphosphate (GTP), which is
16 | hydrolysed to the diphosphate by the enzyme. This reaction is much
17 | enhanced by interactions with Ras-GAP.
18 |
10 |
11 | The material embodied in this software is provided to you "as-is" and
12 | without warranty of any kind, express, implied or otherwise, including
13 | without limitation, any warranty of fitness for a particular
14 | purpose. In no event shall Avatar Software AB be liable to you or
15 | anyone else for any direct, special, incidental, indirect or
16 | consequential damages of any kind, or any damages whatsoever,
17 | including without limitation, loss of profit, loss of use, savings or
18 | revenue, or the claims of third parties, whether or not Avatar
19 | Software AB has been advised of the possibility of such loss, however
20 | caused and on any theory of liability, arising out of or in connection
21 | with the possession, use or performance of this software.
22 |
23 |
24 |
25 | Top page
26 |
27 |
28 |
--------------------------------------------------------------------------------
/code/coord.h:
--------------------------------------------------------------------------------
1 | /* coord.h
2 |
3 | MolScript v2.1.2
4 |
5 | Coordinate data handling.
6 |
7 | Copyright (C) 1997-1998 Per Kraulis
8 | 4-Dec-1996 first attempts
9 | 3-Jan-1997 fairly finished
10 | 30-Jan-1997 use clib mol3d
11 | */
12 |
13 | #ifndef COORD_H
14 | #define COORD_H 1
15 |
16 | #include "clib/mol3d_io.h"
17 | #include "clib/mol3d_init.h"
18 | #include "clib/mol3d_chain.h"
19 |
20 |
21 | #define PEPTIDE_CHAIN_ATOMNAME "CA"
22 | #define PEPTIDE_DISTANCE 4.2
23 | #define NUCLEOTIDE_CHAIN_ATOMNAME "P"
24 | #define NUCLEOTIDE_DISTANCE 10.0
25 |
26 | extern mol3d *first_molecule;
27 | extern int total_atoms;
28 | extern int total_residues;
29 |
30 | void store_molname (char *name);
31 | void read_coordinate_file (char *filename);
32 | void init_molecule (mol3d *mol);
33 | void update_totals (void);
34 |
35 | void copy_molecule (char *name);
36 | void delete_molecule (char *name);
37 | void delete_all_molecules (void);
38 |
39 | mol3d_chain *get_peptide_chains (void);
40 | mol3d_chain *get_nucleotide_chains (void);
41 |
42 | void position (void);
43 |
44 | #endif
45 |
--------------------------------------------------------------------------------
/code/other/regex.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Definitions etc. for regexp(3) routines.
3 | *
4 | * Caveat: this is V8 regexp(3) [actually, a reimplementation thereof],
5 | * not the System V one.
6 | *
7 | * Copyright: see 'regex.c' file.
8 | *
9 | * Per Kraulis
10 | * 29-Jan-1997 converted to ANSI C
11 | * 18-Jun-1997 changed argument tests into assert's
12 | * 17-Sep-1997 added function 'regcomp_pjk', which takes a MolScript-style
13 | * regular expression and compiles it into a 'regexp'
14 | */
15 |
16 | #ifndef REGEX_H
17 | #define REGEX_H 1
18 |
19 | #define NSUBEXP 10
20 |
21 | typedef struct regexp {
22 | char *startp[NSUBEXP];
23 | char *endp[NSUBEXP];
24 | char regstart; /* Internal use only. */
25 | char reganch; /* Internal use only. */
26 | char *regmust; /* Internal use only. */
27 | int regmlen; /* Internal use only. */
28 | char program[1]; /* Unwarranted chumminess with compiler. */
29 | } regexp;
30 |
31 | void regerror (char *s);
32 | regexp *regcomp (char *exp);
33 | int regexec (regexp *prog, char *string);
34 |
35 | regexp *regcomp_pjk (const char *str);
36 |
37 | #endif
38 |
--------------------------------------------------------------------------------
/LICENSE.txt:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 1997-1998 Per J. Kraulis
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/docs/LICENSE.txt:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 1997-1998 Per J. Kraulis
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/code/raster3d.h:
--------------------------------------------------------------------------------
1 | /* raster3d.h
2 |
3 | MolScript v2.1.2
4 |
5 | Raster3D; input for the 'render' program.
6 |
7 | Copyright (C) 1997-1998 Per Kraulis
8 | 4-Dec-1996 first attempts
9 | 16-Sep-1997 label output using GLUT stroke character def's
10 | 17-Sep-1997 fairly finished
11 | */
12 |
13 | #ifndef RASTER3D_H
14 | #define RASTER3D_H 1
15 |
16 | #include "coord.h"
17 |
18 | void r3d_set (void);
19 |
20 | void r3d_first_plot (void);
21 | void r3d_finish_output (void);
22 | void r3d_start_plot (void);
23 | void r3d_finish_plot (void);
24 |
25 | void r3d_set_area (void);
26 | void r3d_set_background (void);
27 | void r3d_directionallight (void);
28 | void r3d_pointlight (void);
29 | void r3d_comment (char *str);
30 |
31 | void r3d_coil (void);
32 | void r3d_cylinder (vector3 *v1, vector3 *v2);
33 | void r3d_helix (void);
34 | void r3d_label (vector3 *p, char *label, colour *c);
35 | void r3d_line (boolean polylines);
36 | void r3d_points (int colours);
37 | void r3d_sphere (at3d *at, double radius);
38 | void r3d_stick (vector3 *v1, vector3 *v2, double r1, double r2, colour *c);
39 | void r3d_strand (void);
40 |
41 | void r3d_object (int code, vector3 *triplets, int count);
42 |
43 | void r3d_set_antialiasing (int new);
44 |
45 | #endif
46 |
--------------------------------------------------------------------------------
/code/clib/ogl_body.h:
--------------------------------------------------------------------------------
1 | #ifndef OGL_BODY_H
2 | #define OGL_BODY_H 1
3 |
4 | #include
5 |
6 | void
7 | ogl_sphere_vertices_ico (vector3 *pos, double radius, int level);
8 |
9 | void
10 | ogl_sphere_faces_ico_recursive (vector3 *pos, double radius, int depth);
11 |
12 | void
13 | ogl_sphere_faces_globe (vector3 *pos, double radius, int segments);
14 |
15 | void
16 | ogl_tetrahedron_vertices (vector3 *pos, double radius);
17 |
18 | void
19 | ogl_tetrahedron_edges (vector3 *pos, double radius);
20 |
21 | void
22 | ogl_tetrahedron_faces (vector3 *pos, double radius);
23 |
24 | void
25 | ogl_octahedron_vertices (vector3 *pos, double radius);
26 |
27 | void
28 | ogl_octahedron_edges (vector3 *pos, double radius);
29 |
30 | void
31 | ogl_octahedron_faces (vector3 *pos, double radius);
32 |
33 | void
34 | ogl_cube_vertices (vector3 *pos, double radius);
35 |
36 | void
37 | ogl_cube_edges (vector3 *pos, double radius);
38 |
39 | void
40 | ogl_cube_faces (vector3 *pos, double radius);
41 |
42 | void
43 | ogl_icosahedron_vertices (vector3 *pos, double radius);
44 |
45 | void
46 | ogl_icosahedron_edges (vector3 *pos, double radius);
47 |
48 | void
49 | ogl_icosahedron_faces (vector3 *pos, double radius);
50 |
51 | void
52 | ogl_cylinder_faces (vector3 *pos1, vector3 *pos2,
53 | double radius, int segments, boolean capped);
54 |
55 | #endif
56 |
--------------------------------------------------------------------------------
/code/opengl.h:
--------------------------------------------------------------------------------
1 | /* opengl.h
2 |
3 | MolScript v2.1.2
4 |
5 | OpenGL.
6 |
7 | This implementation requires the GLUT library.
8 |
9 | Copyright (C) 1997-1998 Per Kraulis
10 | 25-Jun-1997
11 | 11-Sep-1997 fairly finished
12 | */
13 |
14 | #ifndef OPENGL_H
15 | #define OPENGL_H 1
16 |
17 | #include "coord.h"
18 |
19 | void ogl_set (void);
20 |
21 | void ogl_first_plot (void);
22 | void ogl_start_plot (void);
23 | void ogl_finish_plot (void);
24 |
25 | void ogl_start_plot_general (void);
26 | void ogl_render_init (void);
27 | void ogl_render_lights (void);
28 | void ogl_render_lists (void);
29 |
30 | int ogl_accum (void);
31 | void ogl_set_accum (int number);
32 |
33 | void ogl_set_area (void);
34 | void ogl_set_background (void);
35 | void ogl_directionallight (void);
36 | void ogl_pointlight (void);
37 | void ogl_spotlight (void);
38 |
39 | void ogl_coil (void);
40 | void ogl_cylinder (vector3 *v1, vector3 *v2);
41 | void ogl_helix (void);
42 | void ogl_label (vector3 *p, char *label, colour *c);
43 | void ogl_line (boolean polylines);
44 | void ogl_sphere (at3d *at, double radius);
45 | void ogl_stick (vector3 *v1, vector3 *v2, double r1, double r2, colour *c);
46 | void ogl_strand (void);
47 |
48 | void ogl_start_object (void);
49 | void ogl_object (int code, vector3 *triplets, int count);
50 | void ogl_finish_object (void);
51 |
52 | void ogl_pickable (at3d *atom);
53 |
54 | #endif
55 |
--------------------------------------------------------------------------------
/code/clib/double_hash.h:
--------------------------------------------------------------------------------
1 | /* double_hash.h
2 |
3 | Hash table for objects using string keys, using the double-hashing
4 | scheme. No removal of single entries can be done in this implementation.
5 |
6 | The key and object pointers are assumed to point to memory shared with
7 | other parts of the calling program. No duplication or cleanup of the
8 | memory for these entities is performed by the procedures in this package,
9 | except by the explicit procedure 'dhash_delete_contents'.
10 |
11 | clib v1.0
12 |
13 | Copyright (C) 1997 Per Kraulis
14 | 27-Aug-1997 first attempts
15 | */
16 |
17 | #ifndef DOUBLE_HASH_H
18 | #define DOUBLE_HASH_H 1
19 |
20 | #include
21 |
22 | typedef struct {
23 | char **keys;
24 | void **objects;
25 | int count;
26 | int size;
27 | double auto_resize;
28 | } dhash_table;
29 |
30 | dhash_table *dhash_create (const int max_entries);
31 | dhash_table *dhash_create_size (const int size);
32 | void dhash_resize (dhash_table *table, const int new);
33 | void dhash_delete (dhash_table *table);
34 | void dhash_delete_contents (dhash_table *table);
35 |
36 | int dhash_insert (dhash_table *table, char *key, void *object);
37 | void dhash_insert_replace (dhash_table *table, char *key, void *object);
38 |
39 | int dhash_slot (const dhash_table *table, const char *key);
40 | void *dhash_object (const dhash_table *table, const char *key);
41 |
42 | #endif
43 |
--------------------------------------------------------------------------------
/code/clib/colour.h:
--------------------------------------------------------------------------------
1 | #ifndef COLOUR_H
2 | #define COLOUR_H 1
3 |
4 | #include
5 |
6 | enum colour_spec_codes { COLOUR_RGB = 0, COLOUR_HSB, COLOUR_GREY };
7 |
8 | typedef struct {
9 | int spec;
10 | double x, y ,z;
11 | } colour;
12 |
13 | int
14 | colour_names_count (void);
15 |
16 | void
17 | colour_name (char *name, colour *c, int number);
18 |
19 | boolean
20 | colour_set_name (colour *c, const char *name);
21 |
22 | void
23 | colour_set_rgb (colour *c, double r, double g, double b);
24 |
25 | void
26 | colour_set_hsb (colour *c, double h, double s, double b);
27 |
28 | void
29 | colour_set_grey (colour *c, double g);
30 |
31 | void
32 | colour_to_rgb (colour *c);
33 |
34 | void
35 | colour_to_hsb (colour *c);
36 |
37 | void
38 | colour_to_grey (colour *c);
39 |
40 | void
41 | colour_copy_to_rgb (colour *dest, colour *src);
42 |
43 | void
44 | colour_copy_to_hsb (colour *dest, colour *src);
45 |
46 | void
47 | colour_copy_to_grey (colour *dest, colour *src);
48 |
49 | colour *
50 | colour_clone (colour *c);
51 |
52 | boolean
53 | colour_approx_equal (const colour *c1, const colour *c2, double maxdiff);
54 |
55 | boolean
56 | colour_unequal (const colour *c1, const colour *c2);
57 |
58 | void
59 | colour_blend (colour *c, double fraction, colour *other);
60 |
61 | void
62 | colour_darker (colour *dest, double fraction, colour *src);
63 |
64 | boolean
65 | colour_valid_state (const colour *c);
66 |
67 | #endif
68 |
--------------------------------------------------------------------------------
/examples/ras_top_text.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | MolScript v2.1: Ras p21 in complex with Mg and GDP
4 |
5 |
6 |
7 |
8 |
9 |
Ras p21 in complex with Mg and GDP
10 |
11 |
12 | Three different VRML representations are available for the Ras p21
13 | structure. They all use the schematic representation of secondary
14 | structure, where alpha-helices are shown as helical ribbons, and
15 | beta-strands as arrows.
16 |
17 |
18 |
Simple colouring scheme: alpha-helices are green, beta-strands are
19 | red.
20 |
21 |
minimal model (600
22 | polygons) with viewpoints.
23 |
nice model (3,300
24 | polygons) with viewpoints.
25 |
40 |
41 | Gallery page
42 |
43 |
44 |
45 |
--------------------------------------------------------------------------------
/code/segment.h:
--------------------------------------------------------------------------------
1 | /* segment.h
2 |
3 | MolScript v2.1.2
4 |
5 | Segment data structure and routines.
6 |
7 | Copyright (C) 1997-1998 Per Kraulis
8 | 18-Aug-1997 split out of vrml.c; generalized
9 | */
10 |
11 | #ifndef SEGMENT_H
12 | #define SEGMENT_H 1
13 |
14 | #include "clib/vector3.h"
15 | #include "clib/colour.h"
16 |
17 | typedef struct {
18 | vector3 p;
19 | colour c;
20 | boolean new;
21 | } line_segment;
22 |
23 | extern line_segment *line_segments;
24 | extern int line_segment_count;
25 |
26 | void line_segment_init (void);
27 | line_segment *line_segment_next (void);
28 |
29 | typedef struct {
30 | vector3 p1, p2, p3, p4;
31 | vector3 n1, n2, n3, n4;
32 | colour c;
33 | } strand_segment;
34 |
35 | extern strand_segment *strand_segments;
36 | extern int strand_segment_count;
37 |
38 | void strand_segment_init (void);
39 | strand_segment *strand_segment_next (void);
40 |
41 | typedef struct {
42 | vector3 p1, p2;
43 | vector3 a, n;
44 | colour c;
45 | } helix_segment;
46 |
47 | extern helix_segment *helix_segments;
48 | extern int helix_segment_count;
49 |
50 | void helix_segment_init (void);
51 | helix_segment *helix_segment_next (void);
52 |
53 | typedef struct {
54 | vector3 p, p1, p2, p3, p4;
55 | vector3 n1, n2, n3, n4;
56 | colour c;
57 | } coil_segment;
58 |
59 | extern coil_segment *coil_segments;
60 | extern int coil_segment_count;
61 |
62 | void coil_segment_init (void);
63 | coil_segment *coil_segment_next (void);
64 |
65 | #endif
66 |
--------------------------------------------------------------------------------
/code/clib/aa_lookup.h:
--------------------------------------------------------------------------------
1 | #ifndef AA_LOOKUP_H
2 | #define AA_LOOKUP_H 1
3 |
4 | #include
5 |
6 | int
7 | aa_ordinal (char *c3);
8 |
9 | char
10 | aa_3to1 (char *c3);
11 |
12 | char *
13 | aa_1to3 (char c1);
14 |
15 | char
16 | aa_all3to1 (char *c3);
17 |
18 | int
19 | aa_int (char c1);
20 |
21 | char
22 | aa_code (int aa_int);
23 |
24 | boolean
25 | is_amino_acid_type (char *c3);
26 |
27 | boolean
28 | is_water_type (char *c3);
29 |
30 | boolean
31 | is_nucleic_acid_type (char *c3);
32 |
33 | double
34 | aa_abundance (int aa_int);
35 |
36 | double
37 | aa_fauchere_pliska (int aa_int);
38 |
39 | double
40 | aa_fauchere_pliska_normalized (int aa_int);
41 |
42 | double
43 | aa_kyte_doolittle (int aa_int);
44 |
45 | double
46 | aa_kyte_doolittle_normalized (int aa_int);
47 |
48 | boolean
49 | aa_conformation_special (int aa_int);
50 |
51 | boolean
52 | aa_ring (int aa_int);
53 |
54 | boolean
55 | aa_hbond_forming (int aa_int);
56 |
57 | boolean
58 | aa_hbond_donor (int aa_int);
59 |
60 | boolean
61 | aa_hbond_acceptor (int aa_int);
62 |
63 | boolean
64 | aa_polar (int aa_int);
65 |
66 | boolean
67 | aa_aromatic (int aa_int);
68 |
69 | boolean
70 | aa_positive_charge (int aa_int);
71 |
72 | boolean
73 | aa_negative_charge (int aa_int);
74 |
75 | boolean
76 | aa_charged (int aa_int);
77 |
78 | boolean
79 | aa_zn_binding (int aa_int);
80 |
81 | int
82 | aa_random (double rnd);
83 |
84 | int
85 | aa_random_abundance (double rnd);
86 |
87 | int
88 | aa_random_distribution (double rnd, double distribution[20]);
89 |
90 | #endif
91 |
--------------------------------------------------------------------------------
/code/vrml.h:
--------------------------------------------------------------------------------
1 | /* vrml.h
2 |
3 | MolScript v2.1.2
4 |
5 | VRML V2.0.
6 |
7 | Copyright (C) 1997-1998 Per Kraulis
8 | 4-Dec-1996 first attempts
9 | 31-Mar-1997 fairly finished
10 | 18-Aug-1997 split out and generalized segment handling
11 | 15-Oct-1997 USE/DEF for helix and strand different surfaces
12 | */
13 |
14 | #ifndef MOLSCRIPT_VRML_H
15 | #define MOLSCRIPT_VRML_H 1
16 |
17 | #include "col.h"
18 | #include "coord.h"
19 |
20 | void vrml_set (void);
21 |
22 | void vrml_first_plot (void);
23 | void vrml_finish_output (void);
24 | void vrml_start_plot (void);
25 | void vrml_finish_plot (void);
26 |
27 | void vrml_set_area (void);
28 | void vrml_set_background (void);
29 | void vrml_anchor_start (char *str);
30 | void vrml_anchor_description (char *str);
31 | void vrml_anchor_parameter (char *str);
32 | void vrml_anchor_start_geometry (void);
33 | void vrml_anchor_finish (void);
34 | void vrml_lod_start (void);
35 | void vrml_lod_finish (void);
36 | void vrml_lod_start_group (void);
37 | void vrml_lod_finish_group (void);
38 | void vrml_viewpoint_start (char *str);
39 | void vrml_viewpoint_output (void);
40 | void vrml_ms_directionallight (void);
41 | void vrml_ms_pointlight (void);
42 | void vrml_ms_spotlight (void);
43 |
44 | void vrml_coil (void);
45 | void vrml_cylinder (vector3 *v1, vector3 *v2);
46 | void vrml_helix (void);
47 | void vrml_label (vector3 *p, char *label, colour *c);
48 | void vrml_line (boolean polylines);
49 | void vrml_points (int colours);
50 | void vrml_sphere (at3d *at, double radius);
51 | void vrml_stick (vector3 *v1, vector3 *v2, double r1, double r2, colour *c);
52 | void vrml_strand (void);
53 |
54 | void vrml_object (int code, vector3 *triplets, int count);
55 |
56 | #endif
57 |
--------------------------------------------------------------------------------
/examples/ras_molauto.in:
--------------------------------------------------------------------------------
1 | ! MolScript v2.1 input file
2 | ! generated by MolAuto v1.1
3 |
4 | title "C-H-RAS P21 PROTEIN (CATALYTIC DOMAIN, RESIDUES 1 - 166) COMPLEXED WITH GDP AND MG (NMR, RESTRAINED MINIMIZED AVERAGE)"
5 |
6 | plot
7 |
8 | read mol "ras.pdb";
9 |
10 | transform atom * by centre position atom *;
11 |
12 | set segments 2;
13 |
14 | set planecolour hsb 0.6667 1 1;
15 | coil from 1 to 2;
16 | set planecolour hsb 0.6316 1 1;
17 | strand from 2 to 9;
18 | set planecolour hsb 0.5965 1 1;
19 | coil from 9 to 15;
20 | set planecolour hsb 0.5614 1 1;
21 | helix from 15 to 25;
22 | set planecolour hsb 0.5263 1 1;
23 | coil from 25 to 38;
24 | set planecolour hsb 0.4912 1 1;
25 | strand from 38 to 46;
26 | set planecolour hsb 0.4561 1 1;
27 | coil from 46 to 49;
28 | set planecolour hsb 0.4211 1 1;
29 | strand from 49 to 57;
30 | set planecolour hsb 0.386 1 1;
31 | coil from 57 to 66;
32 | set planecolour hsb 0.3509 1 1;
33 | helix from 66 to 75;
34 | set planecolour hsb 0.3158 1 1;
35 | coil from 75 to 77;
36 | set planecolour hsb 0.2807 1 1;
37 | strand from 77 to 84;
38 | set planecolour hsb 0.2456 1 1;
39 | coil from 84 to 87;
40 | set planecolour hsb 0.2105 1 1;
41 | helix from 87 to 104;
42 | set planecolour hsb 0.1754 1 1;
43 | coil from 104 to 110;
44 | set planecolour hsb 0.1404 1 1;
45 | strand from 110 to 117;
46 | set planecolour hsb 0.1053 1 1;
47 | coil from 117 to 127;
48 | set planecolour hsb 0.07018 1 1;
49 | helix from 127 to 138;
50 | set planecolour hsb 0.03509 1 1;
51 | coil from 138 to 152;
52 | set planecolour hsb 0 1 1;
53 | helix from 152 to 166;
54 |
55 | set colourparts on;
56 | bonds in residue 200;
57 | cpk in residue 201;
58 |
59 | end_plot
60 |
--------------------------------------------------------------------------------
/examples/ras_rmsd.in:
--------------------------------------------------------------------------------
1 | ! MolScript v2.1 input file
2 | ! generated by MolAuto v1.1
3 | ! modified by hand
4 |
5 | ! Standard view, colours according to RMSD of CA atoms.
6 |
7 | title "c-H-ras p21 protein (1-166), complex with GDP and Mg"
8 |
9 | plot
10 |
11 | window 40;
12 |
13 | read mol "ras.pdb";
14 |
15 | transform atom *
16 | by centre position atom *
17 | by rotation
18 | 0.450861 0.724522 -0.521337
19 | 0.328525 0.408374 0.851647
20 | 0.829937 -0.555246 -0.0539039
21 | by translation -2 1 0
22 | ;
23 |
24 | set segments 6;
25 |
26 | set colourparts on,
27 | residuecolour amino-acids b-factor 0.3 1.5 from blue to red;
28 |
29 | coil from 1 to 2;
30 | strand from 2 to 9;
31 | coil from 9 to 15;
32 | helix from 15 to 25;
33 | coil from 25 to 38;
34 | strand from 38 to 46;
35 | coil from 46 to 49;
36 | strand from 49 to 57;
37 | coil from 57 to 66;
38 | helix from 66 to 75;
39 | coil from 75 to 77;
40 | strand from 77 to 84;
41 | coil from 84 to 87;
42 | helix from 87 to 104;
43 | coil from 104 to 110;
44 | strand from 110 to 117;
45 | coil from 117 to 127;
46 | helix from 127 to 138;
47 | coil from 138 to 152;
48 | helix from 152 to 166;
49 |
50 | set atomcolour in residue 200 green;
51 | cpk in residue 200;
52 | cpk in residue 201;
53 |
54 | viewpoint "GDP molecule" from position require in type GDP and atom N*
55 | to position require in type GDP and atom P* 10;
56 |
57 | viewpoint "Mg ion" from position in require type HOH
58 | and either residue 3 or residue 2
59 | to position in type MG 10;
60 |
61 | viewpoint "far away" origin position in type GDP 100;
62 |
63 | end_plot
64 |
--------------------------------------------------------------------------------
/code/clib/dynstring.h:
--------------------------------------------------------------------------------
1 | #ifndef DYNSTRING_H
2 | #define DYNSTRING_H 1
3 |
4 | #include
5 |
6 | typedef struct {
7 | char *string;
8 | int capacity;
9 | int length;
10 | } dynstring;
11 |
12 | boolean
13 | ds_valid_state (const dynstring *ds);
14 |
15 | dynstring *
16 | ds_create (const char *str);
17 |
18 | dynstring *
19 | ds_subcreate (const char *str, int first, int last);
20 |
21 | dynstring *
22 | ds_clone (dynstring *ds);
23 |
24 | dynstring *
25 | ds_subclone (dynstring *ds, int first, int last);
26 |
27 | dynstring *
28 | ds_allocate (const int capacity);
29 |
30 | void
31 | ds_reallocate (dynstring *ds, const int capacity);
32 |
33 | void
34 | ds_delete (dynstring *ds);
35 |
36 | void
37 | ds_set (dynstring *ds, const char *str);
38 |
39 | void
40 | ds_subset (dynstring *ds, const char *str, int first, int last);
41 |
42 | void
43 | ds_cat (dynstring *ds, const char *str);
44 |
45 | void
46 | ds_subcat (dynstring *ds, const char *str, int first, int last);
47 |
48 | void
49 | ds_add (dynstring *ds, const char c);
50 |
51 | void
52 | ds_cat_int (dynstring *ds, const int i);
53 |
54 | void
55 | ds_append (dynstring *ds1, const dynstring *ds2);
56 |
57 | void
58 | ds_replace (dynstring *ds, const int pos, const int len, const char *str);
59 |
60 | void
61 | ds_fill_blanks (dynstring *ds, const int length);
62 |
63 | void
64 | ds_remove_blanks (dynstring *ds);
65 |
66 | void
67 | ds_pad_blanks (dynstring *ds, int length);
68 |
69 | void
70 | ds_truncate (dynstring *ds, int length);
71 |
72 | void
73 | ds_left_adjust (dynstring *ds);
74 |
75 | void
76 | ds_right_adjust (dynstring *ds);
77 |
78 | void
79 | ds_reset (dynstring *ds);
80 |
81 | void
82 | ds_to_upper (dynstring *ds);
83 |
84 | void
85 | ds_to_lower (dynstring *ds);
86 |
87 | #endif
88 |
--------------------------------------------------------------------------------
/code/clib/sgi_image.h:
--------------------------------------------------------------------------------
1 | /* sgi_image.h
2 |
3 | SGI (aka RGB) format image file i/o.
4 |
5 | clib v1.1
6 |
7 | This is based on the specification of the SGI image file format:
8 | http://reality.sgi.com/grafica/sgiimage.html
9 |
10 | Copyright (C) 1997-1998 Per Kraulis
11 | 26-Sep-1997 started
12 | 28-Sep-1997 write char routine implemented
13 |
14 | to do:
15 | - short routines not implemented
16 | - read routines not implemented
17 | - RLE needs optimizing: check if row actually gets compressed
18 | */
19 |
20 | #ifndef SGI_IMAGE_H
21 | #define SGI_IMAGE_H
22 |
23 | #include
24 |
25 | typedef struct {
26 | unsigned short xsize, ysize, zsize;
27 | char storage, bpc;
28 | unsigned short dimension;
29 | long pinmin, pinmax;
30 | char name[80];
31 |
32 | FILE *file;
33 | int current_rownum, current_channel;
34 | int tablen;
35 | long *start_table, *length_table;
36 | } sgi_image;
37 |
38 | sgi_image *sgiimg_create (void);
39 | void sgiimg_delete (sgi_image *img);
40 |
41 | void sgiimg_set_size (sgi_image *img, int width, int height);
42 | void sgiimg_set_verbatim (sgi_image *img);
43 | void sgiimg_set_rle (sgi_image *img);
44 | void sgiimg_set_char (sgi_image *img);
45 | void sgiimg_set_short (sgi_image *img);
46 | void sgiimg_set_bw (sgi_image *img);
47 | void sgiimg_set_rgb (sgi_image *img);
48 | void sgiimg_set_rgba (sgi_image *img);
49 | void sgiimg_set_minmax (sgi_image *img, long min, long max);
50 | void sgiimg_set_name (sgi_image *img, char *str);
51 |
52 | int sgiimg_file_create (sgi_image *img, char *filename);
53 | int sgiimg_file_init (sgi_image *img);
54 | int sgiimg_file_open (sgi_image *img, char *filename);
55 | void sgiimg_file_close (sgi_image *img);
56 |
57 | int sgiimg_write_next_char_row (sgi_image *img, unsigned char *row);
58 |
59 | #endif
60 |
--------------------------------------------------------------------------------
/docs/interface.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | MolScript v2.1: Interface to external objects
4 |
5 |
6 |
7 |
8 |
9 |
Interface to external objects
10 |
11 | A new feature of MolScript v2 is the interface to external graphical
12 | objects. This interface allows graphical objects created by other
13 | programs to be included in images. For example, the graphical objects
14 | may be a molecular surface generated by some external program, or it
15 | may be a chicken-wire representation of an electron density map.
16 |
17 | The interface is based on a simple file format definition, which
18 | may contain the graphical primitives points, lines and triangular
19 | surfaces, in any combination.
20 |
21 |
28 | Several parameters in the MolScript
29 | graphics state affect the appearance of the
30 | external objects in the image. Some of the object primitives in the
31 | file may contain specifications of colour and surface normals.
32 |
33 | The external graphical object file is included in the image by the
34 | object command, which reads the
35 | file and outputs the specified objects to the image according the the
36 | state parameters at that point in the input file. An important
37 | parameter is the
38 | objecttransform parameter,
39 | which determines whether or not the coordinates in the object file are
40 | to be transformed by the most recently used transformation matrix.
41 |
42 |
43 | Top page
44 |
45 |
46 |
--------------------------------------------------------------------------------
/examples/ras_cyl.in:
--------------------------------------------------------------------------------
1 | ! MolScript v2.1 input file
2 | ! generated by MolAuto v1.1
3 | ! modified by hand
4 |
5 | ! Standard view, cylinders for helices, secondary structure colours.
6 |
7 | title "c-H-ras p21 protein (1-166), complex with GDP and Mg"
8 |
9 | plot
10 |
11 | window 40;
12 |
13 | read mol "ras.pdb";
14 |
15 | transform atom *
16 | by centre position atom *
17 | by rotation
18 | 0.450861 0.724522 -0.521337
19 | 0.328525 0.408374 0.851647
20 | 0.829937 -0.555246 -0.0539039
21 | by translation -2 1 0
22 | ;
23 |
24 | set planecolour purple;
25 | coil from 1 to 2;
26 | coil from 46 to 49;
27 | coil from 75 to 77;
28 | coil from 84 to 87;
29 | coil from 104 to 110;
30 | coil from 117 to 127;
31 | coil from 138 to 152;
32 |
33 | set planecolour orange;
34 | coil from 9 to 15;
35 | coil from 25 to 38;
36 | coil from 57 to 66;
37 |
38 | set planecolour green;
39 | strand from 2 to 9;
40 | strand from 38 to 46;
41 | strand from 49 to 57;
42 | strand from 77 to 84;
43 | strand from 110 to 117;
44 |
45 | set planecolour crimson;
46 | cylinder from 15 to 25;
47 | cylinder from 66 to 75;
48 | cylinder from 87 to 104;
49 | cylinder from 127 to 138;
50 | cylinder from 152 to 166;
51 |
52 | set colourparts on;
53 | ball-and-stick in residue 200;
54 | cpk in residue 201;
55 |
56 | viewpoint "GDP molecule" from position require in type GDP and atom N*
57 | to position require in type GDP and atom P* 10;
58 |
59 | viewpoint "Mg ion" from position in require type HOH
60 | and either residue 3 or residue 2
61 | to position in type MG 10;
62 |
63 | viewpoint "far away" origin position in type GDP 100;
64 |
65 | end_plot
66 |
--------------------------------------------------------------------------------
/examples/ras_min_vrml.in:
--------------------------------------------------------------------------------
1 | ! MolScript v2.1 input file
2 | ! generated by MolAuto v1.0
3 | ! modified by hand
4 |
5 | ! VRML frames example, minimal quality.
6 |
7 | title "c-H-Ras p21 protein (1-166), comples with GDP, Mg"
8 |
9 | plot
10 |
11 | read mol "ras.pdb";
12 |
13 | set segments 2, strandthickness 0, coilradius 0;
14 |
15 | set planecolour green;
16 | helix from 15 to 24;
17 | helix from 66 to 74;
18 | helix from 88 to 103;
19 | helix from 126 to 134;
20 | helix from 152 to 165;
21 |
22 | set planecolour red;
23 | strand from 2 to 10;
24 | strand from 38 to 45;
25 | strand from 50 to 57;
26 | strand from 77 to 81;
27 | strand from 111 to 115;
28 | strand from 140 to 143;
29 |
30 | set planecolour purple;
31 | anchor "ras_loops_text.html"
32 | description "effector loops" parameter "target=text"
33 | {
34 | coil from 24 to 38;
35 | coil from 57 to 66;
36 | };
37 |
38 | set planecolour yellow;
39 | coil from 1 to 2;
40 | turn from 10 to 15;
41 | coil from 45 to 50;
42 | coil from 74 to 77;
43 | coil from 81 to 88;
44 | coil from 103 to 111;
45 | coil from 115 to 126;
46 | coil from 134 to 140;
47 | coil from 143 to 152;
48 | coil from 165 to 166;
49 |
50 | set colourparts on;
51 | bonds require not hydrogens and in type HOH;
52 |
53 | anchor "ras_gdp_text.html"
54 | description "GDP molecule" parameter "target=text"
55 | {
56 | bonds in type GDP;
57 | };
58 |
59 | anchor "ras_mg_text.html"
60 | description "Mg ion" parameter "target=text"
61 | {
62 | bonds in type MG;
63 | };
64 |
65 | viewpoint "GDP molecule" from position require in type GDP and atom N*
66 | to position require in type GDP and atom P* 10;
67 |
68 | viewpoint "Mg ion" from position in require type HOH
69 | and either residue 3 or residue 2
70 | to position in type MG 10;
71 |
72 | viewpoint "far away" origin position in type GDP 100;
73 |
74 | end_plot
75 |
--------------------------------------------------------------------------------
/code/clib/ogl_utils.c:
--------------------------------------------------------------------------------
1 | /*
2 | Some OpenGL utility procedures.
3 |
4 | This package relies on GLUT version 3.5 (and presumably higher).
5 |
6 | clib v1.1
7 |
8 | Copyright (C) 1997-1998 Per Kraulis
9 | 6-Aug-1997 first attempts
10 | 12-Jun-1998 reorganized, mod's for hgen
11 | */
12 |
13 | #include "ogl_utils.h"
14 |
15 | /* public ====================
16 | #include
17 | ==================== public */
18 |
19 | #include
20 | #include
21 | #include
22 |
23 | #include
24 |
25 | #include
26 |
27 |
28 | /*------------------------------------------------------------*/
29 | boolean
30 | ogl_check_errors (char *msg)
31 | /*
32 | Check if any OpenGL errors have occurred, output error message
33 | and return TRUE if so, otherwise FALSE.
34 | */
35 | {
36 | GLenum error = glGetError();
37 |
38 | if (error == GL_NO_ERROR) return FALSE;
39 |
40 | if (msg) fprintf (stderr, "%s", msg);
41 | while (error != GL_NO_ERROR) {
42 | fprintf (stderr, "OpenGL error: %s\n", gluErrorString (error));
43 | error = glGetError();
44 | }
45 | return TRUE;
46 | }
47 |
48 |
49 | /*------------------------------------------------------------*/
50 | boolean
51 | ogl_display_mode_not_available (void)
52 | /*
53 | Check if the requested GLUT window display mode is
54 | not available.
55 | */
56 | {
57 | if (! glutGet (GLUT_DISPLAY_MODE_POSSIBLE)) {
58 | err_message ("required OpenGL display mode not available on this system");
59 | return TRUE;
60 | } else {
61 | return FALSE;
62 | }
63 | }
64 |
65 |
66 | /*------------------------------------------------------------*/
67 | void
68 | ogl_display_mode_not_available_fatal (void)
69 | /*
70 | Check if the requested GLUT window display mode is
71 | not available and exit with failure if so.
72 | */
73 | {
74 | if (ogl_display_mode_not_available()) {
75 | fprintf (stderr, "exiting...");
76 | exit (EXIT_FAILURE);
77 | }
78 | }
79 |
--------------------------------------------------------------------------------
/code/global.h:
--------------------------------------------------------------------------------
1 | /* global.h
2 |
3 | MolScript v2.1.2
4 |
5 | Global stuff.
6 |
7 | Copyright (C) 1997-1998 Per Kraulis
8 | 1-Dec-1996 first attempts
9 | 12-Sep-1997 rearranged modes
10 | */
11 |
12 | #ifndef GLOBAL_H
13 | #define GLOBAL_H 1
14 |
15 | #include
16 |
17 | #include "clib/boolean.h"
18 | #include "clib/vector3.h"
19 | #include "clib/colour.h"
20 |
21 | #define UNDEFINED_MODE 0
22 | #define POSTSCRIPT_MODE 1
23 | #define RASTER3D_MODE 2
24 | #define VRML_MODE 3
25 | #define OPENGL_MODE 4
26 | #define EPS_MODE 5
27 | #define JPEG_MODE 6
28 | #define SGI_MODE 7
29 | #define PNG_MODE 8
30 | #define GIF_MODE 9
31 |
32 | #define PRINT(str) fprintf(outfile,"%s",(str))
33 |
34 | extern const char program_str[];
35 | extern const char copyright_str[];
36 | extern char user_str[];
37 |
38 | extern int output_mode;
39 |
40 | extern char *input_filename;
41 | extern char *output_filename;
42 | extern char *tmp_filename;
43 | extern FILE *outfile;
44 | extern boolean message_mode;
45 | extern boolean exit_on_error;
46 | extern boolean pretty_format;
47 | extern int output_width;
48 | extern int output_height;
49 |
50 | #define MAX_DSTACK 10
51 | extern double dstack [MAX_DSTACK];
52 | extern int dstack_size;
53 | extern int ival;
54 |
55 | extern vector3 xaxis;
56 | extern vector3 yaxis;
57 | extern vector3 zaxis;
58 |
59 | extern char *title;
60 | extern int first_plot;
61 |
62 | int yyerror (char *s);
63 | int yyparse (void);
64 | void yywarning (char *s);
65 |
66 | void global_init(void);
67 |
68 | void push_double (double f);
69 | void clear_dstack (void);
70 | void pop_dstack (int slots);
71 |
72 | void do_nothing (void);
73 | void do_nothing_str (char *str);
74 |
75 | void banner (void);
76 | void not_implemented (const char *str);
77 |
78 | void process_arguments (int *argcp, char *argv[]);
79 | void set_outfile (const char *mode);
80 |
81 | void set_title (const char *str);
82 | void start_plot (void);
83 |
84 | void debug (const char *str);
85 |
86 | #endif
87 |
--------------------------------------------------------------------------------
/examples/ras_vrml.in:
--------------------------------------------------------------------------------
1 | ! MolScript v2.1 input file
2 | ! generated by MolAuto v1.0
3 | ! modified by hand
4 |
5 | ! VRML frames example, nice quality.
6 |
7 | title "c-H-Ras p21 protein (1-166), comples with GDP, Mg"
8 |
9 | plot
10 |
11 | read mol "ras.pdb";
12 |
13 | set segments 4, planecolour green;
14 | helix from 15 to 24;
15 | helix from 66 to 74;
16 | helix from 88 to 103;
17 | helix from 126 to 134;
18 | helix from 152 to 165;
19 |
20 | set segments 2, planecolour red;
21 | strand from 2 to 10;
22 | strand from 38 to 45;
23 | strand from 50 to 57;
24 | strand from 77 to 81;
25 | strand from 111 to 115;
26 | strand from 140 to 143;
27 |
28 | set planecolour purple;
29 | anchor "ras_loops_text.html"
30 | description "effector loops" parameter "target=text"
31 | {
32 | coil from 24 to 38;
33 | coil from 57 to 66;
34 | };
35 |
36 | set planecolour yellow;
37 | coil from 1 to 2;
38 | turn from 10 to 15;
39 | coil from 45 to 50;
40 | coil from 74 to 77;
41 | coil from 81 to 88;
42 | coil from 103 to 111;
43 | coil from 115 to 126;
44 | coil from 134 to 140;
45 | coil from 143 to 152;
46 | coil from 165 to 166;
47 |
48 | set colourparts on, specularcolour white, shininess 0.2;
49 |
50 | anchor "ras_gdp_text.html"
51 | description "GDP molecule" parameter "target=text"
52 | {
53 | ball-and-stick in type GDP;
54 | };
55 |
56 | ball-and-stick require not hydrogens and in type HOH;
57 |
58 | set segments 6, shininess 0.6;
59 | anchor "ras_mg_text.html"
60 | description "Mg ion" parameter "target=text"
61 | {
62 | cpk in type MG;
63 | };
64 |
65 | viewpoint "GDP molecule" from position require in type GDP and atom N*
66 | to position require in type GDP and atom P* 10;
67 |
68 | viewpoint "Mg ion" from position in require type HOH
69 | and either residue 3 or residue 2
70 | to position in type MG 10;
71 |
72 | viewpoint "far away" origin position in type GDP 100;
73 |
74 | end_plot
75 |
--------------------------------------------------------------------------------
/code/select.h:
--------------------------------------------------------------------------------
1 | /* select.h
2 |
3 | MolScript v2.1.2
4 |
5 | Atom and residue selection definitions.
6 |
7 | Copyright (C) 1997-1998 Per Kraulis
8 | 7-Dec-1996 first attempts
9 | 2-Jan-1997 largely finished
10 | */
11 |
12 | #include "coord.h"
13 |
14 | typedef struct selection selection;
15 |
16 | struct selection {
17 | int *flags;
18 | selection *next, *prev;
19 | };
20 |
21 | void push_atom_selection (void);
22 | void push_residue_selection (void);
23 | void pop_atom_selection (void);
24 | void pop_residue_selection (void);
25 |
26 | int count_atom_selections (void);
27 | int count_residue_selections (void);
28 |
29 | int select_atom_count (void);
30 | int select_residue_count (void);
31 |
32 | at3d **select_atom_list (int *atom_count);
33 |
34 | void select_atom_not (void);
35 | void select_atom_and (void);
36 | void select_atom_or (void);
37 |
38 | void select_residue_not (void);
39 | void select_residue_and (void);
40 | void select_residue_or (void);
41 |
42 | void select_atom_id (const char *item);
43 | void select_atom_res_id (const char *item);
44 | void select_atom_occupancy (void);
45 | void select_atom_b_factor (void);
46 | void select_atom_in (void);
47 | void select_atom_sphere (void);
48 | void select_atom_close (void);
49 | void select_atom_backbone (void);
50 | void select_atom_peptide (void);
51 | void select_atom_hydrogens (void);
52 | void select_atom_element (const char *item);
53 |
54 | void select_residue_molecule (const char *item);
55 | void select_residue_model (void);
56 | void select_residue_from_to (const char *item1, const char *item2);
57 | void select_residue_id (const char *item);
58 | void select_residue_type (const char *item);
59 | void select_residue_chain (const char *item);
60 | void select_residue_contains (void);
61 | void select_residue_amino_acids (void);
62 | void select_residue_waters (void);
63 | void select_residue_nucleotides (void);
64 | void select_residue_ligands (void);
65 | void select_residue_segid (const char *item);
66 |
67 | extern selection *current_atom_sel;
68 | extern selection *current_residue_sel;
69 |
--------------------------------------------------------------------------------
/docs/distribution.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | MolScript v2.1: Distribution
4 |
5 |
6 |
7 |
8 |
9 |
Distribution
10 |
11 | The MolScript program is distributed as source code (ANSI C) together
12 | with Makefiles, documentation and example input files. You will have
13 | to compile the program yourself.
14 |
15 | The MolScript software can be obtained from its
16 | GitHub repository.
17 |
18 | Although GNU'sbison
19 | (GNU's equivalent of yacc) was used to develop the
20 | program, it is not required to compile the program, since the C source
21 | code files produced by bison from the
22 | molscript.y file are included in the distribution.
23 |
24 | MolScript will compile with just the code that is included in the
25 | distribution. This gives the basic implementation which can output
26 | PostScript,
27 | Raster3D and
28 | VRML 2.0 files.
29 |
30 | If your computer systems supports
31 | OpenGL rendering, then an
32 | implementation allowing an interactive graphics window can be
33 | compiled. This also requires the
34 | GLUT library by Mark Kilgard. The
35 | OpenGL implementation allows several different image file output
36 | formats to be produced. Encapsulated PostScript Files (EPS) and SGI
37 | (aka RGB) image files are supported without any additional
38 | software. The JPEG,
39 | PNG and
40 | GIF image file formats require the
41 | corresponding libraries. None of these additional libraries are
42 | included in the MolScript distribution. You must
43 | fetch them and install them yourself.
44 |
10 |
11 | Adobe Systems Inc., "PostScript
12 | Language Reference Manual, Second Edition", 1990,
13 | Addison-Wesley, ISBN 0-201-18127-4.
14 |
15 |
16 | D. J. Bacon
17 | & W. F. Anderson, J. Mol. Graph. (1988) v 6, pp 219-220.
18 |
19 |
20 | A. T. Brünger, "X-PLOR, version
21 | 3.1", 1992, Yale University Press, ISBN 0-300-05402-5.
22 |
23 |
24 | R. Carey & G. Bell, "The Annotated
25 | VRML 2.0 Reference Manual", 1997, Addison-Wesley, ISBN
26 | 0-201-41974-2.
27 |
28 |
29 | J. D. Foley, A. Van Dam, S. K. Feiner
30 | & J. F. Hughes, "Fundamentals of Interactive Computer Graphics",
31 | 1990, Second Edition, Addison-Wesley, ISBN 0-201-12110-7.
32 |
33 |
34 | J. Hartman & J. Wernecke, "The
35 | VRML 2.0 Handbook", 1996, Addison-Wesley, ISBN 0-201-47944-3.
36 |
37 |
38 | W. Kabsch & C. Sander,
39 | Biopolymers (1983) v 22, pp 2577-2637.
40 |
41 |
42 | B.W. Kernighan & D.M. Ritchie,
43 | "The C Programming Language", 1988, Second Edition, Prentice
44 | Hall, ISBN 0-13-110362-8.
45 |
46 |
47 | M. J. Kilgard, "OpenGL Programming
48 | for the X Window System", 1996, Addison-Wesley, ISBN
49 | 0-201-48359-9.
50 |
51 |
52 | P. J. Kraulis,
53 | P. J. Domaille, S. L. Campbell-Burk, T. Van Aken & E. D. Laue,
54 | Biochemistry (1994) v 33, pp 3515-3531.
55 |
56 |
57 | A. M. Lesk
58 | & K. D. Hardman, Science (1982) v 216, pp 539-540.
59 |
60 |
61 | A. M. Lesk
62 | & K. D. Hardman, Methods in Enzymology (1985) v 115, pp
63 | 381-390.
64 |
65 |
66 | J. R. Levine, T. Mason & D. Brown,
67 | "lex & yacc", 1992, O'Reilly & Associates, Inc.,
68 | ISBN 1-56592-000-7.
69 |
70 |
71 | E. A. Merritt
72 | & M. E. P. Murphy, Acta. Cryst. (1994) v D50, pp 869-873.
73 |
74 |
75 | J. L. Neider, T. R. Davis &
76 | M. Woo, "OpenGL Programming Guide", 1993, OpenGL Architecture
77 | Review Board, Addison-Wesley, ISBN 0-201-63274-8.
78 |
79 |
80 | J. P. Priestle,
81 | J. Appl. Cryst. (1988) v 21, pp 572-576.
82 |
83 |
84 | J. S. Richardson,
85 | Adv. Prot. Chem. (1981), v 34, pp 167-339.
86 |
87 |
88 | J. S. Richardson,
89 | Methods in Enzymology (1985) v 115, pp 359-380.
90 |
32 |
33 |
34 | MolScript is a program for creating schematic or detailed molecular
35 | graphics images from molecular 3D coordinates, usually, but not
36 | exclusively, protein structures. The user supplies an input file (the
37 | script) which specifies the coordinate file, what objects to render
38 | and the exact appearance of the objects through the graphics state
39 | parameters. There is a helper program
40 | MolAuto, which produces a good
41 | first-approximation input file from a coordinate file.
42 |
43 |
44 |
10 |
11 | This is a summary of the MolScript input file syntax. It is a
12 | simplification of the actual yacc grammar (file molscript.y), which
13 | describes the syntax in a condensed form using a Backus-Naur Form
14 | (BNF) notation. Undocumented features are omitted.
15 |