Skip to content

# public lianos /BiocSeqSVM

### Subversion checkout URL

You can clone with HTTPS or Subversion.

• 9 commits
• 6 files changed
• 0 comments
• 1 contributor
Feb 26, 2012
drafting 39c3a63
cleaning 9f64552
explaining 3aaa75e
intro is cleaned up 76d8443
more examples 85c95b8
end in sight 652cf74
Feb 27, 2012
more equations 5926ff1
weeding out large swaths of the section on the dual 1dd1241
keep on weeding 979935d
10  DESCRIPTION
 ... ... @@ -1,14 +1,14 @@ 1 -Package: MLplay 1 +Package: BiocSeqSVM 2 2  Version: 0.1-2012 3 -Title: Pedagogical machine learning exercises for NGS data 3 +Title: Pedagogical machine learning exercises using SVMs for NGS data 4 4  Author: Steve Lianoglou 5 5  Maintainer: Steve Lianoglou  6 -Description: Pedagogical machine learning exercises for NGS data 7 -Depends: shikken, kernlab, caret, Biostrings, GenomicRanges, data.table 6 +Description: Pedagogical machine learning exercises using SVMs for NGS data 7 +Depends: shikken, kernlab, caret, Biostrings, GenomicRanges, data.table, ggplot2 8 8  LazyLoad: Yes 9 9  Imports: methods, data.table, GenomicRanges, kernlab, Biostrings, sg, fields 10 10  Suggests: testthat, roxygen2, org.Dm.eg.db, org.Mm.eg.db, 11 11  BSgenome.Dmelanogaster.UCSC.dm3, BSgenome.Mmusculus.UCSC.mm9, 12 12  TxDb.Dmelanogaster.UCSC.dm3.ensGene, TxDb.Mmusculus.UCSC.mm9.knownGene 13 13  License: CC BY-SA (v3.0) 14 -URL: http://github.com/lianos/MLplay 14 +URL: http://github.com/lianos/BiocSeqSVM
11  R/SVM.R
 @@ -33,7 +33,10 @@ meshgrid <- function(a,b) { 33 33   34 34  plotDecisionSurface <- function(model, X, y, wireframe=FALSE) { 35 35  stopifnot(inherits(model, "SVM")) 36 - 36 +  37 + opars <- par() 38 + on.exit(suppressWarnings(par(opars))) 39 +  37 40  xlim <- c(min(X[,1] - 1), max(X[,1] + 1)) 38 41  ylim <- c(min(X[,2] - 1), max(X[,2] + 1)) 39 42   @@ -58,7 +61,7 @@ plotDecisionSurface <- function(model, X, y, wireframe=FALSE) { 58 61  ## image(x1, x2, z, col=cols) 59 62  ## image.plot in fields package gives us a handy color bar/legend 60 63  image.plot(x1, x2, z, col=terrain.colors(50)) 61 - contour(x1, x2, z, add=TRUE) 64 + contour(x1, x2, z, add=TRUE, lwd=1.5) 62 65   63 66  ## Get indices to support vectors 64 67  svs <- SVindex(model) @@ -66,8 +69,8 @@ plotDecisionSurface <- function(model, X, y, wireframe=FALSE) { 66 69  posSVs <- X[y == 1 & 1:nrow(X) %in% svs,, drop=FALSE] 67 70  negSVs <- X[y == -1 & 1:nrow(X) %in% svs,, drop=FALSE] 68 71   69 - pos <- X[y == 1 & !1:nrow(X) %in% svs, ] 70 - neg <- X[y == -1 & !1:nrow(X) %in% svs, ] 72 + pos <- X[y == 1 & !(1:nrow(X) %in% svs), ] 73 + neg <- X[y == -1 & !(1:nrow(X) %in% svs), ] 71 74   72 75  matplot(posSVs[,1], posSVs[,2], pch="+", col="red", add=TRUE, cex=1.5) 73 76  matplot(negSVs[,1], negSVs[,2], pch="-", col="red", add=TRUE, cex=1.5)
9  R/spectrum.R
 ... ... @@ -1,9 +1,14 @@ 1 1  spectrumFeatures <- function(strings, degree=4) { 2 2  features <- lapply(degree, function(deg) { 3 3  xx <- oligonucleotideFrequency(strings, 4) 4 - xx[colSums(xx) > 0] 4 + xx[, colSums(xx) > 0, drop=FALSE] 5 5  }) 6 - do.call(cbind, features) 6 + if (length(features) > 1) { 7 + ans <- do.call(cbind, features) 8 + } else { 9 + ans <- features[[1]] 10 + } 11 + ans 7 12  } 8 13   9 14  ## Manual spectrum kernel
621  inst/doc/MLplay.Rnw
72  inst/doc/MLplay.bib
 ... ... @@ -1,3 +1,22 @@ 1 +@article{Ratsch:2006il, 2 +author = {Rätsch, Gunnar and Sonnenburg, Sören and Schäfer, Christin}, 3 +journal = {BMC Bioinformatics}, 4 +title = {{Learning interpretable SVMs for biological sequence classification.}}, 5 +month = {}, 6 +volume = {7 Suppl 1}, 7 +year = {2006} 8 +} 9 + 10 +@article{BenHur:2008ec, 11 +author = {Ben-Hur, Asa and Ong, Cheng Soon and Sonnenburg, Sören and Schölkopf, Bernhard and Rätsch, Gunnar}, 12 +journal = {PLoS Comput Biol}, 13 +title = {{Support vector machines and kernels for computational biology.}}, 14 +number = {10}, 15 +month = {Oct}, 16 +volume = {4}, 17 +year = {2008} 18 +} 19 + 1 20  @article{Boser:1992uo, 2 21  author = {Boser, B.E. and Guyon, I.M. and Vapnik, V.N.}, 3 22  journal = {Proceedings of the fifth annual workshop on Computational learning theory}, @@ -7,6 +26,28 @@ @article{Boser:1992uo 7 26  pages = {144--152} 8 27  } 9 28   29 +@article{Noble:2006br, 30 +author = {Noble, William S}, 31 +journal = {Nat Biotechnol}, 32 +title = {{What is a support vector machine?}}, 33 +number = {12}, 34 +month = {Dec}, 35 +volume = {24}, 36 +year = {2006}, 37 +pages = {1565--1567} 38 +} 39 + 40 +@article{Leslie:2004kt, 41 +author = {Leslie, Christina S and Eskin, Eleazar and Cohen, Adiel and Weston, Jason and Noble, William Stafford}, 42 +journal = {Bioinformatics}, 43 +title = {{Mismatch string kernels for discriminative protein classification.}}, 44 +number = {4}, 45 +month = {Mar}, 46 +volume = {20}, 47 +year = {2004}, 48 +pages = {467--476} 49 +} 50 + 10 51  @article{Zou:2005elastic, 11 52  author = {Hastie, H Zou Trevor}, 12 53  journal = {Journal of the Royal Statistical Society Series B}, @@ -18,3 +59,34 @@ @article{Zou:2005elastic 18 59  pages = {301--320} 19 60  } 20 61   62 +@article{Leslie:2002tx, 63 +author = {Leslie, Christina and Eskin, Eleazar and Noble, William Stafford}, 64 +journal = {Pac Symp Biocomput}, 65 +title = {{The spectrum kernel: a string kernel for SVM protein classification.}}, 66 +month = {}, 67 +year = {2002}, 68 +pages = {564--575} 69 +} 70 + 71 +@article{Sonnenburg:2008do, 72 +author = {Sonnenburg, Sören and Zien, Alexander and Philips, Petra and Rätsch, Gunnar}, 73 +journal = {Bioinformatics}, 74 +title = {{POIMs: positional oligomer importance matrices--understanding support vector machine-based signal detectors.}}, 75 +number = {13}, 76 +month = {Jul}, 77 +volume = {24}, 78 +year = {2008}, 79 +pages = {i6--14} 80 +} 81 + 82 +@article{BenHur:2009ch, 83 +author = {Weston, Asa Ben-Hur Jason}, 84 +journal = {}, 85 +title = {{Methods in Molecular Biology}}, 86 +number = {Chapter 13}, 87 +month = {Oct}, 88 +volume = {609}, 89 +year = {2009}, 90 +pages = {223--239} 91 +} 92 +
4,746  inst/doc/figs/scratch.graffle
4252 additions, 494 deletions not shown

### No commit comments for this range

Something went wrong with that request. Please try again.