load("Y:/Bogdan/MOM_models_package/internal_data.RData")
usethis::use_data(anosel,protdatsel,z,blood_models,internal = TRUE,overwrite = TRUE)
usethis::use_vignette("my-vignette")
usethis::use_vignette("SomaPreg-vignette")
library(SomaPreg)
library(SomaPreg)
library(SomaPreg)
ano = anosel
protdat = protdatsel
protdat[1:6,1:6]
computeMOM(NULL,protdat,ano)[1:6,]
prot
computeMOM
computeMOM = function(protvect=rownames(protdat),protdat,ano){
if(!all(protvect%in%rownames(protdat))){
stop("The proteins from protvect should be in the rownames of protdat.")
}
if(!identical(sort(union(colnames(protdat),rownames(ano))),sort(intersect(colnames(protdat),rownames(ano))))){
stop("protdat and ano arguments should have the same sample ids.")
}
moms = sapply(protvect, function(prot) compute1MOM(prot,protdat,ano))
if(ncol(moms)==1) {moms = moms[,1]}
moms
}
computeMOM
computeMOM(protdat=protdat,ano=ano)[1:6,]
dim(computeMOM(protdat=protdat,ano=ano))
library(SomaPreg)
computeMOM
computeMOM = function(protvect=rownames(protdat),protdat,ano){
if(!all(protvect%in%rownames(protdat))){
stop("The proteins from protvect should be in the rownames of protdat.")
}
if(!identical(sort(union(colnames(protdat),rownames(ano))),sort(intersect(colnames(protdat),rownames(ano))))){
stop("protdat and ano arguments should have the same sample ids.")
}
moms = sapply(protvect, function(prot) compute1MOM(prot,protdat,ano))
if(ncol(moms)==1) {moms = moms[,1]}
moms
}
computeMOM
computeMOM(protdat=protdatsel,ano=anosel)[1:6,1:4]
computeMOM(ano=anosel,protdat=protdatsel)[1:6,1:4]
library(SomaPreg)
computeMOM(ano=anosel,protdat=protdatsel)[1:6,1:4]
computeMOM(ano=anosel,protdat=protdatsel)[1:6,1:4]
computeMOM(protdat=protdatsel,ano=anosel)[1:6,1:4]
library(SomaPreg)
head(anosel)
protdatsel[1:4,1:4]
computeMOM(ano=anosel,protdat=prodatsel)
?computeMOM
computeMOM
computeMOM(protdat=prodatsel,ano=anosel)
