Skip to content

Commit

Permalink
Merge pull request #52 from jonasscheid/feature_write-idxml
Browse files Browse the repository at this point in the history
Read and write idXML files using pyopenms
  • Loading branch information
RalfG authored Oct 25, 2023
2 parents e7f0bfb + cdeefdf commit 483f304
Show file tree
Hide file tree
Showing 18 changed files with 987 additions and 65 deletions.
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
4 changes: 2 additions & 2 deletions psm_utils/io/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
FILETYPES = {
"idxml": {
"reader": idxml.IdXMLReader,
"writer": None,
"writer": idxml.IdXMLWriter,
"extension": ".idXML",
"filename_pattern": r"^.*\.idxml$",
},
Expand Down Expand Up @@ -127,7 +127,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

0 comments on commit 483f304

Please sign in to comment.