diff --git a/ext/BioStructuresBioAlignmentsExt.jl b/ext/BioStructuresBioAlignmentsExt.jl index 9ec97c4a..dd0c1c68 100644 --- a/ext/BioStructuresBioAlignmentsExt.jl +++ b/ext/BioStructuresBioAlignmentsExt.jl @@ -66,7 +66,9 @@ function BioStructures.Transformation(el1::StructuralElementOrList, for (i1, i2) in zip(inds1, inds2) sel_ats1 = collectatoms(res1[i1], alignatoms) sel_ats2 = collectatoms(res2[i2], alignatoms) - if length(atoms1) == length(atoms2) + # Ensure `atoms1` and `atoms2` have the same length, ignore residues + # where the number of atoms differ. + if length(sel_ats1) == length(sel_ats2) append!(atoms1, sel_ats1) append!(atoms2, sel_ats2) end