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

Read and write idXML files using pyopenms #52

Merged
merged 23 commits into from
Oct 25, 2023
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"sphinx.ext.autodoc",
"sphinx.ext.autosectionlabel",
"sphinx.ext.autosummary",
"sphinx.ext.intersphinx",
"sphinx.ext.napoleon",
"sphinx_rtd_theme",
"sphinx_mdinclude",
Expand All @@ -40,6 +41,15 @@
autodoc_member_order = "bysource"
autoclass_content = "init"

# Intersphinx options
intersphinx_mapping = {
"python": ("https://docs.python.org/3", None),
"pandas": ("https://pandas.pydata.org/pandas-docs/stable/", None),
"numpy": ("https://numpy.org/doc/stable/", None),
"pyteomics": ("https://pyteomics.readthedocs.io/en/latest/", None),
"pyopenms": ("https://pyopenms.readthedocs.io/en/latest/", None),
}


def setup(app):
config = {
Expand Down
7 changes: 4 additions & 3 deletions online/pages/2_PSM_file_conversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,10 @@ def _convert(self):
st.success("PSM file successfully converted!")

# Construct output filename with new extension
output_filename = Path(
st.session_state["convert_input_file"].name
).stem + FILETYPES[st.session_state["convert_output_filetype"]]["extension"]
output_filename = (
Path(st.session_state["convert_input_file"].name).stem
+ FILETYPES[st.session_state["convert_output_filetype"]]["extension"]
)

# Open converted file in memory for download button
with open("output_filename", "rb") as file:
Expand Down
6 changes: 3 additions & 3 deletions psm_utils/io/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from rich.progress import track

import psm_utils.io.idxml as idxml
import psm_utils.io.ionbot as ionbot
import psm_utils.io.maxquant as maxquant
import psm_utils.io.msamanda as msamanda
import psm_utils.io.mzid as mzid
Expand All @@ -18,7 +19,6 @@
import psm_utils.io.sage as sage
import psm_utils.io.tsv as tsv
import psm_utils.io.xtandem as xtandem
import psm_utils.io.ionbot as ionbot
from psm_utils.io._base_classes import WriterBase
from psm_utils.io.exceptions import PSMUtilsIOException
from psm_utils.psm import PSM
Expand All @@ -27,7 +27,7 @@
FILETYPES = {
"idxml": {
"reader": idxml.IdXMLReader,
"writer": None,
"writer": idxml.IdXMLWriter,
"extension": ".idXML",
"filename_pattern": r"^.*\.idxml$",
},
Expand Down Expand Up @@ -120,7 +120,7 @@ def _supports_write_psm(writer: WriterBase):
supports_write_psm = True
else:
supports_write_psm = True
Path(temp_file.name).unlink()
Path(temp_file.name).unlink()
return supports_write_psm


Expand Down
1 change: 1 addition & 0 deletions psm_utils/io/_pd_msf_tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
UniqueConstraint,
text,
)

try:
from sqlalchemy.orm import declarative_base
except ImportError:
Expand Down
Loading
Loading