[Biojava-l] Chain order
Enrico Morelli
morelli at cerm.unifi.it
Thu Oct 12 11:06:52 EDT 2023
Dear,
I've to get data from PDBs to do some calculations. I wrote the following code to get atoms coordinate.
for (Chain c : structure.getChains()) {
for (Group g : c.getAtomGroups()) {
for (Atom a : g.getAtoms()) {
matnum = a.getPDBserial();
matnam = a.getName();
mrsnam = g.getPDBName();
mchain = g.getChain().getName();
mrsnum = g.getResidueNumber().getSeqNum();
xmetal[0] = a.getX();
xmetal[1] = a.getY();
xmetal[2] = a.getZ();
}
}
}
But I noticed that the Chain loops over an alphabetical order of the chains not in the PDB order.
If in my pdb I've:
HETATM 4271 CU CU C1139 -0.625 16.357 -12.867 1.00 50.00 CU
ATOM 729 NE2 HIS A 96 0.676 16.709 -11.347 1.00 40.00 N
ATOM 2863 NE2 HIS C 96 0.770 16.556 -14.258 1.00 40.00 N
My loop starts with the second atom, not the first. So my calculations doesn't work.
Is there a way to have the chains in the pdb order?
Thanks
--
-----------------------------------------------------------
Enrico Morelli
System Administrator | Programmer | Web Developer
CERM - Polo Scientifico
via Sacconi, 6 - 50019 Sesto Fiorentino (FI) - ITALY
------------------------------------------------------------
More information about the Biojava-l
mailing list