Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 4 additions & 3 deletions massql/msql_fileloading.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
import numpy as np

from tqdm import tqdm
from matchms.importing import load_from_mgf
import pymzml
from pyteomics import mzxml, mzml, mgf
from pyteomics import mzxml, mzml

import logging
logger = logging.getLogger('msql_fileloading')
Expand Down Expand Up @@ -142,10 +143,10 @@ def load_data(input_filename, cache=None, cache_dir=None, cache_file=None):
return ms1_df, ms2_df

def _load_data_mgf(input_filename):
reader = mgf.read(input_filename)
file = load_from_mgf(input_filename)

ms2mz_list = []
for i, spectrum in reader:
for i, spectrum in enumerate(file):
if len(spectrum.peaks.mz) == 0:
continue

Expand Down
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
pymzml
lark>=1.0
pandas
pyarrow
tqdm
py_expression_eval
pymzml
matchms
pyteomics
psims
plotly
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,13 @@
],
packages=["massql"],
install_requires=[
"pymzml",
"lark-parser",
"pandas",
"pyarrow",
"tqdm",
"py_expression_eval",
"pymzml",
"matchms",
"pyteomics",
"psims",
"plotly",
Expand Down
3 changes: 1 addition & 2 deletions tests/test_file_loading.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,7 @@ def main():
#test_waters_load()
#test_cache_feather()
#test_nocache()
#test_cache_filename()
test_mgf_load()
test_cache_filename()


if __name__ == "__main__":
Expand Down
Loading