public static int getNumGroups ( Structure structure ) { int count = 0 ; for ( int i = 0 ; i < structure . nrModels ( ) ; i ++ ) { for ( Chain chain : structure . getChains ( i ) ) { count += chain . getAtomGroups ( ) . size ( ) ; } } return count ; }
Count the total number of groups in the structure