OpenMS / pyopenms-docs

pyOpenMS readthedocs documentation, additional utilities, addons, scripts, and examples.
https://pyopenms.readthedocs.io
Other
42 stars 52 forks source link

Add how to get all modifications from ModificationsDB #288

Closed timosachsenberg closed 1 year ago

timosachsenberg commented 2 years ago

Add a small part to the documentation how to retrieve all modifications.

https://pyopenms.readthedocs.io/en/latest/user_guide/chemistry.html#amino-acid-modifications

and then print details like "name":"Acetyl", "unimod_accession":1, "mass_shift":42.010565, "amino_acid":null, "n_term":true, "c_term": false},

KyowonJeong commented 1 year ago

I think this works, but not sure if it is right.

from pyopenms import *

num_mod = ModificationsDB().getNumberOfModifications() print(num_mod) all_mods=[] for index in range(0, num_mod): all_mods.append(ModificationsDB().getModification(index))

ox = all_mods[2] print(ox.getUniModAccession()) print(ox.getUniModRecordId()) print(ox.getDiffMonoMass()) print(ox.getId()) print(ox.getFullId()) print(ox.getFullName()) print(ox.getDiffFormula())

timosachsenberg commented 1 year ago

I think this should work. If you can’t install pyopenms on Mac you can also test it in binder. You can launch an existing example page from they user guide in binder from the pyopenms readthedocs page. It has pyopenms installed. If it works you can edit the readthedocs page on GitHub and copy your code to it

KyowonJeong commented 1 year ago

I installed via conda and it works! But great tips! I will polish this and try to put documentation!

KyowonJeong commented 1 year ago

Updated document in Github.

timosachsenberg commented 1 year ago

Thanks Kyowon! One thing to consider for future contributions: can you please open a pull request (instead of pushing directly to the repository) so we can give it a quick review (check for typos etc.). The reason is that the tools used by readthedocs to generate the webpage are a bit picky and tiny errors can lead to failed generation of the doc.

KyowonJeong commented 1 year ago

OOPs by bad..

Sorry and I will do PR from the next one!

Best

Kyowon


보낸 사람: Timo Sachsenberg @.***> 보낸 날짜: 2023년 5월 15일 월요일 오전 9:21:41 받는 사람: OpenMS/pyopenms-docs 참조: KyowonJeong; Assign 제목: Re: [OpenMS/pyopenms-docs] Add how to get all modifications from ModificationsDB (Issue #288)

Thanks Kyowon! One thing to consider for future contributions: can you please open a pull request (instead of pushing directly to the repository) so we can give it a quick review (check for typos etc.). The reason is that the tools used by readthedocs to generate the webpage are a bit picky and tiny errors can lead to failed generation of the doc.

— Reply to this email directly, view it on GitHubhttps://github.com/OpenMS/pyopenms-docs/issues/288#issuecomment-1547320317, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AJEB3RM3IL5VKDVXH2RSTCTXGHKQLANCNFSM5ZIZQEWA. You are receiving this because you were assigned.Message ID: @.***>