Skip to content

Conversation

@dikshant182004
Copy link

these are some of the changes to reduce errors occuring while testing + i have added the doctest for quicktest.md (rest are still pending ).

@dikshant182004
Copy link
Author

hi @bittremieux ,i have formatted the code as required by ruff ,but our workflows seems to be failing due to pyteomics issue only ,rest seems to be working fine .

Copy link
Member

@bittremieux bittremieux left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution. I have a few small suggestions and questions.


# Reload the Pyteomics PROXI aggregator to also include GNPS.
pyteomics.usi._proxies["gnps"] = GnpsBackend
# Only perform the assignment if not building docs.
Copy link
Member

Choose a reason for hiding this comment

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

question: Why is this necessary?

Copy link
Author

Choose a reason for hiding this comment

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

hi @bittremieux ,its good to see u again .so this ensures that the GNPS backend will be used for normal runtime usage, while avoiding potential issues during Sphinx documentation builds or in environments .so that while doing doctest it should not cause any issue .

plt.savefig("quickstart.png", bbox_inches="tight", dpi=300, transparent=True)
plt.close()
>>> fig, ax = plt.subplots(figsize=(12, 6))
>>> _=sup.spectrum(spectrum, grid=False, ax=ax);
Copy link
Member

Choose a reason for hiding this comment

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

todo: Remove leading _= and trailing ;.

Copy link
Author

@dikshant182004 dikshant182004 Mar 17, 2025

Choose a reason for hiding this comment

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

Actually sup.spectrum(spectrum, grid=False, ax=ax) was returning a Axes object. Since our expected output is “nothing,” doctest flags this as a failure ,so to avoid this i have store that in '_' . i will remove this for the time being.

clause.property_value.relation.prefix
== "monoIsotopicMass"
)
and "monoIsotopicMass"
Copy link
Member

Choose a reason for hiding this comment

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

question: What is the advantage of the new version vs the previous code?

Copy link
Author

Choose a reason for hiding this comment

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

well the main reason for this change because from the previous code we were facing attribute error ,as it was depending on how fastobo parses the OBO file, the relation might include an extra colon or whitespace (e.g. "monoIsotopicMass:" or with surrounding spaces) as seen in XLMOD.obo file. so i change the previous implementation so that minor formatting differences don’t cause the condition to fail.

--- MsmsSpectrum.annotate_proforma(proforma_str =proforma_sequence, fragment_tol_mass=10.0, fragment_tol_mode ='ppm', ion_types="by")

or
--- or
Copy link
Member

Choose a reason for hiding this comment

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

todo: This interprets it as a Python or statement. Better to not have this be interpreted by doctest.

Copy link
Author

@dikshant182004 dikshant182004 Mar 17, 2025

Choose a reason for hiding this comment

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

okay i will update this also .but is not causing any issue + it will help in maintaining the identation with other code .

@dikshant182004
Copy link
Author

hi @bittremieux plz have a look at the new commit .

@dikshant182004
Copy link
Author

dikshant182004 commented Mar 20, 2025

@bittremieux ,if u have a moment then ,plz have a look at the new commit ;if there is some other thing that needs to be changed in the pr do let me know .

@dikshant182004
Copy link
Author

hi @bittremieux ,if u have a moment then can u plz have a look at this pr .

@dikshant182004
Copy link
Author

hey @bittremieux ,do i need to open a new pull request to avoid this merge conflict.

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.

2 participants