Skip to content

Commit 3fea9a9

Browse files
lafitasbliven
authored andcommitted
Fix contiguous helices in SSE counting
1 parent bf59aba commit 3fea9a9

1 file changed

Lines changed: 19 additions & 2 deletions

File tree

biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/internal/CeSymmIterative.java

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
import javax.vecmath.Matrix4d;
3030

3131
import org.biojava.nbio.structure.Atom;
32+
import org.biojava.nbio.structure.ResidueNumber;
3233
import org.biojava.nbio.structure.StructureException;
3334
import org.biojava.nbio.structure.StructureIdentifier;
3435
import org.biojava.nbio.structure.align.multiple.Block;
@@ -341,11 +342,27 @@ private static int countHelixStrandSSE(Atom[] atoms) {
341342
List<SecStrucElement> sses = SecStrucTools
342343
.getSecStrucElements(SymmetryTools.getGroups(atoms));
343344
int count = 0;
345+
346+
//keep track of different helix types
347+
boolean helix = false;
348+
int hEnd = 0;
349+
344350
for (SecStrucElement sse : sses) {
345351
SecStrucType t = sse.getType();
346-
if (t.isBetaStrand() || t.isHelixType()) {
352+
if (t.isBetaStrand()) {
353+
helix = false;
347354
count++;
348-
}
355+
} else if (t.isHelixType()){
356+
if (helix){
357+
// If this helix is contiguous to the previous
358+
if (sse.getRange().getStart().getSeqNum() + 1 == hEnd)
359+
hEnd = sse.getRange().getEnd().getSeqNum();
360+
else
361+
count++;
362+
} else
363+
count++;
364+
} else
365+
helix = false;
349366
}
350367
return count;
351368
}

0 commit comments

Comments
 (0)