Skip to content
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

Merged
merged 5 commits into from
Mar 7, 2024
Merged

Conversation

Ayesha-Feroz
Copy link
Contributor

checked for spacing etc.

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")

Copy link
Contributor

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 🐶

Suggested change

# 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)"]

Copy link
Contributor

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 🐶

Suggested change

Comment on lines 340 to 342
variable_modifications = poms.ModifiedPeptideGenerator.getModifications(variable_mod_names)
fixed_modifications = poms.ModifiedPeptideGenerator.getModifications(fixed_mod_names)

Copy link
Contributor

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 🐶

Suggested change
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
)

Comment on lines 344 to 345
poms.ModifiedPeptideGenerator.applyFixedModifications(fixed_modifications, sequence)

Copy link
Contributor

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 🐶

Suggested change
poms.ModifiedPeptideGenerator.applyFixedModifications(fixed_modifications, sequence)
poms.ModifiedPeptideGenerator.applyFixedModifications(
fixed_modifications, sequence
)


# Define the maximum number of variable modifications allowed
max_variable_mods = 1

Copy link
Contributor

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 🐶

Suggested change

docs/source/user_guide/peptides_proteins.rst Outdated Show resolved Hide resolved
# Print the modified peptides generated using Fixed modifications and their mono-isotopic mass.
print("Fixed:", sequence.toString())
print("Mono-isotopic mass:", sequence.getMonoWeight())

Copy link
Contributor

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 🐶

Suggested change

for peptide in peptides_with_variable_modifications:
print("Variable:", peptide.toString())
print("Mono-isotopic mass:", peptide.getMonoWeight())

Copy link
Contributor

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 🐶

Suggested change

look more good

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Comment on lines 340 to 342
variable_modifications = poms.ModifiedPeptideGenerator.getModifications(variable_mod_names)
fixed_modifications = poms.ModifiedPeptideGenerator.getModifications(fixed_mod_names)

Copy link
Contributor

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 🐶

Suggested change
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:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are these removed?

Copy link
Contributor

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
Copy link
Contributor

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 🐶

Suggested change
import pyopenms as poms
import pyopenms as poms

Comment on lines +341 to +343
# 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")
Copy link
Contributor

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 🐶

Suggested change
# 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")

Comment on lines +345 to +347
# 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)"]
Copy link
Contributor

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 🐶

Suggested change
# 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)"]

Comment on lines +349 to +354
# 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)
Copy link
Contributor

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 🐶

Suggested change
# 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
)

Comment on lines +356 to +357
# Define the maximum number of variable modifications allowed
max_variable_mods = 1
Copy link
Contributor

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 🐶

Suggested change
# 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
)

Comment on lines +359 to +364
# 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)
Copy link
Contributor

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 🐶

Suggested change
# 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,
)

Comment on lines +366 to +368
# Print the modified peptides generated using Fixed modifications and their mono-isotopic mass.
print("Fixed:", sequence.toString())
print("Mono-isotopic mass:", sequence.getMonoWeight())
Copy link
Contributor

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 🐶

Suggested change
# 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())

Comment on lines +370 to 374
# 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())

Copy link
Contributor

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 🐶

Suggested change
# 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())

@timosachsenberg timosachsenberg merged commit df06fc8 into master Mar 7, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants