R/experiment-functions.R
createExperimentsFragmentOptimisation.RdThis function is used to create a tree-like list of
all combinations of a user-given set of MS1 and TMS2 settings for an
fragment optimisation experiment. The list could be written to an
Orbitrap Fusion Lumos method xml file using writeMethodXmls().
createExperimentsFragmentOptimisation(
ms1,
...,
groupBy = c("AgcTarget", "replication"),
nMs2perMs1 = 10,
scanDuration = 0,
replications = 2,
randomise = TRUE
)| ms1 |
|
|---|---|
| ... | further named arguments with |
| groupBy |
|
| nMs2perMs1 |
|
| scanDuration |
|
| replications |
|
| randomise |
|
list, able to be written via xml2::as_xml_document()
## build experiments within R
ms1 <- expandMs1Conditions(
FirstMass=400,
LastMass=1200,
Microscans=as.integer(10)
)
targetMz <- cbind(mz=c(560.6, 700.5, 933.7), z=rep(1, 3))
common <- list(
OrbitrapResolution="R120K",
IsolationWindow=1,
MaxITTimeInMS=200,
Microscans=as.integer(40),
AgcTarget=c(1e5, 5e5, 1e6)
)
cid <- expandTms2Conditions(
MassList=targetMz,
common,
ActivationType="CID",
CIDCollisionEnergy=seq(7, 35, 7)
)
hcd <- expandTms2Conditions(
MassList=targetMz,
common,
ActivationType="HCD",
HCDCollisionEnergy=seq(7, 35, 7)
)
etd <- expandTms2Conditions(
MassList=targetMz,
common,
ActivationType="ETD",
ETDReactionTime=as.double(1:2)
)
etcid <- expandTms2Conditions(
MassList=targetMz,
common,
ActivationType="ETD",
ETDReactionTime=as.double(1:2),
ETDSupplementalActivation="ETciD",
ETDSupplementalActivationEnergy=as.double(1:2)
)
uvpd <- expandTms2Conditions(
MassList=targetMz,
common,
ActivationType="UVPD"
)
exps <- createExperimentsFragmentOptimisation(
ms1=ms1, cid, hcd, etd, etcid, uvpd,
groupBy=c("AgcTarget", "replication"), nMs2perMs1=10, scanDuration=0.5,
replications=2, randomise=TRUE
)
## use different settings for CID
cid560 <- expandTms2Conditions(
MassList=cbind(560.6, 1),
common,
ActivationType="CID",
CIDCollisionEnergy=seq(7, 21, 7)
)
cid700 <- expandTms2Conditions(
MassList=cbind(700.5, 1),
common,
ActivationType="CID",
CIDCollisionEnergy=seq(21, 35, 7)
)
exps <- createExperimentsFragmentOptimisation(
ms1=ms1, cid560, cid700,
groupBy=c("AgcTarget", "replication"), nMs2perMs1=10, scanDuration=0.5,
replications=2, randomise=TRUE
)
## use a CSV (or excel) file as input
myCsvContent <- "
ActivationType, ETDReactionTime, UVPDActivationTime
UVPD,,1000
ETD,1000,
"
myCsvSettings <- read.csv(text=myCsvContent, stringsAsFactors=FALSE)
myCsvSettings
#> ActivationType ETDReactionTime UVPDActivationTime
#> 1 UVPD NA 1000
#> 2 ETD 1000 NA
# ActivationType ETDReactionTime UVPDActivationTime
# 1 UVPD NA 1000
# 2 ETD 1000 NA
exps <- createExperimentsFragmentOptimisation(
ms1 = data.frame(FirstMass=500, LastMass=1000),
## TMS2
myCsvSettings,
## other arguments
groupBy="ActivationType"
)