public static void addLastP ( PolymerNotation polymer ) throws RNAUtilsException , NotationException , HELM2HandledException { checkRNA ( polymer ) ; /* Get last monomerNotation */ MonomerNotation lastObject = polymer . getPolymerElements ( ) . getListOfElements ( ) . get ( polymer . getPolymerElements ( ) . getListOfElements ( ) . size ( ) - 1 ) ; /* What happens to HELM2 features */ if ( lastObject instanceof MonomerNotationGroup || lastObject instanceof MonomerNotationList ) { throw new HELM2HandledException ( "HELM2 features are involved" ) ; } if ( ! ( hasPhosphat ( ( MonomerNotationUnitRNA ) lastObject ) ) ) { MonomerNotation lastObjectwithPhosphat = new MonomerNotationUnitRNA ( lastObject . getUnit ( ) + "P" , "RNA" ) ; ChangeObjects . changeMonomerNotation ( polymer . getPolymerElements ( ) . getListOfElements ( ) . size ( ) - 1 , polymer , lastObjectwithPhosphat ) ; LOG . info ( "Phosphate was added to the last nucleotide" ) ; } }
method to add a phosphate to the last polymer s nucleotide