Entering edit mode
Nianhua Li
▴
870
@nianhua-li-1606
Last seen 10.3 years ago
Hi, Alan,
I just had a quick look of your email. Not sure whether the following
script is
helpful or not:
## your code
cpdID<-c(1,2,3,4,5,6)
mass<-c(129.0426, 147.0532, 208.0848, 220.0848, 204.0899, 777.0317)
RT<-c(1,2,3,4,5,6)
ppmerror<-c(4,11,75,7,21,55)
floatmass=NULL
for (i in 1:length(cpdID)) {
floatmass[i]<-if(ppmerror[i]<10) {1e-5*mass[i]}
else{(ppmerror[i]/10^6)*mass[i]}
}
## something else
res <- mapply(search.compounds.by.mass, mass, floatmass)
final_res <- cbind(cpdID, mass, floatmass, res)
sessionInfo()
...
KEGGSOAP SSOAP RCurl XML
"1.9.1" "0.4-1" "0.8-0" "1.2-0"