Skip to content
Snippets Groups Projects
Commit 9413e48f authored by Marco Biasini's avatar Marco Biasini
Browse files

fix AddCompound for residues with atoms not listed in order of increasing ordinals

The issues manifests when importing large "composite" compounds,
e.g. a ligand derived from several amino acids with the atoms not
listed in order of increasing ordinals. This was not a problem up
until now, since the components.cif dictionary was always (as
far as I know) listing the atoms ordered by ordinal.
parent f782cc14
No related branches found
No related tags found
No related merge requests found
...@@ -156,10 +156,10 @@ void CompoundLib::AddCompound(const CompoundPtr& compound) ...@@ -156,10 +156,10 @@ void CompoundLib::AddCompound(const CompoundPtr& compound)
sqlite3_bind_int(stmt, 5, a.is_aromatic); sqlite3_bind_int(stmt, 5, a.is_aromatic);
sqlite3_bind_int(stmt, 6, 0); sqlite3_bind_int(stmt, 6, 0);
sqlite3_bind_int(stmt, 7, a.is_leaving); sqlite3_bind_int(stmt, 7, a.is_leaving);
sqlite3_bind_int(stmt, 8, i-al.begin()); sqlite3_bind_int(stmt, 8, a.ordinal);
retval=sqlite3_step(stmt); retval=sqlite3_step(stmt);
assert(retval==SQLITE_DONE); assert(retval==SQLITE_DONE);
atom_ids[i-al.begin()]=sqlite3_last_insert_rowid(conn_); atom_ids[a.ordinal]=sqlite3_last_insert_rowid(conn_);
} else { } else {
LOG_ERROR(sqlite3_errmsg(conn_)); LOG_ERROR(sqlite3_errmsg(conn_));
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment