diff --git a/AUTHORS b/AUTHORS index 60b031f3..22c845db 100644 --- a/AUTHORS +++ b/AUTHORS @@ -5,6 +5,7 @@ On Github ......... Vladimir Gorshkov [caetera] +Andrey Rozenberg [alephreish] On Bitbucket (before March 1, 2020) diff --git a/CHANGELOG b/CHANGELOG index e57385c8..ed01a701 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,7 +1,21 @@ -dev ---- +4.3.3 +----- + + - Add :py:func:`pyteomics.electrochem.gravy` (`#9 `_). + + - Fixes and improvements in :py:func:`pyteomics.pepxml.roc_curve` (`#10 `_). + + - Changes in guessing behavior of :py:func:`read` functions. + + In modules that implement :ref:`indexing parsers ` for non-XML formats (MGF, FASTA, PEFF, ms1/ms2), + when a parser is instantiated using :py:func:`read`, the parser class to instantiate is guessed + based on the mode of the file object passed to :py:func:`read` (text or binary). -Add :py:func:`pyteomics.electrochem.gravy` (`#9 `_). + With some file-like objects, mode cannot be easily deduced without consuming some of the data. + You will now see more warnings in case `use_index` is not explicitly passed to :py:func:`read` and reading mode is not obvious. + There will also be warnings if `use_index` is specified but the file is opened in the wrong mode. + To avoid all of this, youy are encouraged to instantiate parser classes directly, + or explicitly specify `use_index` to :py:func:`read` in all corner cases. 4.3.2 ----- diff --git a/VERSION b/VERSION index fe5438a2..e91d9be2 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.3.3dev1 +4.3.3 diff --git a/doc/source/data.rst b/doc/source/data.rst index 64ab1153..f6e6e229 100755 --- a/doc/source/data.rst +++ b/doc/source/data.rst @@ -6,16 +6,16 @@ The following section is dedicated to data manipulation. **Pyteomics** aims to support the most common formats of (LC-)MS/MS data, peptide identification results and protein databases. -.. include :: data/notes.rst +.. include :: data/notes.rst.inc .. contents:: Document contents :backlinks: top :depth: 3 -.. include :: data/text.rst +.. include :: data/text.rst.inc -.. include :: data/xml.rst +.. include :: data/xml.rst.inc -.. include :: data/indexing.rst +.. include :: data/indexing.rst.inc -.. include :: data/tda.rst +.. include :: data/tda.rst.inc diff --git a/doc/source/data/indexing.rst b/doc/source/data/indexing.rst.inc similarity index 100% rename from doc/source/data/indexing.rst rename to doc/source/data/indexing.rst.inc diff --git a/doc/source/data/notes.rst b/doc/source/data/notes.rst.inc similarity index 100% rename from doc/source/data/notes.rst rename to doc/source/data/notes.rst.inc diff --git a/doc/source/data/tda.rst b/doc/source/data/tda.rst.inc similarity index 100% rename from doc/source/data/tda.rst rename to doc/source/data/tda.rst.inc diff --git a/doc/source/data/text.rst b/doc/source/data/text.rst.inc similarity index 85% rename from doc/source/data/text.rst rename to doc/source/data/text.rst.inc index 81865de8..0971bf9b 100644 --- a/doc/source/data/text.rst +++ b/doc/source/data/text.rst.inc @@ -71,56 +71,56 @@ Class-based interface Since version 3.4.3, MGF parsing functionality is encapsulated in a class: :py:class:`pyteomics.mgf.MGF`. This class can be used for: - - sequential parsing of the file (the same as :py:func:`read`):: - - .. code-block:: python - - >>> with mgf.MGF('tests/test.mgf') as reader: - ..: for spectrum in reader: - ..: ... - - - accessing the file header (the same as :py:func:`read_header`):: - - .. code-block:: python - - >>> f = mgf.MGF('tests/test.mgf') - >>> f.header - {'charge': [2, 3], - 'com': 'Based on http://www.matrixscience.com/help/data_file_help.html', - 'it_mods': 'Oxidation (M)', - 'itol': '1', - 'itolu': 'Da', - 'mass': 'Monoisotopic', - 'mods': 'Carbamidomethyl (C)', - 'useremail': 'leu@altered-state.edu', - 'username': 'Lou Scene'} - - - direct access to spectra by title (the same as :py:func:`get_spectrum`):: - - .. code-block:: python - - >>> f = mgf.MGF('tests/test.mgf') - >>> f['Spectrum 2'] - {'charge array': masked_array(data = [3 2 1 1 1 1], - mask = False, - fill_value = 0), - 'intensity array': array([ 237., 128., 108., 1007., 974., 79.]), - 'm/z array': array([ 345.1, 370.2, 460.2, 1673.3, 1674. , 1675.3]), - 'params': {'charge': [2, 3], - 'com': 'Based on http://www.matrixscience.com/help/data_file_help.html', - 'it_mods': 'Oxidation (M)', - 'itol': '1', - 'itolu': 'Da', - 'mass': 'Monoisotopic', - 'mods': 'Carbamidomethyl (C)', - 'pepmass': (1084.9, 1234.0), - 'rtinseconds': '25', - 'scans': '3', - 'title': 'Spectrum 2', - 'useremail': 'leu@altered-state.edu', - 'username': 'Lou Scene'}} - -.. note :: + - sequential parsing of the file (the same as :py:func:`read`): + + .. code-block:: python + + >>> with mgf.MGF('tests/test.mgf') as reader: + ..: for spectrum in reader: + ..: ... + + - accessing the file header (the same as :py:func:`read_header`): + + .. code-block:: python + + >>> f = mgf.MGF('tests/test.mgf') + >>> f.header + {'charge': [2, 3], + 'com': 'Based on http://www.matrixscience.com/help/data_file_help.html', + 'it_mods': 'Oxidation (M)', + 'itol': '1', + 'itolu': 'Da', + 'mass': 'Monoisotopic', + 'mods': 'Carbamidomethyl (C)', + 'useremail': 'leu@altered-state.edu', + 'username': 'Lou Scene'} + + - direct access to spectra by title (the same as :py:func:`get_spectrum`): + + .. code-block:: python + + >>> f = mgf.MGF('tests/test.mgf') + >>> f['Spectrum 2'] + {'charge array': masked_array(data = [3 2 1 1 1 1], + mask = False, + fill_value = 0), + 'intensity array': array([ 237., 128., 108., 1007., 974., 79.]), + 'm/z array': array([ 345.1, 370.2, 460.2, 1673.3, 1674. , 1675.3]), + 'params': {'charge': [2, 3], + 'com': 'Based on http://www.matrixscience.com/help/data_file_help.html', + 'it_mods': 'Oxidation (M)', + 'itol': '1', + 'itolu': 'Da', + 'mass': 'Monoisotopic', + 'mods': 'Carbamidomethyl (C)', + 'pepmass': (1084.9, 1234.0), + 'rtinseconds': '25', + 'scans': '3', + 'title': 'Spectrum 2', + 'useremail': 'leu@altered-state.edu', + 'username': 'Lou Scene'}} + + .. note :: :py:class:`MGF`'s support for direct indexing is rudimentary, because it does not in fact keep an index and has to search through the file line-wise on every call. :py:class:`pyteomics.mgf.IndexedMGF` is designed for random access and more (see `Indexed Parsers`_ for details). diff --git a/doc/source/data/xml.rst b/doc/source/data/xml.rst.inc similarity index 99% rename from doc/source/data/xml.rst rename to doc/source/data/xml.rst.inc index cbfeb3d9..90150a7c 100644 --- a/doc/source/data/xml.rst +++ b/doc/source/data/xml.rst.inc @@ -340,7 +340,7 @@ idXML **idXML** is an OpenMS format for peptide identifications. It is supported in :py:mod:`pyteomics.openms.idxml`. It partially supports indexing (protein information can be indexed and extracted with `retrieve_refs`). -The regular iterative parsing is done through :py:func:`read` or :py:class:`IDXML`, and :py:class:`pandas.DataFrame`s +The regular iterative parsing is done through :py:func:`read` or :py:class:`IDXML`, and :py:class:`pandas.DataFrame` can be created as well. diff --git a/doc/source/intro.rst b/doc/source/intro.rst index 5882d9cb..b9d9f792 100755 --- a/doc/source/intro.rst +++ b/doc/source/intro.rst @@ -1,8 +1,8 @@ Introduction ============ -This tutorial covers the basic Pyteomics functionality. For more details, -please, check the API reference. You can also access the API docstrings from +This tutorial covers the basic Pyteomics functionality. For more details, +please, check the API reference. You can also access the API docstrings from Python shell: .. code-block:: python @@ -12,10 +12,12 @@ Python shell: IPython users can use the following shortcut: -.. code-block:: python +.. code-block:: + + In [1]: from pyteomics.mass import calculate_mass + + In [2]: calculate_mass? - >>> from pyteomics.mass import calculate_mass - >>> calculate_mass? -We expect the reader to be familiar with the basic Python syntax as well as +We expect the reader to be familiar with the basic Python syntax as well as proteomics concepts.