mjoppich / pimz Goto Github PK
View Code? Open in Web Editor NEWThis framework allows to perform scRNA-seq-like analyses of imaging mass-spectrometry data. Check out the example jupyter-notebook in examples/
License: MIT License
This framework allows to perform scRNA-seq-like analyses of imaging mass-spectrometry data. Check out the example jupyter-notebook in examples/
License: MIT License
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
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)
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.
(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?
if startedLog == 0:
startedLog = 0.001
self.logger.info("Started Log Value: {}".format(startedLog))
median_profile += startedLog
The code chunk can be found here.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.