Comments (11)
Did you tried
library("MADLIquantForeign")
spectra <- importImzMl(Directory)
importImzMl
is looking for all .imzML files recursively.
from maldiquant.
Dear @sgibb
thank you for replying.
I load the library first everytime I work on MALDIquant and it does load the files. when I process the files individually it does that as well but but when i load multiple files( files of different samples) like this
It doesnot process them as separate files. I load the files as suggested but in my case the problem comes when i try to upload multiple files (files of different samples). How can I upload multiple files?
As with the fiedler data there is the folder that is to be uploaded which has all the files. I tried to upload folder with all my sample files but it is not working as well. I tried few options as mentioned in ist comment but they do not work.
also it gives this error
maldiquant Error in (function (classes, fdef, mtable) : unable to find an inherited method for function ‘mass’ for signature ‘"list"’.
If you could please help me with this.
from maldiquant.
import*
(as importImzMl
) always returns a list
of spectra (even if there is just one spectrum, then it is a list
of length 1). You have to use the [[
operator (as for every generic list
in R) to access the individual spectrum:
library("MADLIquantForeign")
spectra <- importImzMl(Directory)
mass(spectra[[1]])
plot(spectra[[1]])
There is no need to combine individual files manually because import*
(and importImzMl
) supports recursive reading of all files in a directory and also include and exclude patterns. You could even list the filenames manually:
## list files manually
spectra <- importImzMl(c("file1.imzMl", "file2.imzMl"))
## use patterns
spectra <- importImzMl(".", pattern = "file[0-9]\\.imzMl")
But if you really want to combine the spectra on your own its:
spectra1 <- importImzMl("file1.imzMl")
spectra2 <- importImzMl("file2.imzMl")
spectra <- c(spectra1, spectra2)
## get the mz values of the first spectrum
mass(spectra[[1]])
Feel free to reopen the issue if it doesn't explain your problem.
from maldiquant.
@sgibb
Thank you for making it clear.
I tried the functions as suggested but I get this error
from maldiquant.
Could you attach the file? (I would need both the .imzMl and the corresponding .ibd)
from maldiquant.
from maldiquant.
from maldiquant.
Unfortunately your files are incorrect (I guess it is not your fault).
imzML files could store data in two formats: continuous or processed. Your .imzML files claim to be continuous but the .idb files are in fact processed. That's why MALDIquantForeign
can import the first but not the second spectrum of a file. You may ask WATERS to fix their converter.
Please have a look at https://ms-imaging.org/wp/imzml/data-structure/ for the details:
In order to insure efficient storage, two different formats of the binary data are defined: continuous and processed. Continuous type means that each spectrum of an image has the same m/z values. As a result the m/z array is only saved once directly behind the UUID of the file and the intensity arrays of the spectra are following. At the processed type every spectrum has its own m/z array. So it is necessary to save both – the m/z array and the corresponding intensity array – per spectrum.
A quick fix for you would be to fix the imzML files by replacing line 10:
<cvParam cvRef="IMS" accession="IMS:1000030" name="continuous" value=""/>
with
<cvParam cvRef="IMS" accession="IMS:1000031" name="processed" value=""/>
A solution in R would be:
library("MALDIquant")
library("MALDIquantForeign")
repairImzMlFiles <- function(d) {
files <- list.files(
d, pattern = "*\\.imzML$", recursive = TRUE, full.names = TRUE
)
for (f in files) {
lns <- sub(
'accession=\"IMS:1000030\" name=\"continuous\"',
'accession=\"IMS:1000031\" name=\"processed\"',
readLines(f)
)
writeLines(lns, f)
}
}
repairImzMlFiles(".")
spectra <- importImzMl(".")
par(mfrow = c(2, 1))
plot(spectra[[1]])
plot(spectra[[2]])
from maldiquant.
Thank You so much for your help . I will go through all the details and follow the procedure as mentioned. I may get back to you if I face any difficulty again.
I am attaching the file of how I convert the raw file into imzML format. If you could please see whether I am doing it right or not.
WatersFileConversion.pptx
Thank You again.
Kindest Regards
Umara
from maldiquant.
Sry, but I never used msconvert myself.
from maldiquant.
from maldiquant.
Related Issues (20)
- Add weighted average to the spectrum smoothing? HOT 1
- One more thought on the average smoothing HOT 2
- binPeaks tolerance documentation HOT 3
- Error and question regarding alignSpectra function HOT 7
- raw MSI spectra as MassSpectra objects - size in memory HOT 25
- warping - obtain number of matched peaks HOT 1
- MALDIquant::binpeaks() silently propagates values to empty MassPeaks objects HOT 1
- Massive memory usage while using mergeMassPeaks and FilterPeaks HOT 6
- Error in plot,AbstractMassObject,missing with R-devel
- Averaging warping functions - plate by plate effect HOT 2
- Extracting intensities from a file from a predifined m/z list HOT 4
- Peak binning on reference peaks HOT 2
- Unable to plot MALDI-TOF proteomics data collected in reflectron mode HOT 2
- Quality Control HOT 2
- Negative SNR HOT 2
- Change to new cran checks badge URL HOT 2
- Python version planned? HOT 1
- MALDI mass spec data format HOT 1
- can I skip some steps when analyzing centroided data HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from maldiquant.