========================================================

knitr::opts_chunk$set(echo=TRUE)
#knitr::opts_knit$set(root.dir="")
##  SET FILE PATHS FOR LOCAL INSTALL

## R libraries path
#libraries_path = '/project/cnsbomic/Tools/R'

## Inherit paths
#inherit_paths = "TRUE"

# Loaded from Parameters.R

## IF NOT RUNNING WITH PIPELINE, SET WORKING DIRECTORY
# working_dir <- PATH TO DATA FILES
# setwd(working_dir)

suppressPackageStartupMessages({
library(OmicsNotebook)
library(ggplot2)
library(Biobase)
})
BiocParallel::register(BiocParallel::MulticoreParam(workers=as.integer(Sys.getenv("NSLOTS",1))))

g=g.notebook.setup(param_file=params$param_file, override=params$override)

# Source function file
#sourceDirectory(file.path(gsub("src","R", notebook_dir)))

Load Search Output and Process

############################################
# The omicsList object is a list of lists. Each top level represents a different omics type.
#
# omicsList[[i]][[1]] "dataType" is the name of the omics set
# omicsList[[i]][[2]] "dataFormat" is the data format of the omics set.
# omicsList[[i]][[3]] "filename" is the filename/path for the omics data set.
# omicsList[[i]][[4]] "RawData" is the raw data.
# omicsList[[i]][[5]] "eSet" is the working eset object
# omicsList[[i]][[6]] "topVariable" is the index of the most variable features
# omicsList[[i]][[7]] "fit" is the limmaFit output of eBayes
# omicsList[[i]][[8]]
# omicsList[[i]][[9]] 
# omicsList[[i]][[10]] "siteNorm" is  data normalized to the first data set by protein or gene
# omicsList[[i]][[11]] 
# omicsList[[i]][[12]] "prebatch_eset" is the normalized but pre-batch corrected eset, if applicable
# omicsList[[i]][[14]] is the un-normalized eset object - for debugging only
#
############################################

# Import annotation file, data, and make eset objects
g=g.make.omicsList(g)
knitr::opts_chunk$set(fig.path=paste(g$output_files_path,"/Images/", sep=""),messages=FALSE, fig.width=8, fig.height=12, knitr.duplicate.label="allow")

# Check if requirements for differential analysis are met
if( length(g$contrastgroups)<2 ){
  runDifferential <- FALSE;
}

# Run enrichment based on intensity (most intense/least intense) if there's only one group.
runEnrichment <- runDifferential

if(length(g$contrastgroups)<=1){
  if(gsea_section==TRUE){
    enrichr_section<-FALSE;
    runEnrichment <- TRUE;
    g = g.abundance.gsea(g)
  }
}


Session Info

sessionInfo()


cnsb-boston/Omics_Notebook documentation built on July 16, 2022, 4:38 p.m.