-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy path11b_Microbial_network.sh
64 lines (52 loc) · 1.33 KB
/
11b_Microbial_network.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/bin/bash
helpdoc(){
cat <<EOF
Description:
This is a help document
- Calculate Microbial Co-occurrence Network
Usage:
$0 -W <workplace> -i <input microbiota file> -o <output file> -t <threads>
Option:
-w workplace
-i input microbiota file
-o output file
-t threads
EOF
}
#getopts
if [ "$1" == "-h" ]
then
helpdoc
exit 1
fi
if [ $# == 0 ]
then
helpdoc
exit 1
fi
while getopts ":W:i:o:t:" opt
do
case $opt in
W)
workplace=`echo $OPTARG`
;;
i)
inputfile=`echo $OPTARG`
;;
o)
outputfile=`echo $OPTARG`
;;
t)
threads=`echo $OPTARG`
;;
?)
echo "Undefined parameter"
exit 1;;
esac
done
fastspar --threads $threads --otu_table $workplace$inputfile --correlation ${workplace}median_correlation.tsv --covariance ${workplace}median_covariance.tsv
mkdir ${workplace}bootstrap_feat
fastspar_bootstrap --otu_table $workplace$inputfile --number 1000 --prefix ${workplace}bootstrap_feat/feat
mkdir ${workplace}$outputfile
parallel fastspar --otu_table {} --correlation $workplace$outputfile/cor_{/} --covariance $workplace$outputfile/cov_{/} -i 5 ::: ${workplace}bootstrap_feat/*
fastspar_pvalues --otu_table $workplace$inputfile --correlation ${workplace}median_correlation.tsv --prefix $workplace$outputfile/cor_ --permutations 1000 --outfile ${workplace}pvalues.tsv