-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcallAlign_withDocker.sh
67 lines (65 loc) · 2.95 KB
/
callAlign_withDocker.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
#! /bin/bash
################################################################################
Help()
{
# Display Help
echo "This function takes as input two directories: one of cancer predictions and one of lymphocyte predictions. It will align the predictions and generate percent invasion for all included samples, as well as call class as high or low. It will then run survival analyses and generate descriptive statistics."
echo
echo "Syntax: callAlign [-a|t|T|c|C|s|o|O|w|h]"
echo "options:"
echo "a (Default: blank) If you know the lymph prediction version you used, listing here will automatically define the Lymph threshold. Acceptable options are r (resnet), v (VGG16), or i (Inception)"
echo "t (Default: tilPreds) path to lymph predictions"
echo "T (Default: 0.1; Overwritten if -a is provided) Threshold for lymph presence calling at a patch level"
echo "c (Default: cancPreds) path to cancer predictions"
echo "C (Default: 0.5) Threshold for cancer calling at a patch level "
echo "s (OPTIONAL) Only necessary if file names for Lymph and Cancer preds do not exactly match. Path to dataset csv with 3 columns: 1) Sample name, 2) TIL file name, 3) Canc file name"
echo "o (Default: Percent_Invasion.csv) Name for csv output"
echo "O (Default: outputs) Path to output directory."
echo "w Flag to write PNGs of Tumor-TIL maps. Makes dir PNGs/ within output directory"
echo "S Flag that the cancer prediction file has patch subtype liklihoods"
echo "h Prints this help"
}
################################################################################
## Set Defaults
algorithm='blank'
tilDir='/data/tilPreds'
tilThresh=0.1
cancDir='/data/cancPreds'
cancThresh=0.5
sampFile='blank'
outputFile='Percent_Invasion.csv'
outputDir='/data/outputs'
writePNG=false
subtypes=false
while getopts :ha:t:T:c:C:s:o:O:wS flag
do
case "${flag}" in
h) Help
exit;;
a) algorithm=${OPTARG};;
t) tilDir=${OPTARG};;
T) tilThresh=${OPTARG};;
c) cancDir=${OPTARG};;
C) cancThresh=${OPTARG};;
s) sampFile=${OPTARG};;
o) outputFile=${OPTARG};;
O) outputDir=${OPTARG};;
w) writePNG=true;;
S) subtypes=true;;
esac
done
echo " ======================================================================================== "
echo "Flags specified as the following (BASH parsed): "
echo "algorithm: $algorithm";
echo "tilDir: $tilDir";
echo "tilThresh: $tilThresh";
echo "cancDir: $cancDir";
echo "cancThresh: $cancThresh";
echo "sampFile: $sampFile";
echo "outputFile: $outputFile";
echo "outputDir: $outputDir";
echo "writePNG: $writePNG";
echo "subtypes: $subtypes"
echo " ======================================================================================== "
## Pass these flags to R script for alignment
Rscript commandLineAlign.R $algorithm $tilDir $tilThresh $cancDir $cancThresh $sampFile $outputFile $outputDir $writePNG $subtypes