File tree Expand file tree Collapse file tree
biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/internal Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2929import javax .vecmath .Matrix4d ;
3030
3131import org .biojava .nbio .structure .Atom ;
32+ import org .biojava .nbio .structure .ResidueNumber ;
3233import org .biojava .nbio .structure .StructureException ;
3334import org .biojava .nbio .structure .StructureIdentifier ;
3435import 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 }
You can’t perform that action at this time.
0 commit comments