-
Notifications
You must be signed in to change notification settings - Fork 8
/
splicing_outlier_analysis.sh
69 lines (51 loc) · 1.84 KB
/
splicing_outlier_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
#!/bin/bash
# This script handle the splice junction analysis for every rare disease case on a given tissue
# start point is metadata file
# gives the list of case and controls for each case.
#For each case we need to:
#-create a folder
#-make a list of case and controls
#-run the splicing analysis script
#-filter results.
##--- Variables
metadata_file=$1 # file containing data origin and status information
tissue=$2 # what tissue is the analysis made (example "Blood")
junc_dir=$3 # directory containg filtered junctions
out_dir=$4 # output directory
freeze=$5 # set of samples to use (yes or no)
DGN=$6 # use DGN in control (yes or no)
PIVUS=$7 # use PIVUS as controls (yes or no)
date
echo ""
# Create output dir if does not exist
if [[ ! -e $out_dir ]]; then
mkdir $out_dir
elif [[ ! -d $out_dir ]]; then
echo "$out_dir already exists but is not a directory" 1>&2
fi
# Organize results directory and create case control lists
echo "Organize results directory and create case control lists"
echo ""
/users/lfresard/R_3.3.2/bin/Rscript make_list_junction_files.R --meta $metadata_file --tissue $tissue --outdir $out_dir --juncdir $junc_dir --freeze $freeze --DGN $DGN --PIVUS $PIVUS
wait
# Run junction outlier analysis
echo "Run junction outlier analysis"
echo ""
if [[ $DGN == TRUE ]]; then
outPrefix='RD_DGN_freeze'
list_junc=list_junctions_freeze_RD_DGN.txt
meta_file=sample_affected_status_freeze_RD_DGN.tsv
elif [[ $PIVUS == TRUE ]]; then
outPrefix='RD_PIVUS_freeze'
list_junc=list_junctions_freeze_RD_PIVUS.txt
meta_file=sample_affected_status_freeze_RD_PIVUS.tsv
else
outPrefix='RD_freeze'
list_junc=list_junctions_freeze_RD.txt
meta_file=sample_affected_status_freeze_RD.tsv
fi
python splicing_outlier.py --juncfiles ${list_junc} --outprefix ${outPrefix} --meta_file ${meta_file} --rundir ${out_dir}
wait
echo "Done"
echo ""
date