-
Notifications
You must be signed in to change notification settings - Fork 1
/
Flumina
84 lines (59 loc) · 1.9 KB
/
Flumina
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
#!/bin/bash
date
# Check if a configuration file was provided
if [ -z "$1" ]; then
echo "Usage: $0 path_to_config_file needed."
exit 1
fi
CONFIG_FILE="$1"
# Check if the configuration file exists
if [ ! -f "$CONFIG_FILE" ]; then
echo "Error: Configuration file not found at $CONFIG_FILE"
exit 1
fi
# Source the configuration file
source "$CONFIG_FILE"
echo "Configuration file successfully loaded"
mkdir "$OUTPUT_DIRECTORY"
echo "Beginning read organization ... "
Rscript Scripts/organizeReads.R "$CONFIG_FILE"
echo "Beginning reference creation ... "
#Sets custom snakemake parameters
if [ "$FORCE_UNLOCK" = "TRUE" ]; then
NOLOCK="--nolock"
else
NOLOCK=""
fi
if [ "$CLUSTER_JOBS" != "FALSE" ]; then
CLUSTER="--cluster \"$CLUSTER_JOBS\""
else
CLUSTER=""
fi
#Sets the snakefile to use when disabling IRMA
if [ "$DISABLE_IRMA" == "TRUE" ]; then
IRMA_RUN="Scripts/snakefile_process_SNPs.smk"
else
IRMA_RUN="Scripts/snakefile_process_IRMA_SNPs.smk"
fi
#Copies reference to output directory so snakefile can find it
cp "$REFERENCE_FILE" "$OUTPUT_DIRECTORY"/reference.fa
#Export variable to global env
export CLUSTER_JOBS
#Runs make the reference snakemake function
snakemake --snakefile Scripts/snakefile_make-reference.smk --directory "$OUTPUT_DIRECTORY" -j $THREADS $NOLOCK
#Runs SNV calling pipeline
echo "Beginning SNV calling pipeline ... "
if [ "$CLUSTER_JOBS" != "FALSE" ]; then
snakemake --snakefile $IRMA_RUN --directory "$OUTPUT_DIRECTORY" -j $THREADS $NOLOCK --cluster "$CLUSTER_JOBS"
else
snakemake --snakefile $IRMA_RUN --directory "$OUTPUT_DIRECTORY" -j $THREADS $NOLOCK
fi
#Organizes IRMA only when not disabled
if [ "$DISABLE_IRMA" == "FALSE" ]; then
Rscript Scripts/organizeIRMA.R "$CONFIG_FILE"
fi
Rscript Scripts/convertVCFtoTable.R "$CONFIG_FILE"
Rscript Scripts/findAAChanges.R "$CONFIG_FILE"
Rscript Scripts/outputSummary.R "$CONFIG_FILE"
date
# End of file