void setAsas ( double [ ] asas1 , double [ ] asas2 , int nSpherePoints , int nThreads , int cofactorSizeToUse ) { Atom [ ] atoms = getAtomsForAsa ( cofactorSizeToUse ) ; AsaCalculator asaCalc = new AsaCalculator ( atoms , AsaCalculator . DEFAULT_PROBE_SIZE , nSpherePoints , nThreads ) ; double [ ] complexAsas = asaCalc . calculateAsas ( ) ; if ( complexAsas . length != asas1 . length + asas2 . length ) throw new IllegalArgumentException ( "The size of ASAs of complex doesn't match that of ASAs 1 + ASAs 2" ) ; groupAsas1 = new TreeMap <> ( ) ; groupAsas2 = new TreeMap <> ( ) ; this . totalArea = 0 ; for ( int i = 0 ; i < asas1 . length ; i ++ ) { Group g = atoms [ i ] . getGroup ( ) ; if ( ! g . getType ( ) . equals ( GroupType . HETATM ) || isInChain ( g ) ) { // interface area should be only for protein/nucleotide but not hetatoms that are not part of the chain this . totalArea += ( asas1 [ i ] - complexAsas [ i ] ) ; } if ( ! groupAsas1 . containsKey ( g . getResidueNumber ( ) ) ) { GroupAsa groupAsa = new GroupAsa ( g ) ; groupAsa . addAtomAsaU ( asas1 [ i ] ) ; groupAsa . addAtomAsaC ( complexAsas [ i ] ) ; groupAsas1 . put ( g . getResidueNumber ( ) , groupAsa ) ; } else { GroupAsa groupAsa = groupAsas1 . get ( g . getResidueNumber ( ) ) ; groupAsa . addAtomAsaU ( asas1 [ i ] ) ; groupAsa . addAtomAsaC ( complexAsas [ i ] ) ; } } for ( int i = 0 ; i < asas2 . length ; i ++ ) { Group g = atoms [ i + asas1 . length ] . getGroup ( ) ; if ( ! g . getType ( ) . equals ( GroupType . HETATM ) || isInChain ( g ) ) { // interface area should be only for protein/nucleotide but not hetatoms that are not part of the chain this . totalArea += ( asas2 [ i ] - complexAsas [ i + asas1 . length ] ) ; } if ( ! groupAsas2 . containsKey ( g . getResidueNumber ( ) ) ) { GroupAsa groupAsa = new GroupAsa ( g ) ; groupAsa . addAtomAsaU ( asas2 [ i ] ) ; groupAsa . addAtomAsaC ( complexAsas [ i + asas1 . length ] ) ; groupAsas2 . put ( g . getResidueNumber ( ) , groupAsa ) ; } else { GroupAsa groupAsa = groupAsas2 . get ( g . getResidueNumber ( ) ) ; groupAsa . addAtomAsaU ( asas2 [ i ] ) ; groupAsa . addAtomAsaC ( complexAsas [ i + asas1 . length ] ) ; } } // our interface area definition: average of bsa of both molecules this . totalArea = this . totalArea / 2.0 ; }
Set ASA annotations by passing the uncomplexed ASA values of the 2 partners . This will calculate complexed ASA and set the ASA values in the member variables .