File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -148,6 +148,14 @@ def attribute_water_to_chains(model):
148148 nonw = h .select (~ wsel )
149149 nonwa = nonw .atoms ()
150150 #
151+ # chain ID <> max residue number mapping
152+ can = {}
153+ for c in nonw .chains ():
154+ last = list (c .residue_groups ())[- 1 ]
155+ can .setdefault (c .id , []).append (last .resseq_as_int ())
156+ for k in can .keys ():
157+ can [k ] = max (can [k ])
158+ #
151159 dic = {}
152160 for aw in wh .atoms ():
153161 d_min = 1.e9
@@ -169,8 +177,9 @@ def attribute_water_to_chains(model):
169177 new_atom_group = iotbx .pdb .hierarchy .atom_group (altloc = "" ,
170178 resname = "HOH" )
171179 new_atom_group .append_atom (atom = new_atom .detached_copy ())
180+ i_seq_ = i_seq + 1 + can [chain_id ]
172181 new_residue_group = iotbx .pdb .hierarchy .residue_group (
173- resseq = iotbx .pdb .resseq_encode (value = i_seq ), icode = " " )
182+ resseq = iotbx .pdb .resseq_encode (value = i_seq_ ), icode = " " )
174183 new_residue_group .append_atom_group (atom_group = new_atom_group )
175184 new_chain .append_residue_group (residue_group = new_residue_group )
176185 pdb_model .append_chain (chain = new_chain )
You can’t perform that action at this time.
0 commit comments