Skip to content

Commit df06fc8

Browse files
Ayesha-FerozArslan-Sirajgithub-actions[bot]Arslan
authored
Update peptides_proteins.rst (#433)
* Update peptides_proteins.rst checked for spacing etc. * Update docs/source/user_guide/peptides_proteins.rst look more good Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Revert "Update docs/source/user_guide/peptides_proteins.rst " This reverts commit 17c8b19. * Revert "Update peptides_proteins.rst" This reverts commit 885ae45. * Applying Fixed or Variable Modifications to Sequences fixed in doc --------- Co-authored-by: Arslan Siraj <[email protected]> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Arslan <[email protected]>
1 parent e75ffd0 commit df06fc8

File tree

1 file changed

+28
-27
lines changed

1 file changed

+28
-27
lines changed

docs/source/user_guide/peptides_proteins.rst

+28-27
Original file line numberDiff line numberDiff line change
@@ -335,41 +335,42 @@ In this tutorial, we will cover a step-by-step guide on how to use the pyopenms
335335

336336
.. code-block:: python
337337
:linenos:
338-
import pyopenms as poms
338+
339+
import pyopenms as poms
339340
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")
343344
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)"]
347348
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)
351352
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)
354355
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
357358
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)
364365
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())
368369
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())
373374
374375
The above code outputs:
375376

0 commit comments

Comments
 (0)