1 | proteinClassification(peptide, svm_model, protein.weight, protein.length, protein.tryptic, protein.pI)
|
peptide |
|
svm_model |
|
protein.weight |
|
protein.length |
|
protein.tryptic |
|
protein.pI |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | ##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
function (peptide, svm_model, protein.weight, protein.length,
protein.tryptic, protein.pI)
{
all.proteins <- unique(unlist(strsplit(as.character(peptide[,
"Proteins"]), ";")))
all.proteins <- all.proteins[-grep("CON__", all.proteins)]
all.proteins.df <- data.frame(cbind(protein.weight[all.proteins],
protein.length[all.proteins], protein.tryptic[all.proteins],
protein.pI[all.proteins]))
rownames(all.proteins.df) <- all.proteins
protein.regressed <- as.numeric(predict(svm_model, all.proteins.df))
names(protein.regressed) <- all.proteins
result <- list()
result$regressed <- protein.regressed
return(result)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.