@@ -335,41 +335,42 @@ In this tutorial, we will cover a step-by-step guide on how to use the pyopenms
335
335
336
336
.. code-block :: python
337
337
:linenos:
338
- import pyopenms as poms
338
+
339
+ import pyopenms as poms
339
340
340
- # Create an amino acid sequence using the fromString() method of the AASequence class.
341
- # In this example, we will use the amino acid sequence "TESTMTECSTMTESTR"
342
- sequence = poms.AASequence.fromString("TESTMTECSTMTESTR")
341
+ # Create an amino acid sequence using the fromString() method of the AASequence class.
342
+ # In this example, we will use the amino acid sequence "TESTMTECSTMTESTR"
343
+ sequence = poms.AASequence.fromString(" TESTMTECSTMTESTR" )
343
344
344
- # We use the names "Oxidation (M)" and "Carbamidomethyl (C)" for the variable and fixed modifications, respectively.
345
- variable_mod_names = [b"Oxidation (M)"]
346
- fixed_mod_names = [b"Carbamidomethyl (C)"]
345
+ # We use the names "Oxidation (M)" and "Carbamidomethyl (C)" for the variable and fixed modifications, respectively.
346
+ variable_mod_names = [b " Oxidation (M)" ]
347
+ fixed_mod_names = [b " Carbamidomethyl (C)" ]
347
348
348
- # We then use the getModifications() method of the ModifiedPeptideGenerator class to get the modifications for these names.
349
- variable_modifications = poms.ModifiedPeptideGenerator.getModifications(variable_mod_names)
350
- fixed_modifications = poms.ModifiedPeptideGenerator.getModifications(fixed_mod_names)
349
+ # We then use the getModifications() method of the ModifiedPeptideGenerator class to get the modifications for these names.
350
+ variable_modifications = poms.ModifiedPeptideGenerator.getModifications(variable_mod_names)
351
+ fixed_modifications = poms.ModifiedPeptideGenerator.getModifications(fixed_mod_names)
351
352
352
- # Apply the fixed modifications to the amino acid sequence
353
- poms.ModifiedPeptideGenerator.applyFixedModifications(fixed_modifications, sequence)
353
+ # Apply the fixed modifications to the amino acid sequence
354
+ poms.ModifiedPeptideGenerator.applyFixedModifications(fixed_modifications, sequence)
354
355
355
- # Define the maximum number of variable modifications allowed
356
- max_variable_mods = 1
356
+ # Define the maximum number of variable modifications allowed
357
+ max_variable_mods = 1
357
358
358
- # Generate the modified peptides
359
- peptides_with_variable_modifications = []
360
- keep_unmodified_in_result = False
361
- poms.ModifiedPeptideGenerator.applyVariableModifications(variable_modifications, sequence, max_variable_mods,
362
- peptides_with_variable_modifications,
363
- keep_unmodified_in_result)
359
+ # Generate the modified peptides
360
+ peptides_with_variable_modifications = []
361
+ keep_unmodified_in_result = False
362
+ poms.ModifiedPeptideGenerator.applyVariableModifications(variable_modifications, sequence, max_variable_mods,
363
+ peptides_with_variable_modifications,
364
+ keep_unmodified_in_result)
364
365
365
- # Print the modified peptides generated using Fixed modifications and their mono-isotopic mass.
366
- print("Fixed:", sequence.toString())
367
- print("Mono-isotopic mass:", sequence.getMonoWeight())
366
+ # Print the modified peptides generated using Fixed modifications and their mono-isotopic mass.
367
+ print (" Fixed:" , sequence.toString())
368
+ print (" Mono-isotopic mass:" , sequence.getMonoWeight())
368
369
369
- # Print the modified peptides generated using variable modifications and their mono-isotopic mass.
370
- for peptide in peptides_with_variable_modifications:
371
- print("Variable:", peptide.toString())
372
- print("Mono-isotopic mass:", peptide.getMonoWeight())
370
+ # Print the modified peptides generated using variable modifications and their mono-isotopic mass.
371
+ for peptide in peptides_with_variable_modifications:
372
+ print (" Variable:" , peptide.toString())
373
+ print (" Mono-isotopic mass:" , peptide.getMonoWeight())
373
374
374
375
The above code outputs:
375
376
0 commit comments