README.md

The icreport package provides functions that perform independent component analysis on a given data set and can subsequently generate a compact report.

Important Note

Partial functionality of icreport has been moved over to picaplot which is going to be the public release with core features. icreport will remain on git, but the code is not as organized as picaplot and it also contains a lot of custom functions that were created on the fly for personal use. Please follow this link to access the picaplot package. (https://github.com/jinhyunju/picaplot)

Running ICA on the expression dataset.

1) Things that you need:

2) In case you have covariates:

library(icreport)
ica_result <- gene_expr_ica(phenotype.mx = expr.data, 
                            info.df = sample.info,
                            check.covars = colnames(sample.info))

# This may also take a few minutes depending on the size of your dataset. 

3) In case you don't have any covariates:

library(icreport)
ica_result <- gene_expr_ica(phenotype.mx = expr)

4) Creating a report file in the current working directory


head(probe.info)

report2me(input = ica_result, 
          prefix = "Test_ICA_Report",
          geneinfo.df = probe.info)

Running PCA on the expression dataset.

The PCA functionality of the package runs prcomp() on the dataset, and also tests given covariates against the principal components.

1) In case you have covariates:


pca_result <- gene_expr_pca(phenotype.mx = expr.data, 
                            info.df = sample.info,
                            check.covars = colnames(sample.info))

2) In case you don't have any covariates:


pca_result <- gene_expr_pca(phenotype.mx = expr.data)

3) Generating a report:

report2me(input = pca_result, 
          prefix = "Test_PCA_Report",
          geneinfo.df = probe.info)

Updated functions

Restructuring old functions to make the functionalities more modular.

Modular processes are:

1) Run PCA / ICA on data

2) Test association with covariates

3) Plot individual components (also summary figures through functions)

4) Generate report


library(icreport)
h5file <- "testinput.h5"
data_prefix <- gsub("[.]h5", "",h5file)

create_h5_file(h5file)

h5_add_data(file_name = h5file,
            input_matrix = phenotypes,
            data_type = "phenotypes")

h5_add_data(file_name = h5file,
            input_matrix = genotypes,
            data_type = "genotypes",
            feature_ids = snp.info$id)

h5_add_data(file_name = h5file,
            input_matrix = covars,
            data_type = "covars")

h5_add_snp_info(file_name = h5file,
                snp_id = snp.info$id,
                snp_chr = snp.info$chrom,
                snp_pos = snp.info$position)

h5_add_pheno_info(file_name = h5file,
                  pheno_id = gene.info$ensembl,
                  pheno_chr = gene.info$chromosome,
                  pheno_start = gene.info$start,
                  pheno_end = gene.info$end,
                  pheno_entrez = gene.info$entrez,
                  pheno_symbol = gene.info$symbol)

ica_result <- h5_ica(h5_file = h5file,var.cutoff = 95)
ica_result <- ica_covar_check(ica_list = ica_result,h5_file = h5file)
ica_result <- ica_genotype_association(ica_list = ica_result, h5_file = h5file)
ica_result <- get_gene_info(ica_result, h5file)

ica_report(ica_result, h5_file = h5file, prefix = data_prefix, output.path = "./")


Special Thanks to: Sushila, Francisco, Monica, Priya, Adrian, and Jason B. for testing and feedback.



jinhyunju/icreport documentation built on May 19, 2019, 10:35 a.m.