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

R code usage example #55

Open
wolski opened this issue Nov 14, 2017 · 3 comments
Open

R code usage example #55

wolski opened this issue Nov 14, 2017 · 3 comments
Assignees

Comments

@wolski
Copy link
Member

wolski commented Nov 14, 2017

R - low-level interface

CP, Please review and assign to LS

Input data:
mZ and intensity are obligatory the other attributes are not

x1 <- list(mZ = c(642.572, 643.054, 643.569, 644.062, 644.557),
               intensity = c(17000, 25000, 12000, 9000, 4000),
               title = "A MS from a heavy labeld peptide in water
background.",
               rtinseconds = 1.01,
               charge = 2,
               scan = 1,
               id = 1,
               pepmass = 700.01)

x2 <- x1

Construct Deisotoper

With default parameters

dtoper <- deisotoper()

With parameter list

dtoper <- deisotoper("Param1"=3, "Param3" = 2, "F3" = 3, "F4" = 0.5)

The dtoper is an R class based on an R list.

> class(dtoper)
"deisotoperFGCZ" 

> names(dtoper)
"javaObjectRef"

> dtoper$javaObjectRef
java@mamboJambo

Run and retrieve information about its state.

config <- getConfig(dtoper)

x1d <- deisotope(dtoper , x1) # same as x1 but deisotoped
xa1d <- getAnnotatedSpectrum(dtoper) # peaklist with charge, isotopeSet id etc.

dotgraphs <- getDotGraphs(dtoper)
.plotDot(dotgraphs[1]) # only as R helper function

s1 <- summary(dtoper) # nr of isotopicSets, isotopic clusters per set, nr of peaks, etc 
sc1 <- scores(dtoper) # returns the dataframe with the peak scores

Deisope a different spectrum with the same deisotoper.

x2<- deisotope(dtoper,  x2 )
dotgraphs <- getDotGraphs(dtoper)

Create a second deisotoper with different settings and deisotope x1

config2 <- list("Param1"=6, "Param3" = 9, "F3" = 3, "F4" = 0.5)
dtoper2 <- deisotoper(config2)
x1d2 <- deisotope(dtoper2 , x1)
s12 <- summary(dtoper2)

Compare results of deisotoping with 2 different deisotopers.

plot(x1d2, x1d)
@LucasSchmidt97
Copy link
Collaborator

LucasSchmidt97 commented Nov 15, 2017

R Interface needed functions:

getMZ doublearray
getIntensity doublearray
getDOTGraph string
getSummary string
...

For Java Implementation example see issue #65

@LucasSchmidt97
Copy link
Collaborator

Remove R methods and finish java then R interface

@LucasSchmidt97
Copy link
Collaborator

Works like described. See

#' Creates a deisotoper.

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

No branches or pull requests

3 participants