Metadata-Version: 2.4
Name: alpharaw
Version: 0.5.0
Summary: An open-source Python package to unify raw MS data access and storage.
Author-email: Mann Labs <jalew188@gmail.com>
License:                                  Apache License
                                   Version 2.0, January 2004
                                http://www.apache.org/licenses/
        
           TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
        
           1. Definitions.
        
              "License" shall mean the terms and conditions for use, reproduction,
              and distribution as defined by Sections 1 through 9 of this document.
        
              "Licensor" shall mean the copyright owner or entity authorized by
              the copyright owner that is granting the License.
        
              "Legal Entity" shall mean the union of the acting entity and all
              other entities that control, are controlled by, or are under common
              control with that entity. For the purposes of this definition,
              "control" means (i) the power, direct or indirect, to cause the
              direction or management of such entity, whether by contract or
              otherwise, or (ii) ownership of fifty percent (50%) or more of the
              outstanding shares, or (iii) beneficial ownership of such entity.
        
              "You" (or "Your") shall mean an individual or Legal Entity
              exercising permissions granted by this License.
        
              "Source" form shall mean the preferred form for making modifications,
              including but not limited to software source code, documentation
              source, and configuration files.
        
              "Object" form shall mean any form resulting from mechanical
              transformation or translation of a Source form, including but
              not limited to compiled object code, generated documentation,
              and conversions to other media types.
        
              "Work" shall mean the work of authorship, whether in Source or
              Object form, made available under the License, as indicated by a
              copyright notice that is included in or attached to the work
              (an example is provided in the Appendix below).
        
              "Derivative Works" shall mean any work, whether in Source or Object
              form, that is based on (or derived from) the Work and for which the
              editorial revisions, annotations, elaborations, or other modifications
              represent, as a whole, an original work of authorship. For the purposes
              of this License, Derivative Works shall not include works that remain
              separable from, or merely link (or bind by name) to the interfaces of,
              the Work and Derivative Works thereof.
        
              "Contribution" shall mean any work of authorship, including
              the original version of the Work and any modifications or additions
              to that Work or Derivative Works thereof, that is intentionally
              submitted to Licensor for inclusion in the Work by the copyright owner
              or by an individual or Legal Entity authorized to submit on behalf of
              the copyright owner. For the purposes of this definition, "submitted"
              means any form of electronic, verbal, or written communication sent
              to the Licensor or its representatives, including but not limited to
              communication on electronic mailing lists, source code control systems,
              and issue tracking systems that are managed by, or on behalf of, the
              Licensor for the purpose of discussing and improving the Work, but
              excluding communication that is conspicuously marked or otherwise
              designated in writing by the copyright owner as "Not a Contribution."
        
              "Contributor" shall mean Licensor and any individual or Legal Entity
              on behalf of whom a Contribution has been received by Licensor and
              subsequently incorporated within the Work.
        
           2. Grant of Copyright License. Subject to the terms and conditions of
              this License, each Contributor hereby grants to You a perpetual,
              worldwide, non-exclusive, no-charge, royalty-free, irrevocable
              copyright license to reproduce, prepare Derivative Works of,
              publicly display, publicly perform, sublicense, and distribute the
              Work and such Derivative Works in Source or Object form.
        
           3. Grant of Patent License. Subject to the terms and conditions of
              this License, each Contributor hereby grants to You a perpetual,
              worldwide, non-exclusive, no-charge, royalty-free, irrevocable
              (except as stated in this section) patent license to make, have made,
              use, offer to sell, sell, import, and otherwise transfer the Work,
              where such license applies only to those patent claims licensable
              by such Contributor that are necessarily infringed by their
              Contribution(s) alone or by combination of their Contribution(s)
              with the Work to which such Contribution(s) was submitted. If You
              institute patent litigation against any entity (including a
              cross-claim or counterclaim in a lawsuit) alleging that the Work
              or a Contribution incorporated within the Work constitutes direct
              or contributory patent infringement, then any patent licenses
              granted to You under this License for that Work shall terminate
              as of the date such litigation is filed.
        
           4. Redistribution. You may reproduce and distribute copies of the
              Work or Derivative Works thereof in any medium, with or without
              modifications, and in Source or Object form, provided that You
              meet the following conditions:
        
              (a) You must give any other recipients of the Work or
                  Derivative Works a copy of this License; and
        
              (b) You must cause any modified files to carry prominent notices
                  stating that You changed the files; and
        
              (c) You must retain, in the Source form of any Derivative Works
                  that You distribute, all copyright, patent, trademark, and
                  attribution notices from the Source form of the Work,
                  excluding those notices that do not pertain to any part of
                  the Derivative Works; and
        
              (d) If the Work includes a "NOTICE" text file as part of its
                  distribution, then any Derivative Works that You distribute must
                  include a readable copy of the attribution notices contained
                  within such NOTICE file, excluding those notices that do not
                  pertain to any part of the Derivative Works, in at least one
                  of the following places: within a NOTICE text file distributed
                  as part of the Derivative Works; within the Source form or
                  documentation, if provided along with the Derivative Works; or,
                  within a display generated by the Derivative Works, if and
                  wherever such third-party notices normally appear. The contents
                  of the NOTICE file are for informational purposes only and
                  do not modify the License. You may add Your own attribution
                  notices within Derivative Works that You distribute, alongside
                  or as an addendum to the NOTICE text from the Work, provided
                  that such additional attribution notices cannot be construed
                  as modifying the License.
        
              You may add Your own copyright statement to Your modifications and
              may provide additional or different license terms and conditions
              for use, reproduction, or distribution of Your modifications, or
              for any such Derivative Works as a whole, provided Your use,
              reproduction, and distribution of the Work otherwise complies with
              the conditions stated in this License.
        
           5. Submission of Contributions. Unless You explicitly state otherwise,
              any Contribution intentionally submitted for inclusion in the Work
              by You to the Licensor shall be under the terms and conditions of
              this License, without any additional terms or conditions.
              Notwithstanding the above, nothing herein shall supersede or modify
              the terms of any separate license agreement you may have executed
              with Licensor regarding such Contributions.
        
           6. Trademarks. This License does not grant permission to use the trade
              names, trademarks, service marks, or product names of the Licensor,
              except as required for reasonable and customary use in describing the
              origin of the Work and reproducing the content of the NOTICE file.
        
           7. Disclaimer of Warranty. Unless required by applicable law or
              agreed to in writing, Licensor provides the Work (and each
              Contributor provides its Contributions) on an "AS IS" BASIS,
              WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
              implied, including, without limitation, any warranties or conditions
              of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
              PARTICULAR PURPOSE. You are solely responsible for determining the
              appropriateness of using or redistributing the Work and assume any
              risks associated with Your exercise of permissions under this License.
        
           8. Limitation of Liability. In no event and under no legal theory,
              whether in tort (including negligence), contract, or otherwise,
              unless required by applicable law (such as deliberate and grossly
              negligent acts) or agreed to in writing, shall any Contributor be
              liable to You for damages, including any direct, indirect, special,
              incidental, or consequential damages of any character arising as a
              result of this License or out of the use or inability to use the
              Work (including but not limited to damages for loss of goodwill,
              work stoppage, computer failure or malfunction, or any and all
              other commercial damages or losses), even if such Contributor
              has been advised of the possibility of such damages.
        
           9. Accepting Warranty or Additional Liability. While redistributing
              the Work or Derivative Works thereof, You may choose to offer,
              and charge a fee for, acceptance of support, warranty, indemnity,
              or other liability obligations and/or rights consistent with this
              License. However, in accepting such obligations, You may act only
              on Your own behalf and on Your sole responsibility, not on behalf
              of any other Contributor, and only if You agree to indemnify,
              defend, and hold each Contributor harmless for any liability
              incurred by, or claims asserted against, such Contributor by reason
              of your accepting any such warranty or additional liability.
        
           END OF TERMS AND CONDITIONS
        
           APPENDIX: How to apply the Apache License to your work.
        
              To apply the Apache License to your work, attach the following
              boilerplate notice, with the fields enclosed by brackets "[]"
              replaced with your own identifying information. (Don't include
              the brackets!)  The text should be enclosed in the appropriate
              comment syntax for the file format. We also recommend that a
              file or class name and description of purpose be included on the
              same "printed page" as the copyright notice for easier
              identification within third-party archives.
        
           Copyright 2020 MannLabs
        
           Licensed under the Apache License, Version 2.0 (the "License");
           you may not use this file except in compliance with the License.
           You may obtain a copy of the License at
        
               http://www.apache.org/licenses/LICENSE-2.0
        
           Unless required by applicable law or agreed to in writing, software
           distributed under the License is distributed on an "AS IS" BASIS,
           WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
           See the License for the specific language governing permissions and
           limitations under the License.
        
Project-URL: Repository, https://github.com/MannLabs/alpharaw
Project-URL: Issues, https://github.com/MannLabs/alpharaw/issues
Project-URL: Mann Labs Homepage, https://www.biochem.mpg.de/mann
Keywords: mass spectrometry,proteomics,bioinformatics,mass spectrometry,raw data,data access,data storage,AlphaPept,AlphaPept ecosystem,AlphaX ecosystem
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE.txt
Requires-Dist: pywin32; sys_platform == "win32"
Requires-Dist: pythonnet
Requires-Dist: h5py
Requires-Dist: numba
Requires-Dist: pandas
Requires-Dist: numpy
Requires-Dist: pyteomics
Requires-Dist: lxml
Requires-Dist: owlready2
Requires-Dist: alphabase>=1.5.0
Requires-Dist: alphatims
Provides-Extra: stable
Requires-Dist: pywin32>=0.0.1; sys_platform == "win32" and extra == "stable"
Requires-Dist: pythonnet==3.0.3; extra == "stable"
Requires-Dist: h5py==3.11.0; extra == "stable"
Requires-Dist: numba==0.59.1; extra == "stable"
Requires-Dist: pandas==2.2.2; extra == "stable"
Requires-Dist: numpy==1.26.4; extra == "stable"
Requires-Dist: pyteomics==4.7.2; extra == "stable"
Requires-Dist: lxml==5.2.2; extra == "stable"
Requires-Dist: owlready2==0.48; extra == "stable"
Requires-Dist: alphabase>=1.5.0; extra == "stable"
Requires-Dist: alphatims>=0.0.1; extra == "stable"
Provides-Extra: viz
Requires-Dist: plotly; extra == "viz"
Provides-Extra: tests
Requires-Dist: matplotlib; extra == "tests"
Requires-Dist: seaborn; extra == "tests"
Requires-Dist: pytest; extra == "tests"
Requires-Dist: nbmake==1.5.3; extra == "tests"
Requires-Dist: requests; extra == "tests"
Requires-Dist: plotly; extra == "tests"
Provides-Extra: docs
Requires-Dist: autodocsumm; extra == "docs"
Requires-Dist: myst_parser; extra == "docs"
Requires-Dist: sphinx; extra == "docs"
Requires-Dist: nbsphinx; extra == "docs"
Requires-Dist: jinja2; extra == "docs"
Requires-Dist: contextfilter; extra == "docs"
Requires-Dist: furo; extra == "docs"
Provides-Extra: development
Requires-Dist: jupyter; extra == "development"
Requires-Dist: bump-my-version; extra == "development"
Requires-Dist: ipykernel; extra == "development"
Requires-Dist: pre-commit==3.7.0; extra == "development"
Requires-Dist: matplotlib; extra == "development"
Requires-Dist: seaborn; extra == "development"
Requires-Dist: pytest; extra == "development"
Requires-Dist: nbmake==1.5.3; extra == "development"
Requires-Dist: requests; extra == "development"
Requires-Dist: autodocsumm; extra == "development"
Requires-Dist: myst_parser; extra == "development"
Requires-Dist: sphinx; extra == "development"
Requires-Dist: nbsphinx; extra == "development"
Requires-Dist: jinja2; extra == "development"
Requires-Dist: contextfilter; extra == "development"
Requires-Dist: furo; extra == "development"
Dynamic: license-file

AlphaRaw
================

[![Default installation and tests](https://github.com/MannLabs/alpharaw/actions/workflows/pip_installation.yml/badge.svg)](https://github.com/MannLabs/alpharaw/actions/workflows/pip_installation.yml)
[![Publish on PyPi and release on GitHub](https://github.com/MannLabs/alpharaw/actions/workflows/publish_and_release.yml/badge.svg)](https://github.com/MannLabs/alpharaw/actions/workflows/publish_and_release.yml)
[![pypi](https://img.shields.io/pypi/v/alpharaw)](https://pypi.org/project/alpharaw)
[![pip downloads](https://img.shields.io/pypi/dm/alpharaw?color=blue&label=pip%20downloads)](https://pypi.org/project/alpharaw)
![Python](https://img.shields.io/pypi/pyversions/alpharaw)
[![Documentation Status](https://readthedocs.org/projects/alpharaw/badge/?version=latest)](https://alpharaw.readthedocs.io/en/latest/?badge=latest)

## About

An open-source Python package of the AlphaPept ecosystem from the [Mann
Labs at the Max Planck Institute of
Biochemistry](https://www.biochem.mpg.de/mann) to unify raw MS data
accession and storage. To enable all hyperlinks in this document, please
view it at [GitHub](https://github.com/MannLabs/alpharaw).

- [**About**](#about)
- [**License**](#license)
- [**Installation**](#installation)
  - [**Pip installer**](#pip)
  - [**Developer installer**](#developer)
- [**Usage**](#usage)
  - [**Python and jupyter notebooks**](#python-and-jupyter-notebooks)
- [**Troubleshooting**](#troubleshooting)
- [**Citations**](#citations)
- [**How to contribute**](#how-to-contribute)
- [**Changelog**](#changelog)

------------------------------------------------------------------------

## License

AlphaRaw was developed by the [Mann Labs at the Max Planck Institute of
Biochemistry](https://www.biochem.mpg.de/mann) and is freely available
with an [Apache License](LICENSE.txt). External Python packages
(available in the [requirements](requirements) folder) have their own
licenses, which can be consulted on their respective websites.

------------------------------------------------------------------------

## Installation

Pythonnet must be installed to access Thermo or Sciex raw data.

### For Windows

Pythonnet will be automatically installed via pip.

### For Linux / MacOS with Intel platform

1.  `conda install mono`.
2.  Install pythonnet with `pip install pythonnet`.

If `conda install mono` does not work, Mono can be installed from the [Mono
Website](https://www.mono-project.com/download/stable/#download-lin).
NOTE, the installed mono version should be at least 6.10, which
requires you to add the PPA to your trusted sources!

### For MacOS with silicon platform (M1/M2/M3)
Note that some command might required to use `sudo`.

1.  Install [brew](https://brew.sh).
2.  Install mono: `brew install mono`.
3.  If the pseudo mono folder `/Library/Frameworks/Mono.framework/Versions` does not exist, create it by running `sudo mkdir -p /Library/Frameworks/Mono.framework/Versions`.
4.  Link homebrew mono to pseudo mono folder: `sudo ln -s /opt/homebrew/Cellar/mono/6.12.0.182 /Library/Frameworks/Mono.framework/Versions/Current`. Here, `6.12.0.182` is the brew-installed mono version, please check your installed version. Navigate to `/Library/Frameworks/Mono.framework/Versions` and run `ls -l` to verify that the link `Current` points to `/opt/homebrew/Cellar/mono/6.12.0.182`. If `Current` points to a different installation and/or `/opt/homebrew/Cellar/mono/6.12.0.182` is referenced by a different link, delete the corresponding links and run `sudo ln -s /opt/homebrew/Cellar/mono/6.12.0.182 Current`.
5.  Install pythonnet: `pip install pythonnet`.

NOTE, Homebrew installs the most recent version of mono, which may give rise to the following error on the silicon platform
(which is due to an incompatible architecture for the files in the mono library):
```
RuntimeError: Failed to create a default .NET runtime, which would have been "mono" on this system. Either install a compatible runtime or configure it explicitly via `set_runtime` or the `PYTHONNET_*` environment variables (see set_runtime_from_env).
```

In this case, install mono version 6.12.0.182 from the [mono project](https://download.mono-project.com/archive/6.12.0/macos-10-universal/index.html)
or via `conda install mono=6.12.0.182 -c anaconda -y`. This version avoids the error.

### Installation types

AlphaRaw can be installed and used on all major operating systems
(Windows, macOS and Linux). There are three different types of
installation possible:

- [**Pip installation:**](#pip) Choose this installation if you want to use
  AlphaRaw as a Python package in an existing Python 3.8 environment
  (e.g. a Jupyter notebook).
- [**Developer installation:**](#developer) Choose this installation if you
  are familiar with CLI tools, [conda](https://docs.conda.io/en/latest/)
  and Python. This installation allows access to all available features
  of AlphaRaw and even allows to modify its source code directly.
  Generally, the developer version of AlphaRaw outperforms the
  precompiled versions which makes this the installation of choice for
  high-throughput experiments.

#### Pip installation

AlphaRaw can be installed in an existing Python 3.8 environment with a
single `bash` command. *This `bash` command can also be run directly
from within a Jupyter notebook by prepending it with a `!`*:

``` bash
pip install alpharaw
```

Installing AlphaRaw like this avoids conflicts when integrating it in
other tools, as this does not enforce strict versioning of dependencies.
However, if new versions of dependencies are released, they are not
guaranteed to be fully compatible with AlphaRaw. While this should only
occur in rare cases where dependencies are not backwards compatible, you
can always force AlphaRaw to use dependency versions which are known to
be compatible with:

``` bash
pip install "alpharaw[stable]"
```

NOTE: You might need to run `pip install pip --upgrade` before installing
AlphaRaw like this. Also note the double quotes `"`.

For those who are really adventurous, it is also possible to directly
install any branch (e.g. `@my_branch`) with any extras
(e.g. `#egg=alpharaw[stable,development]`) from GitHub with e.g.

``` bash
pip install "git+https://github.com/MannLabs/alpharaw.git@my_branch#egg=alpharaw[stable,development]"
```

#### Developer installation

AlphaRaw can also be installed in editable (i.e. developer) mode with a
few `bash` commands. This allows to fully customize the software and
even modify the source code to your specific needs. When an editable
Python package is installed, its source code is stored in a transparent
location of your choice. While optional, it is advised to first (create
and) navigate to e.g. a general software folder:

``` bash
mkdir ~/folder/where/to/install/software
cd ~/folder/where/to/install/software
```

Next, download the AlphaRaw repository from GitHub either directly or
with a `git` command. This creates a new AlphaRaw subfolder in your
current directory.

``` bash
git clone https://github.com/MannLabs/alpharaw.git
```

For any Python package, it is highly recommended to use a separate
[conda virtual environment](https://docs.conda.io/en/latest/), as
otherwise *dependency conflicts can occur with already existing
packages*.

``` bash
conda create --name alpharaw python=3.9 -y
conda activate alpharaw
```

Finally, AlphaRaw and all its [dependencies](requirements) need to be
installed. To take advantage of all features and allow development (with
the `-e` flag), this is best done by also installing the [development
dependencies](requirements/requirements_development.txt) instead of only
the [core dependencies](requirements/requirements.txt):

``` bash
pip install -e "./alpharaw[development]"
```

By default this installs loose dependencies (no explicit versioning),
although it is also possible to use stable dependencies
(e.g. `pip install -e "./alpharaw[stable,development]"`).

***By using the editable flag `-e`, all modifications to the [AlphaRaw
source code folder](alpharaw) are directly reflected when running
AlphaRaw. Note that the AlphaRaw folder cannot be moved and/or renamed
if an editable version is installed.***

------------------------------------------------------------------------

## Usage

- [**Python**](#python-and-jupyter-notebooks)

NOTE: The first time you use a fresh installation of AlphaRaw, it is
often quite slow because some functions might still need compilation on
your local operating system and architecture. Subsequent use should be a
lot faster.

### Python and Jupyter notebooks

AlphaRaw can be imported as a Python package into any Python script or
notebook with the command `import alpharaw`.

A brief [Jupyter notebook tutorial](nbs/tutorial.ipynb) on how to use
the API is also present in the [nbs folder](nbs).

------------------------------------------------------------------------

## Troubleshooting

In case of issues, check out the following:

- [Issues](https://github.com/MannLabs/alpharaw/issues): Try a few
  different search terms to find out if a similar problem has been
  encountered before
- [Discussions](https://github.com/MannLabs/alpharaw/discussions): Check
  if your problem or feature requests has been discussed before.

------------------------------------------------------------------------

## Citations

There are currently no plans to draft a manuscript.

------------------------------------------------------------------------

## How to contribute

If you like this software, you can give us a
[star](https://github.com/MannLabs/alpharaw/stargazers) to boost our
visibility! All direct contributions are also welcome. Feel free to post
a new [issue](https://github.com/MannLabs/alpharaw/issues) or clone the
repository and create a [pull
request](https://github.com/MannLabs/alpharaw/pulls) with a new branch.
For an even more interactive participation, check out the
[discussions](https://github.com/MannLabs/alpharaw/discussions) and the
[the Contributors License Agreement](misc/CLA.md).

### Notes for developers
#### Release a new version
This package uses a shared release process defined in the
[alphashared](https://github.com/MannLabs/alphashared) repository. Please see the instructions
[there](https://github.com/MannLabs/alphashared/blob/reusable-release-workflow/.github/workflows/README.md#release-a-new-version)


#### pre-commit hooks
It is highly recommended to use the provided pre-commit hooks, as the CI pipeline enforces all checks therein to
pass in order to merge a branch.

The hooks need to be installed once by
```bash
pre-commit install
```
You can run the checks yourself using:
```bash
pre-commit run --all-files
```
------------------------------------------------------------------------

## Changelog

See the [HISTORY.md](HISTORY.md) for a full overview of the changes made
in each version.
