~ubuntu-branches/ubuntu/raring/gdis/raring-proposed

« back to all changes in this revision

Viewing changes to file_pdb.c

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Leidert (dale)
  • Date: 2009-04-06 17:12:18 UTC
  • mfrom: (3.1.3 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090406171218-uizoe126jrq09ytt
Tags: 0.90-1
* New upstream release 0.90.
* Acknowledge NMU (closes: #492994). Thanks to Neil Williams.

* makefile.debian: Upstream doesn't provide a Makefile to edit - so created
  our own.
* debian/compat: Added and set to be 5.
* debian/control: Added Homepage, Vcs* and DM-Upload-Allowed fields.
  (Maintainer): Set to the debichem team with approval by Noèl.
  (Uploaders): Added myself.
  (Build-Depends): Increased debhelper version to 5. Removed glutg3-dev.
  Added dpatch.
  (Standards-Version): Bumped to 3.8.1.
  (Description): Removed homepage. Fixed a typo.
* debian/copyright: Updated, completed and adjusted.
* debian/dirs: Dropped useless file.
* debian/docs: Renamed to debian/gdis.docs.
* debian/menu: Renamed to debian/gdis.menu.
  (section): Fixed accordingly to policy.
* debian/gdis.1: Just some formatting changes.
* debian/gdis.desktop: Added file (with small fixes) provided by Phill Bull
  (LP: #111353).
* debian/gdis.install: Added.
* debian/rules: Cleaned. Installation is now done by dh_install. Make sure,
  the CVS directory is not copied. Added dh_desktop call.
* debian/source.lintian-overrides: makefile.debian is created for Debian but
  lives outside debian/.
* debian/watch: Added.
* debian/README.build: Dropped.
* debian/README.source: Added to be compliant to the policy v3.8.
* debian/patches/Debian_make.dpatch: Added.
  - gdis.h (ELEM_FILE): Moved fix for gdis.elemts path (#399132) to this
    patch.
* debian/patches/00list: Added.

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
extern struct sysenv_pak sysenv;
37
37
extern struct elem_pak elements[];
38
38
 
 
39
 
 
40
/* FIXME - deal with res_name , chain values of NULL */
 
41
void write_pdb_core(FILE *fp, gint i, struct core_pak *core, struct model_pak *model)
 
42
{
 
43
gdouble x[3];
 
44
gchar *res_name, *chain;
 
45
 
 
46
ARR3SET(x, core->x);
 
47
vecmat(model->latmat, x);
 
48
 
 
49
if (!core->res_name)
 
50
  res_name = "UNK";
 
51
else
 
52
  res_name = core->res_name;
 
53
 
 
54
if (!core->chain)
 
55
  chain = "A";
 
56
else
 
57
  chain = core->chain;
 
58
 
 
59
fprintf(fp,"ATOM  %5d %-4s %3s %1s %3d    %8.3f%8.3f%8.3f%6.2f%6.2f      %-4s%2s%-2s\n",
 
60
            i, core->atom_label, res_name, chain, core->res_no,
 
61
            x[0], x[1], x[2], core->sof, 0.0, "", elements[core->atom_code].symbol, "");
 
62
}
 
63
 
 
64
 
39
65
/******************/
40
66
/* PDB writing */
41
67
/******************/
42
68
gint write_pdb(gchar *filename, struct model_pak *model)
43
69
{
44
70
gdouble c;
45
 
gdouble x[3];
46
71
GSList *list, *list2;
47
72
struct bond_pak *bond;
48
73
struct core_pak *core, *core2;
49
 
gint i = 0;
 
74
gint i;
50
75
FILE *fp;
51
76
 
52
77
/* checks */
127
152
79 - 80        LString(2)      charge        Charge on the atom.
128
153
*/
129
154
 
 
155
i=1;
130
156
for (list=model->cores ; list ; list=g_slist_next(list))
131
157
  {
132
 
  core = list->data;
133
 
 
134
 
/* everything is cartesian after latmat mult */
135
 
  ARR3SET(x, core->x);
136
 
  vecmat(model->latmat, x);
137
 
  i++;
138
 
  fprintf(fp,"ATOM  %5d %-4s %-3s %1s %3d    %8.3f%8.3f%8.3f%6.2f%6.2f      %-4s%2s%-2s\n",
139
 
              i, core->atom_label, core->res_name, core->chain, core->res_no, x[0], x[1], x[2], core->sof, 0.0, "", elements[core->atom_code].symbol, "");
 
158
  write_pdb_core(fp, i++, list->data, model);
140
159
  }
141
160
 
142
 
 
143
 
 
144
161
/* CURRENT */
145
162
/* connectivity */
146
163
i=1;
406
423
/* model setup */
407
424
strcpy(data->filename, filename);
408
425
g_free(data->basename);
409
 
data->basename = strdup_basename(filename);
 
426
data->basename = parse_strip(filename);
410
427
 
411
428
data->num_frames = data->cur_frame = frame;
412
429
data->cur_frame--;