Skip to content
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

Assign formulas to theoretical isotope distributions #30

Open
rkjulian opened this issue Jul 3, 2023 · 0 comments
Open

Assign formulas to theoretical isotope distributions #30

rkjulian opened this issue Jul 3, 2023 · 0 comments

Comments

@rkjulian
Copy link

rkjulian commented Jul 3, 2023

Is there a way to use this package to generate all the formulas that could be assigned to a single m/z value (with an arbitrary intensity - say 100%)? I want to show how many formulas can be generated as a function of mass accuracy. If possible, I'd like to include the isotopes to help narrow the formula list. So far, short lists of m/z, and intensity loaded into a data.frame() and given as input for the peaks parameter of MFAssign() fails and throws errors.

The data frame I am using is:

      mass       prob
1 300.1600 100.000000
2 301.1633  19.630277
3 302.1667   1.819698
Mono_Iso <- IsoFiltR(isotopes_df, SN = 10)
mono <- Mono_Iso[["Mono"]]
iso <- Mono_Iso[["Iso"]]

Gives:
mono

  exp_mass abundance
1   300.16       100

iso

  exp_mass abundance tag
2 301.1633  19.63028 C13

This is for Codeine which is C18 H22 N1 O3

Looking at the code, it seems as if the function ignores everything below 300 m/z by default, so I thought I'd have to set DeNovo to something bigger even to get a peak list for processing in the function.

z <- MFAssign(peaks=mono, ionMode = "pos", DeNovo = 500)

Gives these errors/warnings:

Error in `$<-.data.frame`(`*tmp*`, "mode", value = "pos") : 
  replacement has 1 row, data has 0
In addition: Warning messages:
1: There was 1 warning in `dplyr::filter()`.
ℹ In argument: `CH2_num == min(CH2_num)`.
Caused by warning in `min()`:
! no non-missing arguments to min; returning Inf 
2: There was 1 warning in `dplyr::filter()`.
ℹ In argument: `(CH2_num == (min(CH2_num) + 2))`.
Caused by warning in `min()`:
! no non-missing arguments to min; returning Inf 

I realize that my application is off the normal workflow. I can create a longer simulated spectrum or adjust the input to something closer to a normal application if that would make it more compatible.

Thanks for the help,
Randy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant