Component Visualization Report

# setting global options 
figure.outpath <- paste(output_path,"/icreport_figures/",prefix,"/",sep="")
opts_chunk$set(fig.path=figure.outpath,dev=file.ext, warning=FALSE, message=FALSE)
options(warn=-1,width = 100)
flower.palette <- c("#283545","#E09E12","#A72613","#95CDDC","#395717","#3A3B35","#D68931","#442243")
cat(toupper(attr(input_list, "method")), " Analysis Report \n")
cat("Dataset = ", prefix,"\n")

Summary Information

# need to work on summary 

summary_plots = plotSummary(input_list)

Individual Component Information

if(length(n_comps) == 1){
    for( i in 1:n_comps){
    ###################### Plotting without Gene information ########################## 
    # check if there is a specified order for the ICs (default is by explained variance)
    p <- order(input_list$percent_var, decreasing = TRUE)[i]


    cat("------------------------------------------------------------------------------","\n")

    cat(paste0("plot#",i),"-", paste0("Comp",p),"\n")
    cat("Variance Percent = ", input_list$percent_var[p], "\n\n")
    cat("Top 10 Genes Weights\n")
    print(input_list$peaks[[p]][1:10])
    if(attr(input_list, "covar_cor") == "yes"){
        cat("-- Component covariate correlations\n")
        print(input_list$comp_cov[[p]])
    }
    cat("------------------------------------------------------------------------------","\n")

    single_plot = plotComponent(input_list, comp_idx = p, geneinfo_df = geneinfo_df)



    }


} else if (length(n_comps) > 1){
   i <- 1 
   for( p in n_comps){
        ###################### Plotting without Gene information ########################## 
        # check if there is a specified order for the ICs (default is by explained variance)
        #p <- order(input_list$percent_var, decreasing = TRUE)[i]


        cat("------------------------------------------------------------------------------","\n")

        cat(paste0("plot#",i),"-", paste0("Comp",p),"\n")
        cat("Variance Percent = ", input_list$percent_var[p], "\n\n")
        cat("Top 10 Genes Weights\n")
        print(input_list$peaks[[p]][1:10])
        if(attr(input_list, "covar_cor") == "yes"){
            cat("-- Component covariate correlations\n")
            print(input_list$comp_cov[[p]])
        }

        cat("------------------------------------------------------------------------------","\n")

        single_plot = plotComponent(input_list, comp_idx = p, geneinfo_df = geneinfo_df)

        i <- i + 1

    } 


}


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