Open glormph opened 5 years ago
From the message above, it looks like your file contains 191 scans, and the peaks
function retrieves them by their index. For example peaks(x, 1)
gets you a matrix of M/Z and intensities. If you use peaks(x)
or peaks(x, 1:10)
you get a list of matrices.
I would suggest you look into using the MSnExp
object from MSnbase
. It uses the code from mzR
but with a much richer and nicer interface.
I think the question is, which parameter field peaks
uses. Is it
index
from the spectrum
tag in the mzML files, or scan
field inside the id
attribute of <spectrum>
, ormzR
?Thank you! That is correct. I'm apparently getting the scan numbers from MSGF+ output, but figured out how to do it now in MSnbase
:)
The scan index is extracted directly from the underlying file (generally mzML), i.e. option 2 in @mtstahl's list above.
Maybe it is extracted from the file, but not directly from this element:
<spectrum index="0" id="controllerType=0 controllerNumber=1 scan=4702" defaultArrayLength="310">
which I think gets scan index 1
. My R skills are pretty bad but I'm guessing something with its counting starting at 1?
@glormph So this would speak for option 1 in my list above. ;)
I'm pretty much a
mzR
newbie (so this is probably a question and not a bug) but one of our lab's scripts uses thepeaks
function. I have created some testdata by filtering "quality" MS2 scans from an mzML, and this broke thepeaks
functionality:My question is, am I correct in assuming that the
scans
argument actually fetches a scan by some sort of index? My scan numbers in the mzML files go way higher than 191.