Code Monkey home page Code Monkey logo

pimz's Introduction

pIMZ: an integrative framework for imaging mass spectrometry analysis

Documentation Status CircleCI PyPI GitHub All Releases PyPI - Python Version PyPI - License DOI

Description

pIMZ is a framework for Imaging Mass Spectrometry (IMS) data analysis. The python implementation is available from github.com/mjoppich/pIMZ. For installation follow the instructions given here.

pIMZ focuses on a differential setting, where masses, specific to certain areas are first determined, and then serve as input for a cell-type detection framework and/or a differential expression setting.

pIMZ's documentation is available here: Documentation Status .

Installation

The easiest way to install most Python packages is via pip.

If not already done, you must first install the following dependencies manually. This is because at the time of writing this document, dabest requires pandas~=0.25, which is incompatible with probably the rest of the world nowadays. So first dabest is installed, then numpy and pandas are upgraded again ::

sudo pip3 install dabest
sudo pip3 install numpy pandas --upgrade

Only then we should install pIMZ :

sudo pip3 install pIMZ

pIMZ is now ready to go!

Usage

References to examples and example notebooks can be found in the examples folder, or in the documentation.

All available classes and their functions are explained in the modules/API documentation.

pimz's People

Contributors

mjoppich avatar ritaolenchuk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

pimz's Issues

Couldn't install pIMZ following the instructions

(ims36) banikr2@banikr:~$ sudo pip3 install pIMZ
The directory '/home/banikr2/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/banikr2/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting pIMZ
  Could not find a version that satisfies the requirement pIMZ (from versions: )
No matching distribution found for pIMZ

What could be done to check?

ValueError: operands could not be broadcast together with remapped shapes [original->remapped]: (2,2) and requested shape (1,2)

Following the tutorial here: https://github.com/mjoppich/pIMZ/blob/master/examples/IMZMLprocess.theo_weights.ipynb
spectra0_orig = imze.get_region_array(0, makeNullLine=True)
Executing this line generates the following error. I am trying to debug the error but asking for help.

ValueError                                Traceback (most recent call last)
/tmp/ipykernel_18770/3067085986.py in <module>
----> 1 imze.get_region_array(1, makeNullLine=False)

~/.local/lib/python3.7/site-packages/pIMZ-1.0a0-py3.7-linux-x86_64.egg/pIMZ/imzml.py in get_region_array(self, regionid, makeNullLine, bgspec)
   1442 
   1443             if len(spectra) < sc:
-> 1444                 spectra = np.pad(spectra, ((0,0),(0, sc-len(spectra) )), mode='constant', constant_values=0)
   1445 
   1446             spectra = np.array(spectra, copy=True)

<__array_function__ internals> in pad(*args, **kwargs)

~/miniconda3/envs/ims37/lib/python3.7/site-packages/numpy/lib/arraypad.py in pad(array, pad_width, mode, **kwargs)
    741 
    742     # Broadcast to shape (array.ndim, 2)
--> 743     pad_width = _as_pairs(pad_width, array.ndim, as_index=True)
    744 
    745     if callable(mode):

~/miniconda3/envs/ims37/lib/python3.7/site-packages/numpy/lib/arraypad.py in _as_pairs(x, ndim, as_index)
    516     # Converting the array with `tolist` seems to improve performance
    517     # when iterating and indexing the result (see usage in `pad`)
--> 518     return np.broadcast_to(x, (ndim, 2)).tolist()
    519 
    520 

<__array_function__ internals> in broadcast_to(*args, **kwargs)

~/miniconda3/envs/ims37/lib/python3.7/site-packages/numpy/lib/stride_tricks.py in broadcast_to(array, shape, subok)
    409            [1, 2, 3]])
    410     """
--> 411     return _broadcast_to(array, shape, subok=subok, readonly=True)
    412 
    413 

~/miniconda3/envs/ims37/lib/python3.7/site-packages/numpy/lib/stride_tricks.py in _broadcast_to(array, shape, subok, readonly)
    348     it = np.nditer(
    349         (array,), flags=['multi_index', 'refs_ok', 'zerosize_ok'] + extras,
--> 350         op_flags=['readonly'], itershape=shape, order='C')
    351     with it:
    352         # never really has writebackifcopy semantics

ValueError: operands could not be broadcast together with remapped shapes [original->remapped]: (2,2)  and requested shape (1,2)

About from `src.pySRM.pysrm.segment import ...`

In the examples in some of the .ipnbs there are these library imports.

from src.pySRM.pysrm.segment import IMZMLExtract, SpectraRegion, ProteinWeights, CombinedSpectra
what does src refer to?
for example, the ProteinWeights class is present in pIMZ/regions.py

And the only src I found after installation is cIMZ/src which actually has .cpp and .h extension C files

General m/z distribution.

Hello Markus,
It may be difficult for me to explain this as an amateur MSI data analyst. But I will try:

len(np.unique(imze.parser.getspectrum(1)[0])),  \
len(np.unique(imze.parser.getspectrum(10)[0])), \
len(np.unique(imze.parser.getspectrum(10000)[0])), \
len(np.unique(imze.parser.getspectrum(19000)[0])), \
len(np.unique(imze.parser.getspectrum(19818)[0]))

>> (27240, 36755, 23331, 27176, 22426)

len(np.unique(imze.mzValues))

>> 29888

Different spectrum/specID has different numbers of unique m/z values. Though total mzvalues are the same throughout the imze image.

My question is how do I get 2D spatial images for a given or fixed m/z value on different sections/slices of spinal image. According to the data I am working with the m/z values seem to be restricted/ranged within 506~2000 for MALDI-ToF imaging for all slices of the spine.

Thanks a lot.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.