Skip to content

Commit

Permalink
dependecy
Browse files Browse the repository at this point in the history
  • Loading branch information
daniellyz committed May 6, 2018
1 parent c4a0cbf commit 1945c3c
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 7 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Title: Independent component analysis for high-resolution mass-spectrometry base
Author: Youzhong Liu <[email protected]>
Maintainer: Youzhong Liu <[email protected]>
Depends: R (>= 3.4.1)
Imports: e1071, propagate, mixOmics
Imports: propagate, mixOmics
Suggests: ade4
Description: ICA is an important alternative to classical statistical approaches for non-targeted metabolomics data. It extends the concept of regular correlation (e.g. in PCA, ASCA and PLS-DA) to statistical dependance by capturing higher order dependencies. However, its algorithm instability (output variations between different algorithm runs) and the biological validity of components have been overlooked when applied to complex metabolomics data. MetICA adresses these problems by gathering ICs estimated from multiple algorithm runs and from bootstrapped datasets, clustering them so as to find the most representative components. While evaluating the algorithmic stability, MetICA also suggests multiple criteria to select the correct number of components and to rank the extracted components.
License: GPL3
Expand Down
2 changes: 1 addition & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
export(MetICA)
export(MetICA_extract_model)
export(validationPlot)
importFrom(e1071,kurtosis)
importFrom(grDevices,rgb)
importFrom(graphics,barplot)
importFrom(graphics,box)
Expand All @@ -13,6 +12,7 @@ importFrom(graphics,polygon)
importFrom(graphics,title)
importFrom(mixOmics,ipca)
importFrom(propagate,bigcor)
importFrom(propagate,kurtosis)
importFrom(stats,as.dist)
importFrom(stats,cor)
importFrom(stats,cutree)
Expand Down
6 changes: 3 additions & 3 deletions R/MetICA.R
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
#' M1=MetICA(bacteria_peptides$X,pcs = 20,max_iter = 100,boot.prop = 0.3,max.cluster = 40,trends = T)
#' # Generate validation plots along with geometric index calculation to help decide number of clusters
#' validationPlot(M1)
#' # According to the validation, we choose 10 components
#' # According to the validation, we now choose 10 components:
#' M2=MetICA_extract_model(M1,10,tops=7)
#'
#' @export
Expand All @@ -56,7 +56,7 @@
#' @importFrom stats rnorm cor as.dist hclust cutree
#' @importFrom mixOmics ipca
#' @importFrom propagate bigcor
#' @importFrom e1071 kurtosis
#' @importFrom propagate kurtosis

MetICA<-function(X, pcs = 15, max_iter = 400, boot.prop = 0.3, max.cluster = 20, trends = T, verbose=T){

Expand Down Expand Up @@ -281,7 +281,7 @@ MetICA<-function(X, pcs = 15, max_iter = 400, boot.prop = 0.3, max.cluster = 20,
boot_eval_summary[[nb_cluster]]=dis_boot_no_boot
defl_prop_summary[[nb_cluster]]=defl_prop

if (!all(total_number>30)){ # At least 30 estimates in each cluster
if (all(total_number)<=30){ # If < 30 estimates in all clusters
max.cluster=nb_cluster
message("Too few estimates in new cluster(s): max.cluster reset to: ",nb_cluster)}

Expand Down
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,17 @@
## Context
ICA is an important alternative to classical statistical approaches for non-targeted metabolomics data. It extends the concept of regular correlation (e.g. in PCA, ASCA and PLS-DA) to statistical dependance by capturing higher order dependencies. However, its algorithm instability (output variations between different algorithm runs) and the biological validity of components have been overlooked when applied to complex metabolomics data. MetICA adresses these problems by gathering ICs estimated from multiple algorithm runs and from bootstrapped datasets, clustering them so as to find the most representative components. While evaluating the algorithmic stability, MetICA also suggests multiple criteria to select the correct number of components and to rank the extracted components.

## Install devtools (only if it has not been installed)

Make sure you have a working development environment:
* Windows: Install Rtools.
* Mac: Install Xcode from the Mac App Store.
* Linux: Install a compiler and various development libraries (details vary across different flavors of Linux).

```R
install.packages("devtools")
```

## Installation from Github using R (with devtools)

```R
Expand Down Expand Up @@ -36,7 +47,7 @@ X = t(X) # Transpose the data since MetICA accepts samples x variables matrices

```{r}
# Begin a MetICA simulation with 2000 estimated components in total. The samples are not time-dependent, so trend = FALSE. Numbers of clusters are evaluated between 2 and 10:
M1=MetICA(X,pcs = 10,max_iter = 200,boot.prop = 0.3,max.cluster = 10,trends = F)
M1=MetICA(X,pcs = 10,max_iter = 400,boot.prop = 0.3,max.cluster = 10,trends = F)
# Users can confirm the number of pcs used for denoising if they think enough variance is explained, they can modify the number of pcs at this moment as well:
```
![choose](inst/Launch_MetICA.JPG)
Expand Down
2 changes: 1 addition & 1 deletion man/MetICA.Rd

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

0 comments on commit 1945c3c

Please sign in to comment.