-
Notifications
You must be signed in to change notification settings - Fork 0
/
regenerate_reports.sh
51 lines (44 loc) · 1.12 KB
/
regenerate_reports.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
#!/bin/bash
# input is a text file of newline separated family ids
family_ids=$1
report_type=$2
echo $family_ids
if [ "$3" = "-dryrun" ]; then
dryrun=true
else
dryrun=false
fi
if [ "$report_type" != "wes" ] && [ "$report_type" != "wes.both" ] && [ "$report_type" != "wgs" ]; then
echo "please pass wes, wes.both, or wgs as second argument"
exit
fi
while read family;
do
# if the family already isn't in the current folder
if [ ! -d $family ]
then
echo "Searching for " $family " in Results"
family_folder=$(ls -d /hpf/largeprojects/ccm_dccforge/dccforge/results/*/$family 2>/dev/null;)
if [ ! -z $family_folder ]
then
ln -s $family_folder .
else
echo "Family " $family " Not Found"
fi
else
echo "Folder for " $family " Already Exists"
fi
# if it was successful or already existed, list all the current reports
if [ -d $family ]
then
echo "Reports:"
ls $family/*20*.csv;
fi
# submit a job to regenerate
if [ "$dryrun" = false ] && [ -d $family ]
then
~/cre/generate_reports.sh $family $report_type
else
echo "dryrun set, will not generate reports for ${family}"
fi
done < ${family_ids}