-
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
Charges in raw arrays #20
Comments
Actually, Freestyle, like Excalibur before it, does include a form of
isotopic pattern fitting and charge state prediction that it does on the
fly, and that charge information may not make its way to other files. I'll
still check to see if I'm missing something in the Thermo RAW file parsing
process for your file though.
Charge states aren't (or weren't) stored in the raw file because how you
compute them depends heavily on what you're analyzing. Thermo used to be
terrible at monoisotopic peak prediction for larger molecules when
assigning precursors, but in 2018 or so introduced an improved model for
peptide-like ions, called "peptide match" in the instrument method. Such a
model wouldn't work properly on an ion from a wildly different class of
molecules like say a highly sulfated heparan because of how the "average
monomer" scaling process that general-purpose isotopic pattern predictors
use differ between the two classes.
This is why I wrote `ms_deisotope` and later `mzdeisotope` (I just did a
big bug fix release of this to fix issues with reading deconvolved peaks
back out of mzML files), and why other informatics people in the academic
lab I did my PhD in wrote molecule-class specific deconvolution software
Thank you,
Joshua Klein
…On Fri, Jan 10, 2025 at 8:55 AM RienLeuvenink ***@***.***> wrote:
Hi,
I am trying to look at some ion data but I can't seem find the charges.
I've included an example spectrum below which has annotated charges when I
open the raw file in freestyle. I assume this is encoded in the raw file
and not something that freestyle makes up..
below how I access the file. Maybe I'm just overlooking something
`
let mut ms_file =
MZReader::open_path(r"D:\MS data\2025-01 January\ETD
test\MS1_example.raw").unwrap();
dbg!(ms_file
.get_spectrum_by_index(0)
.unwrap()
.raw_arrays()
.unwrap());
`
https://filesender.surf.nl/?s=download&token=168ebd63-923e-49f3-8424-b65c3a5e942c
—
Reply to this email directly, view it on GitHub
<#20>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAK4E6I67BHRKHMA6NOC6ST2J7GNJAVCNFSM6AAAAABU6NXZ5WVHI2DSMVQWIX3LMV43ASLTON2WKOZSG44DAMRUG4YTEMQ>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Thanks for your quick response. A collaborator of mine uses the pymsfilereader for python and I've been told that he can access the charge states through this. I see that you where a collaborator on this too, I also see that this package uses the MSFileReader instead of the RawFileReader maybe this is where the difference stems from? Kind regards, |
Yes, the old Thermo
Additionally, your file and some of my newer test files seem to have charge annotations, but they don't include isotopic pattern assignments so it would effectively say "this peak is predicted to be this charge state, but whether it is a monoisotopic peak is unknown". This is representable with |
If possible from your side I'd be keen to try it out and compare it to what freestyle tells me. In my experience and for the type of proteins we're looking at freestyle does quite a decent job of assigning charge-states etc. |
I've added support for extracting the charge array to the use std::io;
use mzdata::prelude::*;
fn main() -> io::Result() {
let mut reader = ThermoRawReader::open_path("./test/data/small.RAW")?;
reader.set_centroiding(true);
reader.set_load_extended_spectrum_data(true);
let spec = reader.get_spectrum_by_index(0).unwrap();
let arrays = spec.arrays.as_ref().unwrap();
let z_array = arrays.charges().unwrap();
Ok(())
} Again, this charge array doesn't deisotope the spectrum. I think it just does a variation of the Patterson charge state determination method like what's shown in the Horn et al. paper to determine the charge state from peak spacing, and may be incorrect when you have interleaved isotopic peaks. The change also includes other data arrays for FT spectra including a signal-to-noise-ratio array and a raw baseline signal array. I am just pulling what's available from the |
Hi,
I am trying to look at some ion data but I can't seem find the charges. I've included an example spectrum below which has annotated charges when I open the raw file in freestyle. I assume this is encoded in the raw file and not something that freestyle makes up..
below how I access the file. Maybe I'm just overlooking something
`
let mut ms_file =
MZReader::open_path(r"D:\MS data\2025-01 January\ETD test\MS1_example.raw").unwrap();
`
https://filesender.surf.nl/?s=download&token=168ebd63-923e-49f3-8424-b65c3a5e942c
The text was updated successfully, but these errors were encountered: