We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f191d14 commit 72317d9Copy full SHA for 72317d9
1 file changed
biojava-structure/src/main/java/org/biojava/nbio/structure/StructureTools.java
@@ -700,7 +700,14 @@ public static final Atom[] cloneAtomArray(Atom[] ca) {
700
Group parentN = (Group) parentG.clone();
701
702
newCA[apos] = parentN.getAtom(a.getName());
703
- newChain.addGroup(parentN);
+ try {
704
+ // if the group doesn't exist yet, this produces a StructureException
705
+ newChain.getGroupByPDB(parentN.getResidueNumber());
706
+ } catch (StructureException e) {
707
+ // the group doesn't exist yet in the newChain, let's add it
708
+ newChain.addGroup(parentN);
709
+ }
710
+
711
}
712
return newCA;
713
0 commit comments