Closed MuyaoXi9271 closed 2 years ago
Once you have loaded your data into R (as an MSnExp
, I assume), you could simply multiply the retention time values by 60 to get seconds.
Thanks for your quick answer.
In the MSnExp object, I could actually add a new variable SECOND under "featureData" section. The actual problem is that the value of Retention time becomes 0:00 in the assayData, as shown below
Therefore, even though I add the new variable "SECOND", I can not get the right value of retention time, if I write MSnExp as .mgf file. Do you have some ideas to deal with that? Thanks in advance.
Bests, Muyao
The retention time accessor will ignore your SECOND
variable, and there's not way to tell it to do so. As I said, your best option would be to update the default rtime
data.
It could be a stupid question, but I have no idea how to update the default rtime
for MSnExp object by codes.
This will depend on your MSnExp
- if it's on-disk, this should do it:
fData(x)$retentionTime <- fData(x)$retentionTime * 60
In-memory would be rather difficult.
Also, I suggest you look at the Spectra
package, which is a considerable improvement to MSnbase
.
Thanks for your suggestion. I will close the issue. Bests.
Hi expert,
I got the .mgf file of MS2 data in which the unit of retention time is minute, as shown in the image below
My question is that is it possible to change the unit of retention time from minute to second and corresponding values by any function. Thanks in advance
Bests, Muyao