-
Notifications
You must be signed in to change notification settings - Fork 25
/
walkthrough.sh
executable file
·165 lines (134 loc) · 4.33 KB
/
walkthrough.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
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
#!/usr/bin/env bash
#
# Description: carries out walkthrough as described in `pdp` documentation,
# and provides alternative workflows, where primer design locations are filtered.
# Usage: walkthrough.sh
# Which primer design tool are we using
PRIMERTOOL=primer3
# Uncomment below to use eprimer3 instead
# PRIMERTOOL=eprimer3
# THERMODYNAMIC PARAMETERS FOR PRIMER3
PRIMER3PARAMS=tests/test_input/primer3/primer3_config
# 1. Clean walkthrough output
OUTDIR=tests/walkthrough
DATADIR=tests/walkthrough_data
rm -rf ${OUTDIR}
mkdir -p ${OUTDIR}
# 2. Standard workflow (no filtering)
# Validate config file
pdp config --validate ${DATADIR}/pectoconf.tab
# Fix input sequences
pdp config --fix_sequences ${OUTDIR}/fixed.json \
--outdir ${OUTDIR}/config \
${DATADIR}/pectoconf.tab
# Design primers
mkdir -p ${OUTDIR}/${PRIMERTOOL}
pdp ${PRIMERTOOL} -f \
--outdir ${OUTDIR}/${PRIMERTOOL} \
--therm_param_path ${PRIMER3PARAMS} \
${OUTDIR}/fixed.json \
${OUTDIR}/with_primers.json
# Remove redundant primers
pdp dedupe -f \
--dedupedir ${OUTDIR}/deduped \
${OUTDIR}/with_primers.json \
${OUTDIR}/deduped_primers.json
# Screen deduped primers against BLAST db
pdp blastscreen -f \
--db ${DATADIR}/blastdb/e_coli_screen.fna \
--outdir ${OUTDIR}/blastn \
${OUTDIR}/deduped_primers.json \
${OUTDIR}/screened.json
# Cross-hybridise primers against input genomes
pdp primersearch -f \
--outdir ${OUTDIR}/primersearch \
${OUTDIR}/screened.json \
${OUTDIR}/primersearch.json
# Classify primers
pdp classify -f \
${OUTDIR}/primersearch.json \
${OUTDIR}/classify
# Extract amplicons
pdp extract -f \
${OUTDIR}/primersearch.json \
${OUTDIR}/classify/Pectobacterium_primers.json \
${OUTDIR}/extract
# Display results
cat ${OUTDIR}/classify/summary.tab
printf "\n"
cat ${OUTDIR}/extract/Pectobacterium_primers/distances_summary.tab
printf "\n"
# 3. Only use primers that are located in CDS regions
# Here, we can start from the fixed.json file created above
pdp filter -f \
--prodigal \
--outdir ${OUTDIR}/prodigalcds \
${OUTDIR}/fixed.json \
${OUTDIR}/filter_prodigal.json
pdp ${PRIMERTOOL} -f \
--filter \
--outdir ${OUTDIR}/${PRIMERTOOL}_cds \
--therm_param_path ${PRIMER3PARAMS} \
${OUTDIR}/filter_prodigal.json \
${OUTDIR}/with_cds_primers.json
pdp dedupe -f \
--dedupedir ${OUTDIR}/deduped_cds \
${OUTDIR}/with_cds_primers.json \
${OUTDIR}/deduped_cds_primers.json
pdp blastscreen -f \
--db ${DATADIR}/blastdb/e_coli_screen.fna \
--outdir ${OUTDIR}/blastn_cds \
${OUTDIR}/deduped_cds_primers.json \
${OUTDIR}/screened_cds.json
pdp primersearch -f \
--outdir ${OUTDIR}/primersearch_cds \
${OUTDIR}/screened_cds.json \
${OUTDIR}/primersearch_cds.json
pdp classify -f \
${OUTDIR}/primersearch_cds.json \
${OUTDIR}/classify_cds
pdp extract -f \
${OUTDIR}/primersearch_cds.json \
${OUTDIR}/classify_cds/Pectobacterium_primers.json \
${OUTDIR}/extract_cds
cat ${OUTDIR}/classify_cds/summary.tab
printf "\n"
cat ${OUTDIR}/extract_cds/Pectobacterium_primers/distances_summary.tab
printf "\n"
# 4. Only use primers that are located in intergenic regions
# Again, we can start from the fixed.json file created above
pdp filter -f \
--prodigaligr \
--outdir ${OUTDIR}/prodigaligr \
${OUTDIR}/fixed.json \
${OUTDIR}/filter_prodigaligr.json
pdp ${PRIMERTOOL} -f \
--filter \
--outdir ${OUTDIR}/${PRIMERTOOL}_igr \
--therm_param_path ${PRIMER3PARAMS} \
${OUTDIR}/filter_prodigaligr.json \
${OUTDIR}/with_igr_primers.json
pdp dedupe -f \
--dedupedir ${OUTDIR}/deduped_igr \
${OUTDIR}/with_igr_primers.json \
${OUTDIR}/deduped_igr_primers.json
pdp blastscreen -f \
--db ${DATADIR}/blastdb/e_coli_screen.fna \
--outdir ${OUTDIR}/blastn_igr \
${OUTDIR}/deduped_igr_primers.json \
${OUTDIR}/screened_igr.json
pdp primersearch -f \
--outdir ${OUTDIR}/primersearch_igr \
${OUTDIR}/screened_igr.json \
${OUTDIR}/primersearch_igr.json
pdp classify -f \
${OUTDIR}/primersearch_igr.json \
${OUTDIR}/classify_igr
pdp extract -f \
${OUTDIR}/primersearch_igr.json \
${OUTDIR}/classify_igr/Pectobacterium_primers.json \
${OUTDIR}/extract_igr
cat ${OUTDIR}/classify_igr/summary.tab
printf "\n"
cat ${OUTDIR}/extract_igr/Pectobacterium_primers/distances_summary.tab
printf "\n"