Skip to content

Commit

Permalink
Merge pull request #184 from compomics/feature/gzip
Browse files Browse the repository at this point in the history
support gzipped spectra files
  • Loading branch information
RalfG authored Nov 2, 2024
2 parents 71d42c3 + e97d5f6 commit ceda12e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
8 changes: 3 additions & 5 deletions ms2rescore/utils.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import logging
import os
import re
from glob import glob
from pathlib import Path
from typing import Optional, Union

from ms2rescore.exceptions import MS2RescoreConfigurationError
from ms2rescore_rs import is_supported_file_type

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -66,11 +66,9 @@ def infer_spectrum_path(
)

# Match with file extension if not in resolved_path yet
if not _is_minitdf(resolved_path) and not re.match(
r"\.mgf$|\.mzml$|\.d$", resolved_path, flags=re.IGNORECASE
):
if not is_supported_file_type(resolved_path) or not os.path.exists(resolved_path):
for filename in glob(resolved_path + "*"):
if re.match(r".*(\.mgf$|\.mzml$|\.d)", filename, flags=re.IGNORECASE):
if is_supported_file_type(filename):
resolved_path = filename
break
else:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ dependencies = [
"lxml>=4.5",
"mokapot>=0.10",
"ms2pip>=4.0.0",
"ms2rescore_rs>=0.3.0",
"ms2rescore_rs>=0.4.0",
"numpy>=1.25",
"pandas>=1",
"plotly>=5",
Expand Down

0 comments on commit ceda12e

Please sign in to comment.