Skip to content

Commit ceda12e

Browse files
authored
Merge pull request #184 from compomics/feature/gzip
support gzipped spectra files
2 parents 71d42c3 + e97d5f6 commit ceda12e

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

ms2rescore/utils.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import logging
22
import os
3-
import re
43
from glob import glob
54
from pathlib import Path
65
from typing import Optional, Union
76

87
from ms2rescore.exceptions import MS2RescoreConfigurationError
8+
from ms2rescore_rs import is_supported_file_type
99

1010
logger = logging.getLogger(__name__)
1111

@@ -66,11 +66,9 @@ def infer_spectrum_path(
6666
)
6767

6868
# Match with file extension if not in resolved_path yet
69-
if not _is_minitdf(resolved_path) and not re.match(
70-
r"\.mgf$|\.mzml$|\.d$", resolved_path, flags=re.IGNORECASE
71-
):
69+
if not is_supported_file_type(resolved_path) or not os.path.exists(resolved_path):
7270
for filename in glob(resolved_path + "*"):
73-
if re.match(r".*(\.mgf$|\.mzml$|\.d)", filename, flags=re.IGNORECASE):
71+
if is_supported_file_type(filename):
7472
resolved_path = filename
7573
break
7674
else:

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ dependencies = [
4242
"lxml>=4.5",
4343
"mokapot>=0.10",
4444
"ms2pip>=4.0.0",
45-
"ms2rescore_rs>=0.3.0",
45+
"ms2rescore_rs>=0.4.0",
4646
"numpy>=1.25",
4747
"pandas>=1",
4848
"plotly>=5",

0 commit comments

Comments
 (0)