@@ -246,31 +246,17 @@ mod tests {
246
246
snapshots. push ( alanine. clone ( ) ) ;
247
247
248
248
// Add an amidation named modification to the C-terminal
249
- // FIXME: Replace all of these with .group_state_mut()!
250
- assert ! ( alanine. functional_groups. contains_key( & C_TERMINAL ) ) ;
251
- alanine. functional_groups . insert (
252
- C_TERMINAL ,
253
- GroupState :: Modified ( NamedMod :: new ( & POLYMER_DB , "Am" ) . unwrap ( ) ) ,
254
- ) ;
249
+ let amidation = GroupState :: Modified ( NamedMod :: new ( & POLYMER_DB , "Am" ) . unwrap ( ) ) ;
250
+ * alanine. group_state_mut ( & C_TERMINAL ) . unwrap ( ) = amidation;
255
251
snapshots. push ( alanine. clone ( ) ) ;
256
252
257
253
// Add an amidation named modification to the N-terminal (ignoring that that's impossible)
258
- assert ! ( alanine. functional_groups. contains_key( & N_TERMINAL ) ) ;
259
- alanine. functional_groups . insert (
260
- N_TERMINAL ,
261
- GroupState :: Modified ( NamedMod :: new ( & POLYMER_DB , "Am" ) . unwrap ( ) ) ,
262
- ) ;
254
+ * alanine. group_state_mut ( & N_TERMINAL ) . unwrap ( ) = amidation;
263
255
snapshots. push ( alanine. clone ( ) ) ;
264
256
265
257
// Out of functional groups, so adding more amidations changes nothing
266
- alanine. functional_groups . insert (
267
- N_TERMINAL ,
268
- GroupState :: Modified ( NamedMod :: new ( & POLYMER_DB , "Am" ) . unwrap ( ) ) ,
269
- ) ;
270
- alanine. functional_groups . insert (
271
- C_TERMINAL ,
272
- GroupState :: Modified ( NamedMod :: new ( & POLYMER_DB , "Am" ) . unwrap ( ) ) ,
273
- ) ;
258
+ * alanine. group_state_mut ( & N_TERMINAL ) . unwrap ( ) = amidation;
259
+ * alanine. group_state_mut ( & C_TERMINAL ) . unwrap ( ) = amidation;
274
260
snapshots. push ( alanine. clone ( ) ) ;
275
261
276
262
// But they can be replaced with bonds
@@ -283,9 +269,7 @@ mod tests {
283
269
} ,
284
270
)
285
271
. unwrap ( ) ;
286
- alanine
287
- . functional_groups
288
- . insert ( N_TERMINAL , GroupState :: Donor ( peptide_bond) ) ;
272
+ * alanine. group_state_mut ( & N_TERMINAL ) . unwrap ( ) = GroupState :: Donor ( peptide_bond) ;
289
273
snapshots. push ( alanine. clone ( ) ) ;
290
274
291
275
// Residues can be protonated
0 commit comments