Commit 4f599724 authored by Bhanwar Puniya's avatar Bhanwar Puniya
Browse files

Global sensitivity analysis

parent 6bd1b8ab
####################################################################################################
# This script is for global sensitivity analysis using inputs and output activity levels ####
# obtained from cell collective (https://cellcollective.org/) ####
# Author: Bhanwar Puniya, Ph.D. (bpuniya2@unl.edu) ####
####################################################################################################
# download data of dynamic analyses performed in cell collective ####
# extract all the data ####
# Run this script in the directory ####
####################################################################################################
# install package
install.packages (sensitivity)
#load package
library(sensitivity)
# setwd() directory containing cell collective input and output data
# Read files obtained from cell collective
input= read.csv("(2700-3000)inputs.csv",header=T) #change the file names accordingly.
output= read.csv("(2700-3000)outputs.csv",header=T) #change the file names accordingly.
# remove the components which has zero values in all simulations in input and output files
Avg_col= sapply(input, mean)
x1=which(Avg_col ==0)
new_input=input[-x1]
if(ncol(new_input)==0){
new_input = input
} else {new_input = new_input}
Avg_col2= sapply(output, mean)
x2=which(Avg_col2 ==0)
new_output=output[-x2]
#run sensitiity analysis
x_comb=NULL;
for (j in 1:ncol(new_output))
{
xpcc=pcc(X = new_input, y = new_output[,j],nboot=100)
xpcc = xpcc$PCC$original
x_comb = cbind(x_comb,xpcc)
###uncomment below (and comment above three lines) if you want to use SRC method ###
#xsrc = src(X = new_input, y = new_output[,j],nboot=100)
#xsrc = xsrc$SRC$original
#x_comb = cbind(x_comb,xsrc)
}
rownames(x_comb) = names(new_input)
colnames(x_comb) = names(new_output)
# write outputs in table
write.table(x_comb,"outfile.txt", sep ="\t")
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment