Comments (9)
Yes, of course there is. See importTxt
, importTab
or importCsv
in MALDIquantForeign
.
Could you please describe the format of your text files (and the line of codes you try to use them)?
from maldiquant.
I had seen MALDIQuant Foreign but did not know the use of the package. I will try running my code using instrunctions from the vignette and get back to you.
from maldiquant.
When I used ImportCSV, I received the following error:
Error in import(path = path, type = "csv", ...) :
Import failed! Unsupported file type?
I then just used the general import function and my data was uploaded as a variable into the workspace.
spectra<-import("E:/Data/Kundai/RStudio/MALDI")
I then tried carrying out quality control and the functions gave the following errors:
any(sapply(spectra, isEmpty))
Error in FUN(X[[i]], ...) :
isEmpty() is not defined for objects of class MassSpectrum
plot(spectra[[1]])
I then tried running the following lines of code and these are the errors I received. ( I have a folder which has 5 MALDI spectra with simple labels e.g K8 but the columns are not labelled.) I personally think the problems lies in the function failing to label the different files, but I am no expert, just a beginner).
samples <- factor(sapply(spectra, function(x)metaData(x)$sampleName))
Error in sort.list(y) : 'x' muss atomar sein für 'sort.list'
Haben Sie 'sort' für eine Liste aufgerufen?
avgSpectra <- averageMassSpectra(spectra, labels=samples, method="mean")
Error in as.vector(x, "character") :
cannot coerce type 'closure' to vector of type 'character'. If I remove the "labels=samples", the line runs well but then I receive the following error when I continue with the next line of code.
noise <- estimateNoise(avgSpectra[[1]])
Error in avgSpectra[[1]] : this S4 class is not subsettable
plot(avgSpectra[[1]], xlim=c(4000, 5000), ylim=c(0, 0.002))
Error in avgSpectra[[1]] : this S4 class is not subsettable
from maldiquant.
Can you send me an example file?
from maldiquant.
Please find attached two txt files as requested.
from maldiquant.
The error Error in import(path = path, type = "csv", ...) : Import failed! Unsupported file type?
arises because you file is not a CSV file but a txt file (not comma but space separated).
You could use:
library("MALDIquant")
library("MALDIquantForeign")
## single file
spectra <- importTxt("K8.txt")
## whole folder:
spectra <- importTxt(".")
## or use just "import" which tries to find the correct file type automatically
spectra <- import("K8.txt")
## or for directories
spectra <- import("E:/Data/Kundai/RStudio/MALDI") # as you did already
plot(spectra[[1]])
from maldiquant.
Thank you. What about application of quality control functions and labeling of files to enable plotting of average spectra. I am still getting the following error :
plot(avgSpectra[[1]], xlim=c(4000, 5000), ylim=c(0, 0.002))
Error in avgSpectra[[1]] : this S4 class is not subsettable
I have been zealously following the vignette and since the following line of code produces an error:
samples <- factor(sapply(spectra,function(x)metaData(x)$sampleName))
Any operation after the said point is producing an error. Whats the best way for me to be able to label my data ? I need this part to ensure that I can detect peaks, do peak binning and produce a feature matrix.
from maldiquant.
I have been zealously following the vignette and since the following line of code produces an error:
samples <- factor(sapply(spectra,function(x)metaData(x)$sampleName))
That's not working because the sampleName
could only generated from files that contain metadata, e.g. bruker fid files, mzML files etc.
txt, csv, tab and so on don't contain any metadata (except the file name). That's why you can't use this to get your samples. You have to create the samples
variable from the file names or manually.
I am still getting the following error :
plot(avgSpectra[[1]], xlim=c(4000, 5000), ylim=c(0, 0.002))
Error in avgSpectra[[1]] : this S4 class is not subsettable
If you build just one average spectrum you have to use plot(avgSpectra)
instead of plot(avgSpectra[[1]])
(the output of averageMassSpectra
depends on the labels
argument, if no label was given all spectra are averaged into on spectrum, otherwise a average spectrum per level is generated).
from maldiquant.
Thank you for your patience, attention and help.
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
- MALDIquant With WATERS DESI Data HOT 11
- 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.