# The refinement of my structure is changing the position of my Mg2+ ion

**URL:** <https://ask.bioexcel.eu/t/the-refinement-of-my-structure-is-changing-the-position-of-my-mg2-ion/5724>\
**Category:** HADDOCK\
**Tags:** haddock\
**Created:** [June 3, 2025, 12:21pm UTC](https://ask.bioexcel.eu/t/the-refinement-of-my-structure-is-changing-the-position-of-my-mg2-ion/5724 "2025-06-03T12:21:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jana](https://avatars.discourse-cdn.com/v4/letter/j/258eb7/32.png) [@Jana](https://ask.bioexcel.eu/u/Jana)\
**Post date:** [June 3, 2025, 12:21pm UTC](https://ask.bioexcel.eu/t/the-refinement-of-my-structure-is-changing-the-position-of-my-mg2-ion/5724/1 "2025-06-03T12:21:59Z")

</div>

Hello, since I’m a new user, I cannot upload my files.

I’m facing an issue when doing the refinement of my modelled structure when I add a magnesium ion. For some reasons, the position is not the optimal initial one I have introduced first. The refinement is messing it up. I try adding constraints within the document like this :  
COMPND MG  
HETATM 1 MG+2 MG2 F 1 13.942 -5.590 6.587 1.00 55.96 MG  
assign (segid F and resid 1 and name MG) (segid A and resid 535 and name O3G) 1.8 0.0 0.4  
assign (segid F and resid 1 and name MG) (segid A and resid 535 and name O1B) 2.3 0.0 0.4  
END

But I’m still facing issues and low score results with low stability.

What should I do ?

---

<div class="post-metadata">

**Author:** ![amjjbonvin](https://dub1.discourse-cdn.com/flex013/user_avatar/ask.bioexcel.eu/amjjbonvin/32/23_2.png) [@amjjbonvin](https://ask.bioexcel.eu/u/amjjbonvin)\
**Post date:** [June 3, 2025, 6:22pm UTC](https://ask.bioexcel.eu/t/the-refinement-of-my-structure-is-changing-the-position-of-my-mg2-ion/5724/2 "2025-06-03T18:22:56Z")

</div>

The restraints should match the naming of your ions. And in this case the atom name should be between double quote because of the + sign:

```auto
assign (segid F and resid 1 and name “MG+2") (segid A and resid 535 and name O3G) 1.8 0.0 0.4
assign (segid F and resid 1 and name “MG+2”) (segid A and resid 535 and name O1B) 2.3 0.0 0.4

```

And of course the oxygen names must match the HADDOCK naming.
