-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathScript_for_denovo_s3
More file actions
103 lines (80 loc) · 2.67 KB
/
Copy pathScript_for_denovo_s3
File metadata and controls
103 lines (80 loc) · 2.67 KB
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#!/bin/bash
#This is used in my Docker container
##PATH
#DRAP install directory in the Docker container
cd /usr/local/src/drap
#DRAP configuration PATH
cd /usr/local/src/drap/cfg
#Edit configuration (change "local_cpu" and "n_cpu")
vi /usr/local/src/drap/cfg/drap.cfg
#Trimmed and filtered by Kraken2 sequence PATH
cd /mnt/data/pri_data/kraken
##Step 1: merge samples from brain and skin(R) separately, forward and reverse reads (1 and 2).
cd /mnt/data/pri_data/kraken && pwd && ls
# Merge all uf*B_1.fq.gz into one compressed file
cat uf*B_1.fq.gz > merged_B_1.fq.gz
# Merge all uf*B_2.fq.gz into one compressed file
cat uf*B_2.fq.gz > merged_B_2.fq.gz
# Merge all uf*R_1.fq.gz into one compressed file
cat uf*R_1.fq.gz > merged_R_1.fq.gz
# Merge all uf*R_2.fq.gz into one compressed file
cat uf*R_2.fq.gz > merged_R_2.fq.gz
##Step 2: run DRAP for denovo assembly
cd /usr/local/src/drap && pwd && ls
###ONLY DO THIS IF YOU RUN THIS FOR THE FIRST TIME###
#Edit the CPU number used in tgicl (It always fails when more than 6 CPUs are used here). This is a tool used in step 5.
vi /usr/local/src/drap/bin/runAssembly.sh
# Change the second line into the following command
tgicl all_dbg.fa -c 6 -l 60 -p 96 -s 100000
###
#######auto_drap.sh######
#####Following script can be saved as a shell script to let it run automatically (to better arrange time)###
#!/bin/bash
set -euo pipefail
# Function to run a command and check for errors
run_step() {
local step_name="$1"
shift
echo "=== Starting: $step_name ==="
if "$@"; then
echo "=== $step_name completed successfully ==="
else
echo "!!! ERROR: $step_name failed. Stopping pipeline. !!!"
exit 1
fi
}
# Step 1: runDrap for brain samples
run_step "runDrap (brain)" \
runDrap \
--outdir /mnt/data/out_drap_s3_b \
--R1 /mnt/data/pri_data/kraken/merged_B_1.fq.gz \
--R2 /mnt/data/pri_data/kraken/merged_B_2.fq.gz \
--dbg trinity \
--no-trim \
--norm-mem 200 \
--dbg-mem 200 \
--discardN \
--coverage 0,0.5,1 \
--no-rate
# Step 2: runDrap for skin samples
run_step "runDrap (skin)" \
runDrap \
--outdir /mnt/data/out_drap_s3_r \
--R1 /mnt/data/pri_data/kraken/merged_R_1.fq.gz \
--R2 /mnt/data/pri_data/kraken/merged_R_2.fq.gz \
--dbg trinity \
--no-trim \
--norm-mem 200 \
--dbg-mem 200 \
--discardN \
--coverage 0,0.5,1 \
--no-rate
# Step 3: runMeta to merge both assemblies, remember to add "--no-rate", or it will take longer...
run_step "runMeta (merge brain + skin)" \
runMeta \
--drap-dirs /mnt/data/out_drap_s3_b,/mnt/data/out_drap_s3_r \
--outdir /mnt/data/meta_s3 \
--coverage 0,0.5,1 \
--no-rate
echo "=== All steps completed successfully! ==="
############