-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update peptides_proteins.rst #433
Conversation
checked for spacing etc.
# Create an amino acid sequence using the fromString() method of the AASequence class. | ||
# In this example, we will use the amino acid sequence "TESTMTECSTMTESTR" | ||
sequence = poms.AASequence.fromString("TESTMTECSTMTESTR") | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[blacken-docs] reported by reviewdog 🐶
# We use the names "Oxidation (M)" and "Carbamidomethyl (C)" for the variable and fixed modifications, respectively. | ||
variable_mod_names = [b"Oxidation (M)"] | ||
fixed_mod_names = [b"Carbamidomethyl (C)"] | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[blacken-docs] reported by reviewdog 🐶
variable_modifications = poms.ModifiedPeptideGenerator.getModifications(variable_mod_names) | ||
fixed_modifications = poms.ModifiedPeptideGenerator.getModifications(fixed_mod_names) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[blacken-docs] reported by reviewdog 🐶
variable_modifications = poms.ModifiedPeptideGenerator.getModifications(variable_mod_names) | |
fixed_modifications = poms.ModifiedPeptideGenerator.getModifications(fixed_mod_names) | |
variable_modifications = poms.ModifiedPeptideGenerator.getModifications( | |
variable_mod_names | |
) | |
fixed_modifications = poms.ModifiedPeptideGenerator.getModifications( | |
fixed_mod_names | |
) | |
poms.ModifiedPeptideGenerator.applyFixedModifications(fixed_modifications, sequence) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[blacken-docs] reported by reviewdog 🐶
poms.ModifiedPeptideGenerator.applyFixedModifications(fixed_modifications, sequence) | |
poms.ModifiedPeptideGenerator.applyFixedModifications( | |
fixed_modifications, sequence | |
) | |
|
||
# Define the maximum number of variable modifications allowed | ||
max_variable_mods = 1 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[blacken-docs] reported by reviewdog 🐶
# Print the modified peptides generated using Fixed modifications and their mono-isotopic mass. | ||
print("Fixed:", sequence.toString()) | ||
print("Mono-isotopic mass:", sequence.getMonoWeight()) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[blacken-docs] reported by reviewdog 🐶
for peptide in peptides_with_variable_modifications: | ||
print("Variable:", peptide.toString()) | ||
print("Mono-isotopic mass:", peptide.getMonoWeight()) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[blacken-docs] reported by reviewdog 🐶
look more good Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
variable_modifications = poms.ModifiedPeptideGenerator.getModifications(variable_mod_names) | ||
fixed_modifications = poms.ModifiedPeptideGenerator.getModifications(fixed_mod_names) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[blacken-docs] reported by reviewdog 🐶
variable_modifications = poms.ModifiedPeptideGenerator.getModifications(variable_mod_names) | |
fixed_modifications = poms.ModifiedPeptideGenerator.getModifications(fixed_mod_names) | |
variable_modifications = poms.ModifiedPeptideGenerator.getModifications( | |
variable_mod_names | |
) | |
fixed_modifications = poms.ModifiedPeptideGenerator.getModifications( | |
fixed_mod_names | |
) | |
@@ -13,7 +13,6 @@ some commonly used operations like chemical formula, weight, and isotope distrib | |||
The example below shows how amino acid sequences can be created and how basic mass calculations are conducted. | |||
|
|||
.. code-block:: python | |||
:linenos: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are these removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of removing this line, I fixed in next commits of format issue.
@@ -335,41 +335,42 @@ In this tutorial, we will cover a step-by-step guide on how to use the pyopenms | |||
|
|||
.. code-block:: python | |||
:linenos: | |||
import pyopenms as poms | |||
|
|||
import pyopenms as poms |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[blacken-docs] reported by reviewdog 🐶
import pyopenms as poms | |
import pyopenms as poms |
# Create an amino acid sequence using the fromString() method of the AASequence class. | ||
# In this example, we will use the amino acid sequence "TESTMTECSTMTESTR" | ||
sequence = poms.AASequence.fromString("TESTMTECSTMTESTR") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[blacken-docs] reported by reviewdog 🐶
# Create an amino acid sequence using the fromString() method of the AASequence class. | |
# In this example, we will use the amino acid sequence "TESTMTECSTMTESTR" | |
sequence = poms.AASequence.fromString("TESTMTECSTMTESTR") | |
# Create an amino acid sequence using the fromString() method of the AASequence class. | |
# In this example, we will use the amino acid sequence "TESTMTECSTMTESTR" | |
sequence = poms.AASequence.fromString("TESTMTECSTMTESTR") |
# We use the names "Oxidation (M)" and "Carbamidomethyl (C)" for the variable and fixed modifications, respectively. | ||
variable_mod_names = [b"Oxidation (M)"] | ||
fixed_mod_names = [b"Carbamidomethyl (C)"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[blacken-docs] reported by reviewdog 🐶
# We use the names "Oxidation (M)" and "Carbamidomethyl (C)" for the variable and fixed modifications, respectively. | |
variable_mod_names = [b"Oxidation (M)"] | |
fixed_mod_names = [b"Carbamidomethyl (C)"] | |
# We use the names "Oxidation (M)" and "Carbamidomethyl (C)" for the variable and fixed modifications, respectively. | |
variable_mod_names = [b"Oxidation (M)"] | |
fixed_mod_names = [b"Carbamidomethyl (C)"] |
# We then use the getModifications() method of the ModifiedPeptideGenerator class to get the modifications for these names. | ||
variable_modifications = poms.ModifiedPeptideGenerator.getModifications(variable_mod_names) | ||
fixed_modifications = poms.ModifiedPeptideGenerator.getModifications(fixed_mod_names) | ||
|
||
# Apply the fixed modifications to the amino acid sequence | ||
poms.ModifiedPeptideGenerator.applyFixedModifications(fixed_modifications, sequence) | ||
# Apply the fixed modifications to the amino acid sequence | ||
poms.ModifiedPeptideGenerator.applyFixedModifications(fixed_modifications, sequence) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[blacken-docs] reported by reviewdog 🐶
# We then use the getModifications() method of the ModifiedPeptideGenerator class to get the modifications for these names. | |
variable_modifications = poms.ModifiedPeptideGenerator.getModifications(variable_mod_names) | |
fixed_modifications = poms.ModifiedPeptideGenerator.getModifications(fixed_mod_names) | |
# Apply the fixed modifications to the amino acid sequence | |
poms.ModifiedPeptideGenerator.applyFixedModifications(fixed_modifications, sequence) | |
# Apply the fixed modifications to the amino acid sequence | |
poms.ModifiedPeptideGenerator.applyFixedModifications(fixed_modifications, sequence) | |
# We then use the getModifications() method of the ModifiedPeptideGenerator class to get the modifications for these names. | |
variable_modifications = poms.ModifiedPeptideGenerator.getModifications( | |
variable_mod_names | |
) | |
fixed_modifications = poms.ModifiedPeptideGenerator.getModifications( | |
fixed_mod_names | |
) |
# Define the maximum number of variable modifications allowed | ||
max_variable_mods = 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[blacken-docs] reported by reviewdog 🐶
# Define the maximum number of variable modifications allowed | |
max_variable_mods = 1 | |
# Apply the fixed modifications to the amino acid sequence | |
poms.ModifiedPeptideGenerator.applyFixedModifications( | |
fixed_modifications, sequence | |
) |
# Generate the modified peptides | ||
peptides_with_variable_modifications = [] | ||
keep_unmodified_in_result = False | ||
poms.ModifiedPeptideGenerator.applyVariableModifications(variable_modifications, sequence, max_variable_mods, | ||
peptides_with_variable_modifications, | ||
keep_unmodified_in_result) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[blacken-docs] reported by reviewdog 🐶
# Generate the modified peptides | |
peptides_with_variable_modifications = [] | |
keep_unmodified_in_result = False | |
poms.ModifiedPeptideGenerator.applyVariableModifications(variable_modifications, sequence, max_variable_mods, | |
peptides_with_variable_modifications, | |
keep_unmodified_in_result) | |
# Define the maximum number of variable modifications allowed | |
max_variable_mods = 1 | |
# Generate the modified peptides | |
peptides_with_variable_modifications = [] | |
keep_unmodified_in_result = False | |
poms.ModifiedPeptideGenerator.applyVariableModifications( | |
variable_modifications, | |
sequence, | |
max_variable_mods, | |
peptides_with_variable_modifications, | |
keep_unmodified_in_result, | |
) |
# Print the modified peptides generated using Fixed modifications and their mono-isotopic mass. | ||
print("Fixed:", sequence.toString()) | ||
print("Mono-isotopic mass:", sequence.getMonoWeight()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[blacken-docs] reported by reviewdog 🐶
# Print the modified peptides generated using Fixed modifications and their mono-isotopic mass. | |
print("Fixed:", sequence.toString()) | |
print("Mono-isotopic mass:", sequence.getMonoWeight()) | |
# Print the modified peptides generated using Fixed modifications and their mono-isotopic mass. | |
print("Fixed:", sequence.toString()) | |
print("Mono-isotopic mass:", sequence.getMonoWeight()) |
# Print the modified peptides generated using variable modifications and their mono-isotopic mass. | ||
for peptide in peptides_with_variable_modifications: | ||
print("Variable:", peptide.toString()) | ||
print("Mono-isotopic mass:", peptide.getMonoWeight()) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[blacken-docs] reported by reviewdog 🐶
# Print the modified peptides generated using variable modifications and their mono-isotopic mass. | |
for peptide in peptides_with_variable_modifications: | |
print("Variable:", peptide.toString()) | |
print("Mono-isotopic mass:", peptide.getMonoWeight()) | |
# Print the modified peptides generated using variable modifications and their mono-isotopic mass. | |
for peptide in peptides_with_variable_modifications: | |
print("Variable:", peptide.toString()) | |
print("Mono-isotopic mass:", peptide.getMonoWeight()) |
checked for spacing etc.