-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
precursorMZ missing #18
Comments
Hm, that's interesting - and you are sure that the precursor m/z are provided/stored in the file? We actually don't do anything magic, just reading the files using the timstof R package. |
Could you maybe open an issue in the |
Hi there! @chufz @jorainer Here's a small example using the ddaPASEF.d test data: library(Spectra)
library(MsBackendTimsTof)
fl <- system.file("ddaPASEF.d", package = "MsBackendTimsTof")
ot <- opentimsr::OpenTIMS(fl)
tbl <- opentimsr::table2df(ot, "PASEFFrameMsMsInfo")[[1]]
tbl
be <- backendInitialize(MsBackendTimsTof(), fl)
spd <- spectraData(be)
target_cols <- c("precursorMz", "isolationWindowTargetMz", "isolationWindowLowerMz",
"isolationWindowUpperMz", "collisionEnergy")
for(i in seq(nrow(tbl))){
row <- tbl[i, ]
target_rows <- which(spd$frameId == row$Frame &
MsCoreUtils::between(spd$scanIndex,
c(row$ScanNumBegin, row$ScanNumEnd)))
spd[target_rows, target_cols] <-
t(replicate(length(target_rows),
list(row$IsolationMz, #Probably not entirely correct, we should use the Precursors table
row$IsolationMz,
row$IsolationMz - row$IsolationWidth,
row$IsolationMz + row$IsolationWidth,
row$CollisionEnergy))
)
}
spd[5452:5462,] #Now it has the precursorMz, windows and energy It's just a sketch, but I think we could implement something like this to incorporate these values into |
Hey @RogerGinBer , I think it would be great if you could implement something like this. The question is where and how would it most make sense. One possibility would be to extract these data already during I would suggest to implement a simple function that takes whatever data required (as low level as possible) and returns a |
Hm, maybe I need then to change the backend to extend the |
Sounds good, I'll create this function and add it to the |
Hi, this is a while ago, but are the changes implemented yet? So far I have worked with Opentimsr directly, but would be nice for some coding to use the MsBackendTimsTof for some implementations. |
Hi @chufz, last year I started working on this but at some point I became busy with other work and left the PR unfinished. |
So i tried the code from your repository, while the testdata works fine, for real-world data from my instrument, I reveal the following error: |
That's interesting, looks like something went quite wrong there and the exception wasn't well captured, so the error message is rather generic @chufz, could you provide an example of what you did there? What function did output this error? Was it when initializing the MsBackendTimsTof object or when accessing all/some MS/MS info? If it's possible for you, could you share the data or a subset of it with me (over the metaRbolomics Slack or any other medium)? I'd be happy to take a look and see what the problem might be |
Just simply
I will upload the data to a cloud server and send you the link over slack:) |
Hi Johannes,
I finally had another look on the package with some first data. Unfortunately, the precursor mass is NA for MS2 spectra...
´´´
ftest <- system.file("ddaPASEF.d", package = "MsBackendTimsTof")
sps <- Spectra(fl, source = MsBackendTimsTof())
ms2_sps <- Spectra::filterMsLevel(sps, 2)
ms2_sps[1]
´´´
MSn data (Spectra) with 1 spectra in a MsBackendTimsTof backend:
msLevel precursorMz polarity
1 2 NA 1
... 35 more variables/columns.
Use 'spectraVariables' to list all of them.
Processing:
The text was updated successfully, but these errors were encountered: