{ "info": { "author": "Charles H. Camp Jr.", "author_email": "charles.camp@nist.gov", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "Intended Audience :: Science/Research", "Operating System :: OS Independent", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3 :: Only", "Topic :: Scientific/Engineering :: Bio-Informatics", "Topic :: Scientific/Engineering :: Chemistry", "Topic :: Scientific/Engineering :: Information Analysis", "Topic :: Scientific/Engineering :: Mathematics", "Topic :: Scientific/Engineering :: Physics" ], "description": ".. -*- mode: rst -*-\n\n.. image:: https://travis-ci.com/CCampJr/pyMCR.svg?branch=master\n :alt: Travis CI Status\n :target: https://travis-ci.com/CCampJr/pyMCR\n\n.. image:: https://ci.appveyor.com/api/projects/status/ajld1bj7jo4oweio/branch/master?svg=true\n :alt: AppVeyor CI Status\n :target: https://ci.appveyor.com/project/CCampJr/pyMCR\n\n.. image:: https://codecov.io/gh/CCampJr/pyMCR/branch/master/graph/badge.svg\n :alt: Codecov\n :target: https://codecov.io/gh/CCampJr/pyMCR\n\n.. image:: https://img.shields.io/pypi/pyversions/pyMCR.svg\n :alt: PyPI - Python Version\n :target: https://pypi.org/project/pyMCR/\n\n.. image:: https://img.shields.io/pypi/v/pyMCR.svg\n :alt: PyPI Project Page\n :target: https://pypi.org/project/pyMCR/\n\n.. image:: https://anaconda.org/conda-forge/pymcr/badges/version.svg\n :alt: Anaconda Cloud\n :target: https://anaconda.org/conda-forge/pymcr\n\n.. image:: https://img.shields.io/badge/License-NIST%20Public%20Domain-green.svg\n :alt: NIST Public Domain\n :target: https://github.com/usnistgov/pyMCR/blob/master/LICENSE.md\n\npyMCR: Multivariate Curve Resolution in Python\n===============================================================\n\nDocumentation available online at https://pages.nist.gov/pyMCR\n\nSoftware DOI: https://doi.org/10.18434/M32064\n\nManuscript DOI: https://doi.org/10.6028/jres.124.018\n\npyMCR is a small package for performing multivariate curve resolution.\nCurrently, it implements a simple alternating regression scheme (MCR-AR). The most common\nimplementation is with ordinary least-squares regression, MCR-ALS.\n\nMCR with non-negativity constraints on both matrices is the same as non-negative matrix factorization (NMF). Historically,\nother names were used for MCR as well:\n\n- Self modeling mixture analysis (SMMA)\n- Self modeling curve resolution (SMCR)\n\nAvailable methods:\n\n- Regressors:\n\n - `Ordinary least squares `_ (default)\n - `Non-negatively constrained least squares \n `_\n - Native support for `scikit-learn linear model regressors \n `_\n (e.g., `LinearRegression `_, \n `RidgeRegression `_, \n `Lasso `_)\n\n- Constraints\n\n - Non-negativity\n - Normalization\n - Zero end-points\n - Zero (approx) end-points of cumulative summation (can specify nodes as well)\n - Non-negativity of cumulative summation\n - Compress or cut values above or below a threshold value\n - Replace sum-across-features samples (e.g., 0 concentration) with prescribed target\n - Enforce a plane (\"planarize\"). E.g., a concentration image is a plane.\n\n- Error metrics / Loss function\n\n - Mean-squared error\n\n- Other options\n\n - Fix known targets (C and/or ST, and let others vary)\n\nWhat it **does** do:\n\n- Approximate the concentration and spectral matrices via minimization routines. \n This is the core the MCR methods.\n- Enable the application of certain constraints in a user-defined order.\n\nWhat it **does not** do:\n\n- Estimate the number of components in the sample. This is a bonus feature in \n some more-advanced MCR-ALS packages.\n\n - In MATLAB: https://mcrals.wordpress.com/\n - In R: https://cran.r-project.org/web/packages/ALS/index.html\n\nDependencies\n------------\n\n**Note**: These are the developmental system specs. Older versions of certain\npackages may work.\n\n- python >= 3.4\n \n - Tested with 3.4.6, 3.5.4, 3.6.3, 3.6.5, 3.7.1\n\n- numpy (1.9.3)\n \n - Tested with 1.12.1, 1.13.1, 1.13.3, 1.14.3, 1.14.6\n\n- scipy (1.0.0)\n\n - Tested with 1.0.0, 1.0.1, 1.1.0\n\n- scikit-learn, optional (0.2.0)\n\nKnown Issues\n------------\n\n\nInstallation\n------------\n\nUsing pip (hard install)\n~~~~~~~~~~~~~~~~~~~~~~~~\n\n.. code::\n\n # Only Python 3.* installed\n pip install pyMCR\n\n # If you have both Python 2.* and 3.* you may need\n pip3 install pyMCR\n\nUsing pip (soft install [can update with git])\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n.. code::\n \n # Make new directory for pyMCR and enter it\n # Clone from github\n git clone https://github.com/usnistgov/pyMCR\n\n # Only Python 3.* installed\n pip install -e .\n\n # If you have both Python 2.* and 3.* you may need instead\n pip3 install -e .\n\n # To update in the future\n git pull\n\nUsing setuptools\n~~~~~~~~~~~~~~~~\n\nYou will need to `download the repository `_\nor clone the repository with git:\n\n.. code::\n \n # Make new directory for pyMCR and enter it\n # Clone from github\n git clone https://github.com/usnistgov/pyMCR\n\nPerform the install:\n\n.. code::\n\n python setup.py install\n\nLogging\n--------\n\n**New in pyMCR 0.3.1**, Python's native logging module is now used to capture messages. Though this is not as \nconvenient as print() statements, it has many advantages.\n\n- Logging module docs: https://docs.python.org/3.7/library/logging.html\n- Logging tutorial: https://docs.python.org/3.7/howto/logging.html#logging-basic-tutorial\n- Logging cookbook: https://docs.python.org/3.7/howto/logging-cookbook.html#logging-cookbook\n\nA simple example that prints simplified logging messages to the stdout (command line):\n\n.. code:: python\n\n import sys\n import logging\n \n # Need to import pymcr or mcr prior to setting up the logger\n from pymcr.mcr import McrAR\n\n logger = logging.getLogger('pymcr')\n logger.setLevel(logging.DEBUG)\n\n # StdOut is a \"stream\"; thus, StreamHandler\n stdout_handler = logging.StreamHandler(stream=sys.stdout)\n\n # Set the message format. Simple and removing log level or date info\n stdout_format = logging.Formatter('%(message)s') # Just a basic message akin to print statements\n stdout_handler.setFormatter(stdout_format)\n\n logger.addHandler(stdout_handler)\n\n # Begin your code for pyMCR below\n \n\nUsage\n-----\n\n.. code:: python\n\n from pymcr.mcr import McrAR\n mcrar = McrAR()\n \n # MCR assumes a system of the form: D = CS^T\n #\n # Data that you will provide (hyperspectral context):\n # D [n_pixels, n_frequencies] # Hyperspectral image unraveled in space (2D)\n #\n # initial_spectra [n_components, n_frequencies] ## S^T in the literature\n # OR\n # initial_conc [n_pixels, n_components] ## C in the literature\n\n # If you have an initial estimate of the spectra\n mcrar.fit(D, ST=initial_spectra)\n\n # Otherwise, if you have an initial estimate of the concentrations\n mcrar.fit(D, C=initial_conc)\n\nExample Results\n---------------\n\nCommand line and Jupyter notebook examples are provided in the ``Examples/`` folder. Examples of instantiating\nthe McrAR class with different regressors available in the `documentation `_ .\n\nFrom ``Examples/Demo.ipynb``:\n\n.. image:: ./Examples/mcr_spectra_retr.png\n\n.. image:: ./Examples/mcr_conc_retr.png\n\n\nCiting this Software\n--------------------\n\nIf you use *pyMCR*, citing the following article is much appreciated:\n\n- `C. H. Camp Jr., \"pyMCR: A Python Library for MultivariateCurve Resolution Analysis with Alternating Regression (MCR-AR)\", 124, 1-10 (2019).\n `_.\n\n\nReferences\n----------\n\n- `W. H. Lawton and E. A. Sylvestre, \"Self Modeling Curve Resolution\", \n Technometrics 13, 617\u2013633 (1971). `_\n- https://mcrals.wordpress.com/theory/\n- `J. Jaumot, R. Gargallo, A. de Juan, and R. Tauler, \"A graphical user-friendly \n interface for MCR-ALS: a new tool for multivariate curve resolution in\n MATLAB\", Chemometrics and Intelligent Laboratory Systems 76, 101-110 \n (2005). `_\n- `J. Felten, H. Hall, J. Jaumot, R. Tauler, A. de Juan, and A. Gorzs\u00e1s, \n \"Vibrational spectroscopic image analysis of biological material using \n multivariate curve resolution\u2013alternating least squares (MCR-ALS)\", Nature Protocols \n 10, 217-240 (2015). `_\n \n\nLICENSE\n----------\nThis software was developed by employees of the National Institute of Standards \nand Technology (NIST), an agency of the Federal Government. Pursuant to \n`title 17 United States Code Section 105 `_, \nworks of NIST employees are not subject to copyright protection in the United States and are \nconsidered to be in the public domain. Permission to freely use, copy, modify, \nand distribute this software and its documentation without fee is hereby granted, \nprovided that this notice and disclaimer of warranty appears in all copies.\n\nTHE SOFTWARE IS PROVIDED 'AS IS' WITHOUT ANY WARRANTY OF ANY KIND, EITHER \nEXPRESSED, IMPLIED, OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, ANY WARRANTY \nTHAT THE SOFTWARE WILL CONFORM TO SPECIFICATIONS, ANY IMPLIED WARRANTIES OF \nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND FREEDOM FROM INFRINGEMENT, \nAND ANY WARRANTY THAT THE DOCUMENTATION WILL CONFORM TO THE SOFTWARE, OR ANY \nWARRANTY THAT THE SOFTWARE WILL BE ERROR FREE. IN NO EVENT SHALL NIST BE LIABLE \nFOR ANY DAMAGES, INCLUDING, BUT NOT LIMITED TO, DIRECT, INDIRECT, SPECIAL OR \nCONSEQUENTIAL DAMAGES, ARISING OUT OF, RESULTING FROM, OR IN ANY WAY CONNECTED \nWITH THIS SOFTWARE, WHETHER OR NOT BASED UPON WARRANTY, CONTRACT, TORT, OR \nOTHERWISE, WHETHER OR NOT INJURY WAS SUSTAINED BY PERSONS OR PROPERTY OR \nOTHERWISE, AND WHETHER OR NOT LOSS WAS SUSTAINED FROM, OR AROSE OUT OF THE \nRESULTS OF, OR USE OF, THE SOFTWARE OR SERVICES PROVIDED HEREUNDER.\n\nContact\n-------\nCharles H Camp Jr: `charles.camp@nist.gov `_\n\nContributors\n-------------\n\n- Charles H Camp Jr\n- Charles Le Losq (charles.lelosq@anu.edu.au)\n- Robert Kern (rkern@enthought.com)\n- Joshua Taillon (joshua.taillon@nist.gov)", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/usnistgov/pyMCR", "keywords": "", "license": "Public Domain", "maintainer": "", "maintainer_email": "", "name": "pyMCR", "package_url": "https://pypi.org/project/pyMCR/", "platform": "", "project_url": "https://pypi.org/project/pyMCR/", "project_urls": { "Homepage": "https://github.com/usnistgov/pyMCR" }, "release_url": "https://pypi.org/project/pyMCR/0.3.2/", "requires_dist": null, "requires_python": "", "summary": "Multivariate Curve Resolution in Python", "version": "0.3.2" }, "last_serial": 5446837, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "457009a047a2b1d43a5cab3d66cc804d", "sha256": "59490595196756920ebec287e7e29142f5b6b69697e17b53ee69326b23360da8" }, "downloads": -1, "filename": "pyMCR-0.1.0.tar.gz", "has_sig": false, "md5_digest": "457009a047a2b1d43a5cab3d66cc804d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12039, "upload_time": "2017-12-15T22:43:32", "url": "https://files.pythonhosted.org/packages/fb/26/7247557e74fc6410c2202c0ee9c9abd2fb5f5dd7b6f68b8d3a63ebbf8473/pyMCR-0.1.0.tar.gz" } ], "0.1.0rc0": [ { "comment_text": "", "digests": { "md5": "4662be371ebf472ecc12bc00a8380cf7", "sha256": "7c1d9bbffe3add8975eadd98840ddb205d0958eea2417fa1763ced7230a2bc0d" }, "downloads": -1, "filename": "pyMCR-0.1.0rc0.tar.gz", "has_sig": false, "md5_digest": "4662be371ebf472ecc12bc00a8380cf7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12047, "upload_time": "2017-12-15T22:05:30", "url": "https://files.pythonhosted.org/packages/74/52/505d461bbcfdbbaa027b686eb964c43d79ba4cfa567e77cba61de54ec4fa/pyMCR-0.1.0rc0.tar.gz" } ], "0.1.0rc1": [ { "comment_text": "", "digests": { "md5": "374b233dc9d59004bd0bbe999ae668c1", "sha256": "b1c01053047a0c20ce0a4692a36473fd32d3d3fff67839e81ab61373c3f66ca5" }, "downloads": -1, "filename": "pyMCR-0.1.0rc1.tar.gz", "has_sig": false, "md5_digest": "374b233dc9d59004bd0bbe999ae668c1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12035, "upload_time": "2017-12-15T22:24:47", "url": "https://files.pythonhosted.org/packages/25/43/cb272b27186e2b59d15a955668abb7a541e96ab6d62fe8ddafc88ffc00b8/pyMCR-0.1.0rc1.tar.gz" } ], "0.1.1a0": [ { "comment_text": "", "digests": { "md5": "18b8ee2b5ed936679cbb985df0cf7bd5", "sha256": "5983005042cafc55f0e334c42f693f3d2b6e398e0e598b45ed23d04114e4eb5e" }, "downloads": -1, "filename": "pyMCR-0.1.1a0.tar.gz", "has_sig": false, "md5_digest": "18b8ee2b5ed936679cbb985df0cf7bd5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12091, "upload_time": "2017-12-19T04:34:07", "url": "https://files.pythonhosted.org/packages/81/59/965f3df036b1c0d52ff52ffa402559d20930bae9fcafe2fe4cdca53e89b9/pyMCR-0.1.1a0.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "ce2a80d6391b3ae7c3eba3bc9c80f5e1", "sha256": "28fb807a932d30a150f9a6a51e191757ab7efdf6e440d9502a1aac97cb102319" }, "downloads": -1, "filename": "pyMCR-0.2.0.tar.gz", "has_sig": false, "md5_digest": "ce2a80d6391b3ae7c3eba3bc9c80f5e1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 551578, "upload_time": "2018-05-03T03:01:27", "url": "https://files.pythonhosted.org/packages/49/24/5b73902b67d1a8331faa79ad816e24ca8848cb995cfd3c99a6b4feecd62a/pyMCR-0.2.0.tar.gz" } ], "0.2.0rc0": [ { "comment_text": "", "digests": { "md5": "44591fc971491b6ad34313136ec7cd08", "sha256": "3c4ceece28f21d7b1760dd814bd5d8d9675bdef695533b67a2e874f3836f666a" }, "downloads": -1, "filename": "pyMCR-0.2.0rc0.tar.gz", "has_sig": false, "md5_digest": "44591fc971491b6ad34313136ec7cd08", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 961221, "upload_time": "2018-05-02T22:38:24", "url": "https://files.pythonhosted.org/packages/72/bd/193e247a5a313514d21f9e60f0146382f11ab58dd4317e88ab1a7af550c8/pyMCR-0.2.0rc0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "0a24211e41b5a087545fa5aefc07c04d", "sha256": "dfe66bbad218276ed229813d9f769a55643333cc81ad9882ad00e259bc021e5e" }, "downloads": -1, "filename": "pyMCR-0.2.1.tar.gz", "has_sig": false, "md5_digest": "0a24211e41b5a087545fa5aefc07c04d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 513153, "upload_time": "2018-05-16T16:38:11", "url": "https://files.pythonhosted.org/packages/fb/b1/bc7c5f71a908be9ecd53d4a737a1904ab870dfe3b045491fb8cd6fbec6e4/pyMCR-0.2.1.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "404fd5e45751f906c7b55443a2d290b8", "sha256": "3f6ca1de122bb9763fb33aa7bb302133b62252d853a7adb4a25ad1357a307d89" }, "downloads": -1, "filename": "pyMCR-0.3.0.tar.gz", "has_sig": false, "md5_digest": "404fd5e45751f906c7b55443a2d290b8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 927335, "upload_time": "2019-04-22T16:37:14", "url": "https://files.pythonhosted.org/packages/d8/37/2c866bc322fe14a45478dabf7aacba2fe5be98f5c787b638a596a286c22d/pyMCR-0.3.0.tar.gz" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "0a45ebb653192dedec51151b0639ec40", "sha256": "d9a2b7c9e1e002d1b2b6f952b1c3cb176e6e9cdb3c685b31431536c817127008" }, "downloads": -1, "filename": "pyMCR-0.3.1.tar.gz", "has_sig": false, "md5_digest": "0a45ebb653192dedec51151b0639ec40", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 629170, "upload_time": "2019-05-17T06:01:35", "url": "https://files.pythonhosted.org/packages/c7/46/4ec863fdba050aeaa14ea6755eddabb2cbb532fe61c05f897e720f0dd1be/pyMCR-0.3.1.tar.gz" } ], "0.3.2": [ { "comment_text": "", "digests": { "md5": "0e026b93f41b0c1c0dc482978514c9ce", "sha256": "2192520584d25ee74c9d466e9d9f3f806ca76ff00c0d85cbf6f1fc6932ebe0f8" }, "downloads": -1, "filename": "pyMCR-0.3.2.tar.gz", "has_sig": false, "md5_digest": "0e026b93f41b0c1c0dc482978514c9ce", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 914844, "upload_time": "2019-06-25T15:33:48", "url": "https://files.pythonhosted.org/packages/bc/84/7b89a98d77727779de19847a02f0954552e36d6e70803e9b27ee2858392a/pyMCR-0.3.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "0e026b93f41b0c1c0dc482978514c9ce", "sha256": "2192520584d25ee74c9d466e9d9f3f806ca76ff00c0d85cbf6f1fc6932ebe0f8" }, "downloads": -1, "filename": "pyMCR-0.3.2.tar.gz", "has_sig": false, "md5_digest": "0e026b93f41b0c1c0dc482978514c9ce", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 914844, "upload_time": "2019-06-25T15:33:48", "url": "https://files.pythonhosted.org/packages/bc/84/7b89a98d77727779de19847a02f0954552e36d6e70803e9b27ee2858392a/pyMCR-0.3.2.tar.gz" } ] }