Skip to content

Commit bc2ba52

Browse files
Use correct indices of residues in Transformation (#64)
1 parent 2bf28ef commit bc2ba52

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

ext/BioStructuresBioAlignmentsExt.jl

+4-1
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ function BioStructures.Transformation(el1::StructuralElementOrList,
6363
end
6464
@info "Superimposing based on a sequence alignment between $(length(inds1)) residues"
6565
atoms1, atoms2 = AbstractAtom[], AbstractAtom[]
66+
inds1_used, inds2_used = Int[], Int[]
6667
for (i1, i2) in zip(inds1, inds2)
6768
sel_ats1 = collectatoms(res1[i1], alignatoms)
6869
sel_ats2 = collectatoms(res2[i2], alignatoms)
@@ -71,13 +72,15 @@ function BioStructures.Transformation(el1::StructuralElementOrList,
7172
if length(sel_ats1) == length(sel_ats2)
7273
append!(atoms1, sel_ats1)
7374
append!(atoms2, sel_ats2)
75+
push!(inds1_used, i1)
76+
push!(inds2_used, i2)
7477
end
7578
end
7679
if length(atoms1) == 0
7780
throw(ArgumentError("No atoms found to superimpose"))
7881
end
7982
@info "Superimposing based on $(length(atoms1)) atoms"
80-
return Transformation(coordarray(atoms1), coordarray(atoms2), inds1, inds2)
83+
return Transformation(coordarray(atoms1), coordarray(atoms2), inds1_used, inds2_used)
8184
end
8285

8386
end # BioStructuresBioAlignmentsExt

0 commit comments

Comments
 (0)