Re: [Biopython] Variation in distance calculation between Bio.PDB and PyMol
João Rodrigues <[email protected]> Tue, 27 Feb 2024 23:11:20 +0000
| Newsgroups | gmane.comp.python.bio.general |
|---|---|
| Message-ID | <CAB=-b2YW_093vtmZ1TrqvDjvjo7nnAMFzz7SK3vOpdaDqu1oSA@mail.gmail.com> |
--===============6052809485705514963==
Content-Type: multipart/alternative; boundary="00000000000097f18206126525fb"
--00000000000097f18206126525fb
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Hi Salma,
Thanks for the explanation and for attaching a code sample. Running your
script locally returns 1.801. I don't know what pairs of atoms you are
calculating distances for exactly in Pymol, so it's hard to judge what can
be happening.
That said, the ligands in the structure you attached are disordered and
each atom has multiple alternate locations. If you show the atoms as
spheres in Pymol, they might overlap each other and they're hard to see.
Try setting sphere_scale to 0.2 or so and then measure the distances again.
Also, when you do structure.get_atoms(), note that the disordered atoms
don't get unpacked and there's only one of the alternate locations that is
selected. To include all atoms, you have to manually unpack residues like
this:
all_atoms =3D []
for res in structure.get_residues():
all_atoms.extend(res.get_unpacked_list())
If I do this in your script I get an average distance of 1.727.
Does this help with your question?
Best,
Jo=C3=A3o
--00000000000097f18206126525fb
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div>Hi Salma,</div><div><br></div><div>Thanks for the exp=
lanation and for attaching a code sample. Running your script locally retur=
ns 1.801. I don't know what pairs of atoms you are calculating distance=
s for exactly in Pymol, so it's hard to judge what can be happening.</d=
iv><div><br></div><div>That said, the ligands in the structure you attached=
are disordered and each atom has multiple alternate locations. If you show=
the atoms as spheres in Pymol, they might overlap each other and they'=
re hard to see. Try setting sphere_scale to 0.2 or so and then measure the =
distances again. Also, when you do structure.get_atoms(), note that the dis=
ordered atoms don't get unpacked and there's only one of the altern=
ate locations that is selected. To include all atoms, you have to manually =
unpack residues like this:</div><div><br></div><div>all_atoms =3D []</div><=
div>for res in structure.get_residues():</div><div>=C2=A0=C2=A0=C2=A0 all_a=
toms.extend(res.get_unpacked_list())</div><div><br></div><div>If I do this =
in your script I get an average distance of 1.727.</div><div><br></div><div=
>Does this help with your question?</div><div><br></div><div>Best,</div><di=
v><br></div><div>Jo=C3=A3o<br></div></div>
--00000000000097f18206126525fb--
--===============6052809485705514963==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
Biopython mailing list - [email protected]
https://mailman.open-bio.org/mailman/listinfo/biopython
--===============6052809485705514963==--