summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMagnus Lundborg <lundborg.magnus@gmail.com>2013-03-06 15:42:58 (GMT)
committerMagnus Lundborg <lundborg.magnus@gmail.com>2013-03-06 15:42:58 (GMT)
commit9080ccb8c3ae0155ccad315ad0a4aef88b7d613a (patch)
tree418d34896faf61d4ecc3bfa7ffc3c2154a068208 /src
parent00dc780c0724000def9feed7dbbb1130819b3c71 (diff)
Chain, residue and atom index start at 1. Need more fixes later.
Diffstat (limited to 'src')
-rw-r--r--src/lib/tng_io.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/lib/tng_io.c b/src/lib/tng_io.c
index f065aff..30daf66 100644
--- a/src/lib/tng_io.c
+++ b/src/lib/tng_io.c
@@ -5982,6 +5982,7 @@ tng_function_status tng_molecule_chain_find(tng_trajectory_t tng_data,
return(TNG_FAILURE);
}
+/* FIXME: For v. 2 the chain nr should also be possible to specify. */
tng_function_status tng_molecule_chain_add(tng_trajectory_t tng_data,
tng_molecule_t molecule,
const char *name,
@@ -6010,11 +6011,12 @@ tng_function_status tng_molecule_chain_add(tng_trajectory_t tng_data,
tng_chain_name_set(tng_data, *chain, name);
(*chain)->molecule = molecule;
- (*chain)->id = molecule->n_chains;
(*chain)->n_residues = 0;
molecule->n_chains++;
+ (*chain)->id = molecule->n_chains;
+
return(TNG_SUCCESS);
}
@@ -6076,6 +6078,7 @@ tng_function_status tng_chain_residue_find(tng_trajectory_t tng_data,
return(TNG_FAILURE);
}
+/* FIXME: For v. 2 the residue nr should also be possible to specify. */
tng_function_status tng_chain_residue_add(tng_trajectory_t tng_data,
tng_chain_t chain,
const char *name,
@@ -6144,13 +6147,14 @@ tng_function_status tng_chain_residue_add(tng_trajectory_t tng_data,
tng_residue_name_set(tng_data, *residue, name);
(*residue)->chain = chain;
- (*residue)->id = chain->n_residues;
(*residue)->n_atoms = 0;
(*residue)->atoms = 0;
chain->n_residues++;
molecule->n_residues++;
+ (*residue)->id = chain->n_residues;
+
return(TNG_SUCCESS);
}
@@ -6185,6 +6189,7 @@ tng_function_status tng_residue_name_set(tng_trajectory_t tng_data,
return(TNG_SUCCESS);
}
+/* FIXME: For v. 2 the atom nr should also be possible to specify. */
tng_function_status tng_residue_atom_add(tng_trajectory_t tng_data,
tng_residue_t residue,
const char *atom_name,
@@ -6255,11 +6260,12 @@ tng_function_status tng_residue_atom_add(tng_trajectory_t tng_data,
tng_atom_type_set(tng_data, *atom, atom_type);
(*atom)->residue = residue;
- (*atom)->id = molecule->n_atoms;
residue->n_atoms++;
molecule->n_atoms++;
+ (*atom)->id = molecule->n_atoms;
+
return(TNG_SUCCESS);
}
contact: Jan Huwald // Impressum