-
Notifications
You must be signed in to change notification settings - Fork 3
/
hicdoc.sh
executable file
·70 lines (58 loc) · 1.77 KB
/
hicdoc.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
#!/bin/bash
PARAMS=""
while (( "$#" )); do
# split --option=something into 2 variables
[[ $1 == --*=* ]] && set -- "${1%%=*}" "${1#*=}" "${@:2}"
case "$1" in
-i)
input="$2"
shift 2
;;
-d)
outdir="${2%/}"
shift 2
;;
--) # end argument parsing
shift
break
;;
-*|--*) # unsupported flags
echo "Error: Unsupported flag $1" >&2
exit 1
;;
*) # preserve positional arguments
PARAMS="$PARAMS \"$1\""
shift
;;
esac
done
# set positional arguments in their proper place
eval set -- "$PARAMS"
scriptdir="$(dirname "$(readlink -f "$0")")"
mkdir -p "$outdir"
printf "\n\e[1;32mNormalizing technical biases with cyclic loess\e[0m\n"
"$scriptdir"/normalize_cyclic_loess.r \
-i "$input" \
-o "$outdir"/normalized.tsv
printf "\n\e[1;32mNormalizing biological biases with Knight-Ruiz\e[0m\n"
"$scriptdir"/normalize_knight_ruiz.py \
-i "$outdir"/normalized.tsv \
-o "$outdir"/normalized.tsv
printf "\n\e[1;32mNormalizing distance effect with combined RNR\e[0m\n"
"$scriptdir"/normalize_distance_rnr_combined.py \
-i "$outdir"/normalized.tsv \
-o "$outdir"/normalized.tsv
printf "\n\e[1;32mDetecting compartments\e[0m\n"
"$scriptdir"/detect_constrained_k_means.py \
-i "$outdir"/normalized.tsv \
-o "$outdir"/compartments.tsv \
--concordance "$outdir"/concordance.tsv \
--silhouette "$outdir"/silhouette.tsv \
--distances "$outdir"/distance1.tsv "$outdir"/distance2.tsv
printf "\n\e[1;32mPlotting compartment changes\e[0m\n"
"$scriptdir"/plot_compartment_changes.py \
-i "$outdir"/compartments.tsv \
-p "$outdir"/compartments \
--concordance "$outdir"/concordance.tsv \
--silhouette "$outdir"/silhouette.tsv \
--distances "$outdir"/distance1.tsv "$outdir"/distance2.tsv