@@ -167,6 +167,9 @@ public class StructureTools {
167167
168168 private static final Set <Element > hBondDonorAcceptors ;
169169
170+ private static final Set <String > NUCLEOTIDE_BACKBONE_ATOMS ;
171+ private static final Set <String > AMINOACID_BACKBONE_ATOMS ;
172+
170173 static {
171174 nucleotides30 = new HashMap <String , Character >();
172175 nucleotides30 .put ("DA" , 'A' );
@@ -256,6 +259,9 @@ public class StructureTools {
256259 hBondDonorAcceptors .add (Element .O );
257260 hBondDonorAcceptors .add (Element .S );
258261
262+ NUCLEOTIDE_BACKBONE_ATOMS = new HashSet <>(Arrays .asList (C1_ATOM_NAME , C2_ATOM_NAME , C3_ATOM_NAME , C4_ATOM_NAME , O2_ATOM_NAME , O3_ATOM_NAME , O4_ATOM_NAME , O5_ATOM_NAME , OP1_ATOM_NAME , OP2_ATOM_NAME , P_ATOM_NAME ));
263+ AMINOACID_BACKBONE_ATOMS = new HashSet <>(Arrays .asList (CA_ATOM_NAME , C_ATOM_NAME , N_ATOM_NAME , O_ATOM_NAME ));
264+
259265 }
260266
261267 /**
@@ -1129,16 +1135,13 @@ public static Atom[] getRepresentativeAtomArray(Structure s) {
11291135 */
11301136 public static Atom [] getBackboneAtomArray (Structure s ) {
11311137 List <Atom > atoms = new ArrayList <>();
1132- Set <String > nucleotideAtomNames = new HashSet <>(Arrays .asList (C1_ATOM_NAME , C2_ATOM_NAME , C3_ATOM_NAME , C4_ATOM_NAME , O2_ATOM_NAME , O3_ATOM_NAME , O4_ATOM_NAME , O5_ATOM_NAME , OP1_ATOM_NAME , OP2_ATOM_NAME , P_ATOM_NAME ));
1133- Set <String > aminoAcidAtomNames = new HashSet <>(Arrays .asList (CA_ATOM_NAME , C_ATOM_NAME , N_ATOM_NAME , O_ATOM_NAME ));
1134-
11351138 for (Chain c : s .getChains ()) {
11361139 for (Group g : c .getAtomGroups ()) {
11371140 if (g .hasAminoAtoms ()) {
11381141 if (g .getType () == GroupType .NUCLEOTIDE ) {
1139- addNucleotideAndAminoAtoms (atoms , g , nucleotideAtomNames );
1142+ addNucleotideAndAminoAtoms (atoms , g , NUCLEOTIDE_BACKBONE_ATOMS );
11401143 } else {
1141- addNucleotideAndAminoAtoms (atoms , g , aminoAcidAtomNames );
1144+ addNucleotideAndAminoAtoms (atoms , g , AMINOACID_BACKBONE_ATOMS );
11421145 }
11431146 }
11441147 }
0 commit comments