GOSemSim redesign in terms of S4 classes

[This article was first published on YGC » R, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

I started to develop GOSemSim package two years ago when I was not quite familiar with R. I am very happy to see that someone use it and found it helpful.

I try to learn S4 and redesign GOSemSim with S4 classes and methods in the pass two weeks, and the very first version was implemented. As I’m not very familiar with S4, the package may need improve in many aspect.

The newest version of GOSemSim can be installed by:

install.packages("GOSemSim",repos="http://www.bioconductor.org/packages/devel/bioc",type="source")

Here come some example:

> library(GOSemSim)
Loading required package: AnnotationDbi
Loading required package: Biobase

Welcome to Bioconductor

  Vignettes contain introductory material. To view, type
  'openVignette()'. To cite Bioconductor, see
  'citation("Biobase")' and for packages 'citation(pkgname)'.

Loading required package: GO.db
Loading required package: DBI
Loading required package: org.Hs.eg.db
> params 
>
> go1  go2  gos 
> gs1  gs2  gs 
> x  hsEG  clusters  geneClusters 
> sim(gos,params)
           GO:0009055 GO:0020037
GO:0004022      0.318      0.151
GO:0004024      0.290      0.136
GO:0004023      0.290      0.136
> setCombineMethod(params) sim(gos,params)
[1] 0.273
> sim(gs, params)
[1] "loading GOMap..."
[1] "Done..."
       578   582   400   409   411
835  0.743 1.000 0.624 0.741 0.543
5261 0.551 0.842 0.580 0.582 0.438
241  0.729 1.000 0.666 0.702 0.360
994  0.610 1.000 0.542 0.642 0.673
514  0.285 0.390 0.420 0.282 0.550
533  0.378 0.481 0.373 0.369 0.357
> sim(geneClusters, params)
      a     b     c
a 1.000 0.782 0.770
b 0.782 1.000 0.745
c 0.770 0.745 1.000
>
> setOrganism(params)  ygs  sim(ygs,params)
[1] 0.199
> setOntology(params)  sim(ygs,params)
[1] 0.295
> setMethod(params)  sim(ygs,params)
[1] 0.234

Related Posts

To leave a comment for the author, please follow the link and comment on their blog: YGC » R.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)