levitsky / pyteomics

Pyteomics is a collection of lightweight and handy tools for Python that help to handle various sorts of proteomics data. Pyteomics provides a growing set of modules to facilitate the most common tasks in proteomics data analysis.
http://pyteomics.readthedocs.io
Apache License 2.0
105 stars 34 forks source link

mgf.read ignores `use_index` if source is str (4.3.3) #16

Closed lars-kolbowski closed 3 years ago

lars-kolbowski commented 3 years ago

Hi, just noticed that a test I had failed when upgrading from 4.3.2 to 4.3.3. When passing use_index=False to mgf.read() with a str filepath the aux._check_use_index() overwrites this back to True. So one always ends up with an IndexedMGF when passing a str filepath and it's no longer possible to create an MGF object. Was wondering if this is an intended change. Thank you!

levitsky commented 3 years ago

Hi, thanks for the heads-up. This was definitely not intentional. I will investigate. As a workaround, you can use MGF(...) instead of read(...).