public static void removeLastP ( 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 lastObjectwithoutPhosphat = new MonomerNotationUnitRNA ( lastObject . getUnit ( ) . substring ( 0 , lastObject . getUnit ( ) . length ( ) - 1 ) , "RNA" ) ; ChangeObjects . changeMonomerNotation ( polymer . getPolymerElements ( ) . getListOfElements ( ) . size ( ) - 1 , polymer , lastObjectwithoutPhosphat ) ; LOG . info ( "Last phosphate was removed from the last nucleotide" ) ; } }
method to remove the phosphate of the last nucleotide