public List < SecStrucState > calculate ( Structure s , boolean assign ) throws StructureException { List < SecStrucState > secstruc = new ArrayList < SecStrucState > ( ) ; for ( int i = 0 ; i < s . nrModels ( ) ; i ++ ) { // Reinitialise the global vars ladders = new ArrayList < Ladder > ( ) ; bridges = new ArrayList < BetaBridge > ( ) ; groups = initGroupArray ( s , i ) ; // Initialise the contact set for this structure initContactSet ( ) ; if ( groups . length < 5 ) { // not enough groups to do anything throw new StructureException ( "Not enough backbone groups in the" + " Structure to calculate the secondary structure (" + groups . length + " given, minimum 5)" ) ; } calculateHAtoms ( ) ; calculateHBonds ( ) ; calculateDihedralAngles ( ) ; calculateTurns ( ) ; buildHelices ( ) ; detectBends ( ) ; detectStrands ( ) ; for ( SecStrucGroup sg : groups ) { SecStrucState ss = ( SecStrucState ) sg . getProperty ( Group . SEC_STRUC ) ; // Add to return list and assign to original if flag is true secstruc . add ( ss ) ; if ( assign ) sg . getOriginal ( ) . setProperty ( Group . SEC_STRUC , ss ) ; } } return secstruc ; }
Predicts the secondary structure of this Structure object using a DSSP implementation .