Skip to content

Commit

Permalink
lastest files
Browse files Browse the repository at this point in the history
  • Loading branch information
xlucpu committed Sep 2, 2020
1 parent b75293f commit 322a48a
Show file tree
Hide file tree
Showing 9 changed files with 106 additions and 56 deletions.
Binary file added MOVICS.pdf
Binary file not shown.
2 changes: 0 additions & 2 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@ importFrom(DESeq2,DESeqDataSetFromMatrix)
importFrom(DESeq2,results)
importFrom(GSVA,gsva)
importFrom(PINSPlus,PerturbationClustering)
importFrom(SNFtool,affinityMatrix)
importFrom(SNFtool,dist2)
importFrom(SimDesign,quiet)
importFrom(aricode,AMI)
importFrom(aricode,ARI)
Expand Down
6 changes: 2 additions & 4 deletions R/dataset.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
#' A matrix frame storing the GDSC 2016 gene expression data.
#'
#' @format A matrix with 17419 rows and 1018 variables.
#' @keywords internal
#' \describe{contains "cgp2016ExprRma" the 2016 gene expression data. Data was obtained from "http://www.cancerrxgene.org/gdsc1000/GDSC1000_WebResources/Data/preprocessed/Cell_line_RMA_proc_basalExp.txt.zip". Cosmic Ids (in the column names) were mapped to cell line names using data from this file: ftp://ftp.sanger.ac.uk/pub/project/cancerrxgene/releases/release-6.0/Cell_Lines_Details.xlsx}
#' \describe{contains "cgp2016ExprRma" the 2016 gene expression data. Data was obtained from \url{http://www.cancerrxgene.org/gdsc1000/GDSC1000_WebResources/Data/preprocessed/Cell_line_RMA_proc_basalExp.txt.zip}. Cosmic Ids (in the column names) were mapped to cell line names using data from this file: \url{ftp://ftp.sanger.ac.uk/pub/project/cancerrxgene/releases/release-6.0/Cell_Lines_Details.xlsx}}
#' @source \url{https://osf.io/5xvsg/}
"cgp2016ExprRma"

Expand All @@ -13,8 +12,7 @@
#' A data frame storing the GDSC 2016 drug data.
#'
#' @format A data frame with 224510 rows and 13 variables.
#' @keywords internal
#' \describe{contains "drugData2016" the 2016 drug IC50 data, downloaded from (http://www.cancerrxgene.org/translation/drug/download#ic50)}
#' \describe{contains "drugData2016" the 2016 drug IC50 data, downloaded from \url{http://www.cancerrxgene.org/translation/drug/download#ic50)}}
#' @source \url{https://osf.io/5xvsg/}
"drugData2016"

47 changes: 46 additions & 1 deletion R/getNEMO.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,49 @@
#' @title affinityMatrix
#' @name affinityMatrix
#' @param Diff Distance Matrix.
#' @param K Number of nearest neighbors.
#' @param sigma Variance for local model.
#' @author Bo Wang, Aziz Mezlini, Feyyaz Demir, Marc Fiume, Zhuowen Tu, Michael Brudno, Benjamin Haibe-Kains, Anna Goldenberg
#' @keywords internal
affinityMatrix <- function(Diff,K=20,sigma=0.5) {
###This function constructs similarity networks.
N = nrow(Diff)

Diff = (Diff + t(Diff)) / 2
diag(Diff) = 0;
sortedColumns = as.matrix(t(apply(Diff,2,sort)))
finiteMean <- function(x) { mean(x[is.finite(x)]) }
means = apply(sortedColumns[,1:K+1],1,finiteMean)+.Machine$double.eps;

avg <- function(x,y) ((x+y)/2)
Sig = outer(means,means,avg)/3*2 + Diff/3 + .Machine$double.eps;
Sig[Sig <= .Machine$double.eps] = .Machine$double.eps
densities = dnorm(Diff,0,sigma*Sig,log = FALSE)

W = (densities + t(densities)) / 2
return(W)
}

#' @title dist2
#' @name dist2
#' @param X A data matrix where each row is a different data point.
#' @param C A data matrix where each row is a different data point. If this matrix is the same as X, pairwise distances for all data points are computed.
#' @author Bo Wang, Aziz Mezlini, Feyyaz Demir, Marc Fiume, Zhuowen Tu, Michael Brudno, Benjamin Haibe-Kains, Anna Goldenberg
#' @keywords internal
dist2 <- function(X,C) {
ndata = nrow(X)
ncentres = nrow(C)

sumsqX = rowSums(X^2)
sumsqC = rowSums(C^2)

XC = 2 * (X %*% t(C))

res = matrix(rep(sumsqX,times=ncentres),ndata,ncentres) + t(matrix(rep(sumsqC,times=ndata),ncentres,ndata)) - XC
res[res < 0] = 0
return(res)
}

#' @name getNEMO
#' @title Get subtypes from NEMO
#' @description This function wraps the NEMO (Neighborhood based multi-omics clustering) algorithm and provides standard output for `getMoHeatmap()` and `getConsensusMOIC()`.
Expand All @@ -13,7 +59,6 @@
#'
#' \code{mo.method} a string value indicating the method used for multi-omics integrative clustering.
#' @import NEMO
#' @importFrom SNFtool affinityMatrix dist2
#' @export
#' @references Rappoport N, Shamir R (2019). NEMO: cancer subtyping by integration of partial multi-omic data. Bioinformatics, 35(18):3348-3356.
#' @examples # There is no example and please refer to vignette.
Expand Down
21 changes: 12 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,11 @@ Multi-Omics integration and VIsualization in Cancer Subtyping
The goal of MOVICS is to provide a unified interface for 10
state-of-the-art multi-omics clustering algorithms, and standardizes the
output for each algorithm so as to form a pipeline for downstream
analyses. For cancer subtyping studies, MOVICS forms a pipeline for most
commonly used downstream analyses in cancer subtyping researches and to
create feature rich customizable visualzations with minimal effort.
analyses. MOVICS incorporates the most
commonly used downstream analyses in cancer subtyping researches and enables
creating feature rich customizable visualzations with minimal effort.

## Installation

``` {r}
if (!require("remotes")) {
install.packages("remotes")
Expand All @@ -28,8 +27,12 @@ remotes::install_github("xlucpu/MOVICS")
## Guidance

A detailed guide of how to use MOVICS could be find in the HTML
vignette. If you have any questions, bug reports, or suggestions for
improving MOVICS, please email them to <[email protected]>.
vignette by typing the following code to R session.
```{r}
browseVignettes("MOVICS")
```
Please email to <[email protected]> if you have any questions, bug reports, or suggestions for
improving MOVICS.

## Citation

Expand All @@ -39,10 +42,10 @@ If you use MOVICS R package in published research, please cite:

## Acknowledgement

I would like to express my gratitude to Dr. Morgane Pierre-Jean for the
I would like to express my gratitude to *Dr. Morgane Pierre-Jean* for the
inspiration brought by the study of evaluating unsupervised methods for
multi-omics data integration. I also want to thank Dr. Enyu Lin for the
multi-omics data integration. I also want to thank *Dr. Enyu Lin* for the
helping in calculation and visualization of fraction genome altered, and
to thank Dr. Rongfang Shen for the assistance in visualization of
to thank *Dr. Rongfang Shen* for the assistance in visualization of
Transitions and Transversions. At last, sincere thanks to the brilliant
contributors of all the functions incorporated in MOVICS package.
22 changes: 22 additions & 0 deletions man/affinityMatrix.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 2 additions & 29 deletions man/cgp2016ExprRma.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions man/dist2.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 2 additions & 11 deletions man/drugData2016.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 322a48a

Please sign in to comment.