-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathrun_analysis.sh
93 lines (73 loc) · 2.45 KB
/
run_analysis.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#!/bin/bash
# Inputs definition
INFOLD='data/' # folder where all the input data is stored (genotype, phenotype, etc.)
MAPPING='gene_snps_index.pkl' # name of the gene-snps mapping file
NETWORK='PPI_adj.pkl' # name of the PPI network file
GENOTYPE='genotype' # name of the genotype file
PHENO="y_50.pheno" # name of the phenotype file
# Parameters definition
NPERM=100 # number of permutations
KERNEL='lin' # type of kernel. Either linear or polynomial
Q1=0.05 # FDR level to control for
# Output definitions
SETTINGS='results/settings/' # where to store the aggregated neighborhoods on the original setting
PERMNW='results/settings/permutations/networks/' # where to store the permuted networks
PERMNB='results/settings/permutations/neighborhoods/' # where to store the aggregated neighborhoods on the permuted settings
ORIGINAL="results/llr/" # where to store the lrt statistic(s) on the original setting(s)
PERMUTED='results/llr/permuted/' # where to store the lrt statistics on the permuted settings
NULLDIR='results/null_distr/' # where to store the distribution of the statistics under the null hypothesis
PVALDIR='results/pvals/' # where to store the p-values
echo "1. Neighborhood aggregation..."
python3 1_nb_aggregation.py \
--i $INFOLD \
--o $SETTINGS \
--g2s $MAPPING \
--bim "$GENOTYPE".bim \
--nw $NETWORK \
--nbs neighborhoods.txt
echo "2. Permuted settings computation..."
python3 2_circPerm_nwPerm.py \
--i $INFOLD \
--g2s $MAPPING \
--bim "$GENOTYPE".bim \
--nw $NETWORK \
--perm $NPERM \
--alpha 0.5 \
--seed 42 \
--onwdir $PERMNW \
--onbdir $PERMNB \
--onw nw_ \
--onb nbs_
echo "3. Lrt calculation on the non-permuted setting..."
python3 3_LMM.py \
--genotype "$INFOLD""$GENOTYPE" \
--phenotype "$INFOLD""$PHENO" \
--nbs "$SETTINGS"neighborhoods.txt \
--kernel $KERNEL \
--odir "$ORIGINAL" \
--ofile llr.pkl
echo "4. Lrt calculation on the permuted settings..."
python3 3_LMM.py \
--genotype "$INFOLD""$GENOTYPE" \
--phenotype "$INFOLD""$PHENO" \
--nbs "$PERMNB"nbs_ \
--kernel $KERNEL \
--j 0 $NPERM \
--odir $PERMUTED \
--ofile llr_
echo "5. p-values calculation..."
python3 4_obtain_pvals.py \
--inpath "$ORIGINAL"llr.pkl \
--inpathperm "$PERMUTED"llr_ \
--nperm $NPERM \
--dirnd $NULLDIR \
--dirpv $PVALDIR \
--fignd null_distr.png \
--figpv qqplot.png \
--outpathnd null_distr.pkl \
--outpathpv pvals.pkl
echo "6. Associated neighborhoods..."
python3 5_associated_neighborhoods.py \
--nw "$INFOLD""$NETWORK" \
--pv "$PVALDIR"pvals.pkl \
--q1 $Q1