maspim


Namemaspim JSON
Version 1.1.0 PyPI version JSON
download
home_pagehttps://github.com/yaza11/maspim
SummaryProcessing of mass spectrometry imaging and micro X-Ray fluorescence data.
upload_time2024-08-26 09:37:42
maintainerNone
docs_urlNone
authorYannick Zander
requires_pythonNone
licenseNone
keywords python mass spectrometry imaging bruker mcf maldi laminated lamination image registration
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
# Mass Spectrometry Imaging Workflow (`maspim`)

`maspim` is a python package that allows users to read, process and interpret mass spectrometry imaging (MSI) data from Bruker instruments.

This package implements methods to process mass spectra, combine them with image information or other measurements (such as micro X-Ray fluorescence, µXRF) and special functionality for laminated sediments to combine spectra in the same layers.

## Prerequisites

Before you begin, ensure you have met the following requirements:
<!--- These are just example requirements. Add, duplicate or remove as required --->

* You have a version of `python3` installed (preferentially the up-to-date version)
* You have `R` installed
* You have the `R` package `rtms` installed

You may also want to check out [msiAlign](https://github.com/weimin-liu/msiAlign), which is not directly a prerequisite, but useful for setting the punch-holes when the automatic detection fails and [msi_feature_extraction](https://github.com/weimin-liu/msi_feature_extraction) if you want to work with exported txt files from DataAnalysis.

## Installing `maspim`

`maspim` is now on [PyPI](https://pypi.org/project/maspim/). 
```bash
pip install maspim
```

Also, checkout our [github page](https://github.com/yaza11/maspim) for the up-to-date version and additional resources.

To get the freshest version, run

```bash
pip install git+https://github.com/yaza11/maspim.git
```

in your console (assuming you have pip installed).

## Using `maspim`

This is just a quick overview. For more comprehensive tutorials please have a look at the Notebooks.

Generally it is advised to stick to the objects provided at the top level of `maspim`, which are

* `ProjectMSI` and `ProjectXRF` to manage MSI and µXRF measurements respectively and fetched with the `get_project` function
* `ImageSample`, `ImageROI` and `ImageClassified` to set photo properties and finding the sample area
* `Transformation` to register images
* `ReadBrukerMCF` and `hdf5handler` for reading and storing data files.
* `Spectra` to extract intensities from the mass spectra
* `MSI` and `XRF` for handling MSI and µXRF measurements.
* `XRay` for adding information from an X-Ray
* `AgeModel` to set an age model
and a few others. `ProjectMSI` and `ProjectXRF` are the core objects of this package, which manage most of the aforementioned objects. So unless you have a very specific application in mind, it is recommended to do everything with the methods provided by `ProjectMSI` and `ProjectXRF`.

Let's look at a short example of how to define the ${U\_{37}^{k}}^\\prime$ proxy, which you can use to check that your installation worked.
```python
from maspim import get_project
from maspim.res.compound_masses import mC37_2, mC37_3

p = get_project(is_MSI=True, path_folder='path/to/your/measurement.i', is_laminated=False)
# sets or loads ImageHandler, ImageSample, ImageROI and ImageClassified
p.require_images()
# perform all steps to extract intensities from alkenones
p.set_spectra(targets=[mC37_2, mC37_3], suppress_warnings=True)
p.set_data_object()
p.add_pixels_ROI()
# we did not provide any ages, so a time series does not make much sense, but 
# this is just a test, so don't try to interpret the results
p.set_time_series(average_by_col='x', is_continuous=True)
p.set_UK37(method_SST='prahl', n_successes_required=0)
# we can use the index instead of the age for now
p.uk37_proxy.feature_table.loc[:, 'age'] = p.uk37_proxy.feature_table.x
# you should see a plot after this
p.uk37_proxy.plot_comp('SST', errors=False)
```

## Contributing to `maspim`

If you find any bugs or missing features, you are welcome to contribute to `maspim`, just follow these steps:

1. Fork this repository.
2. Create a branch: `git checkout -b <branch_name>`.
3. Make your changes and commit them: `git commit -m '<commit_message>'`
4. Push to the original branch: `git push origin <project_name>/<location>`
5. Create the pull request.

Alternatively see the GitHub documentation on [creating a pull request](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request).

## Contributors

Thanks to [@weimin-liu](https://github.com/weimin-liu) who has contributed to this project.

## Contact

Feel free to reach out at me via [yzander@marum.de](mailto:yzander@marum.de).

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/yaza11/maspim",
    "name": "maspim",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "python, mass spectrometry imaging, bruker, mcf, MALDI, laminated, lamination, image registration",
    "author": "Yannick Zander",
    "author_email": "yzander@marum.de",
    "download_url": "https://files.pythonhosted.org/packages/8e/c4/4350284e30fd807f02b5bbc031095d54c955fe371396879216bd0a8ddc88/maspim-1.1.0.tar.gz",
    "platform": null,
    "description": "\r\n# Mass Spectrometry Imaging Workflow (`maspim`)\r\n\r\n`maspim` is a python package that allows users to read, process and interpret mass spectrometry imaging (MSI) data from Bruker instruments.\r\n\r\nThis package implements methods to process mass spectra, combine them with image information or other measurements (such as micro X-Ray fluorescence, \u00b5XRF) and special functionality for laminated sediments to combine spectra in the same layers.\r\n\r\n## Prerequisites\r\n\r\nBefore you begin, ensure you have met the following requirements:\r\n<!--- These are just example requirements. Add, duplicate or remove as required --->\r\n\r\n* You have a version of `python3` installed (preferentially the up-to-date version)\r\n* You have `R` installed\r\n* You have the `R` package `rtms` installed\r\n\r\nYou may also want to check out [msiAlign](https://github.com/weimin-liu/msiAlign), which is not directly a prerequisite, but useful for setting the punch-holes when the automatic detection fails and [msi_feature_extraction](https://github.com/weimin-liu/msi_feature_extraction) if you want to work with exported txt files from DataAnalysis.\r\n\r\n## Installing `maspim`\r\n\r\n`maspim` is now on [PyPI](https://pypi.org/project/maspim/). \r\n```bash\r\npip install maspim\r\n```\r\n\r\nAlso, checkout our [github page](https://github.com/yaza11/maspim) for the up-to-date version and additional resources.\r\n\r\nTo get the freshest version, run\r\n\r\n```bash\r\npip install git+https://github.com/yaza11/maspim.git\r\n```\r\n\r\nin your console (assuming you have pip installed).\r\n\r\n## Using `maspim`\r\n\r\nThis is just a quick overview. For more comprehensive tutorials please have a look at the Notebooks.\r\n\r\nGenerally it is advised to stick to the objects provided at the top level of `maspim`, which are\r\n\r\n* `ProjectMSI` and `ProjectXRF` to manage MSI and \u00b5XRF measurements respectively and fetched with the `get_project` function\r\n* `ImageSample`, `ImageROI` and `ImageClassified` to set photo properties and finding the sample area\r\n* `Transformation` to register images\r\n* `ReadBrukerMCF` and `hdf5handler` for reading and storing data files.\r\n* `Spectra` to extract intensities from the mass spectra\r\n* `MSI` and `XRF` for handling MSI and \u00b5XRF measurements.\r\n* `XRay` for adding information from an X-Ray\r\n* `AgeModel` to set an age model\r\nand a few others. `ProjectMSI` and `ProjectXRF` are the core objects of this package, which manage most of the aforementioned objects. So unless you have a very specific application in mind, it is recommended to do everything with the methods provided by `ProjectMSI` and `ProjectXRF`.\r\n\r\nLet's look at a short example of how to define the ${U\\_{37}^{k}}^\\\\prime$ proxy, which you can use to check that your installation worked.\r\n```python\r\nfrom maspim import get_project\r\nfrom maspim.res.compound_masses import mC37_2, mC37_3\r\n\r\np = get_project(is_MSI=True, path_folder='path/to/your/measurement.i', is_laminated=False)\r\n# sets or loads ImageHandler, ImageSample, ImageROI and ImageClassified\r\np.require_images()\r\n# perform all steps to extract intensities from alkenones\r\np.set_spectra(targets=[mC37_2, mC37_3], suppress_warnings=True)\r\np.set_data_object()\r\np.add_pixels_ROI()\r\n# we did not provide any ages, so a time series does not make much sense, but \r\n# this is just a test, so don't try to interpret the results\r\np.set_time_series(average_by_col='x', is_continuous=True)\r\np.set_UK37(method_SST='prahl', n_successes_required=0)\r\n# we can use the index instead of the age for now\r\np.uk37_proxy.feature_table.loc[:, 'age'] = p.uk37_proxy.feature_table.x\r\n# you should see a plot after this\r\np.uk37_proxy.plot_comp('SST', errors=False)\r\n```\r\n\r\n## Contributing to `maspim`\r\n\r\nIf you find any bugs or missing features, you are welcome to contribute to `maspim`, just follow these steps:\r\n\r\n1. Fork this repository.\r\n2. Create a branch: `git checkout -b <branch_name>`.\r\n3. Make your changes and commit them: `git commit -m '<commit_message>'`\r\n4. Push to the original branch: `git push origin <project_name>/<location>`\r\n5. Create the pull request.\r\n\r\nAlternatively see the GitHub documentation on [creating a pull request](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request).\r\n\r\n## Contributors\r\n\r\nThanks to [@weimin-liu](https://github.com/weimin-liu) who has contributed to this project.\r\n\r\n## Contact\r\n\r\nFeel free to reach out at me via [yzander@marum.de](mailto:yzander@marum.de).\r\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Processing of mass spectrometry imaging and micro X-Ray fluorescence data.",
    "version": "1.1.0",
    "project_urls": {
        "Homepage": "https://github.com/yaza11/maspim"
    },
    "split_keywords": [
        "python",
        " mass spectrometry imaging",
        " bruker",
        " mcf",
        " maldi",
        " laminated",
        " lamination",
        " image registration"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "13b6ff82e61e645e5e5040c26a4dfbf1b1d3351aea00a9e6fe5cbf519b0e68cf",
                "md5": "10bd41910753d4dd2fd39f51b8ffec33",
                "sha256": "a8c524439fcf097c0f2897a1bbcf0cc9b200ec331c6f3094aafed801a2ae83cb"
            },
            "downloads": -1,
            "filename": "maspim-1.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "10bd41910753d4dd2fd39f51b8ffec33",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 273080,
            "upload_time": "2024-08-26T09:37:41",
            "upload_time_iso_8601": "2024-08-26T09:37:41.310194Z",
            "url": "https://files.pythonhosted.org/packages/13/b6/ff82e61e645e5e5040c26a4dfbf1b1d3351aea00a9e6fe5cbf519b0e68cf/maspim-1.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8ec44350284e30fd807f02b5bbc031095d54c955fe371396879216bd0a8ddc88",
                "md5": "4c41b8b81dec418b6295bd63a315e4fe",
                "sha256": "9600db4d4b58a6424bac6cca7bfcbe0891f528921fdf22641e7859a139a9a3a7"
            },
            "downloads": -1,
            "filename": "maspim-1.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "4c41b8b81dec418b6295bd63a315e4fe",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 243020,
            "upload_time": "2024-08-26T09:37:42",
            "upload_time_iso_8601": "2024-08-26T09:37:42.710847Z",
            "url": "https://files.pythonhosted.org/packages/8e/c4/4350284e30fd807f02b5bbc031095d54c955fe371396879216bd0a8ddc88/maspim-1.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-26 09:37:42",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "yaza11",
    "github_project": "maspim",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "maspim"
}
        
Elapsed time: 0.32067s