Skip to content

Commit fac28ad

Browse files
committed
Fixed syntax in excercise answers
1 parent 18aef74 commit fac28ad

File tree

2 files changed

+25
-23
lines changed

2 files changed

+25
-23
lines changed

_episodes/01-unix.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -482,8 +482,8 @@ Using UNIX commands
482482
3. Using the new file, create a table to sort the table by gene GC content.
483483
4. Create a table with only the gene names but replace the name SCAB with SCABIES.
484484

485-
<details>
486-
<summary> Click here for answer. </summary>
485+
<details markdown=1>
486+
<summary> Click here for answer.</summary>
487487

488488
```sh
489489
# 1

_episodes/03-blast.md

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ We will use bacterial spot causing *Xanthomonas* and one of the conserved effect
6262
Note: Effectors are proteins secreted by pathogenic bacteria into the host cells.
6363
Note: *avrBs2* is one of the most studied and conserved effector gene found in multiple *Xanthomonas* species.
6464

65-
In the folder `/blue/share/bacteria_genomes/xanthomonas/`, there are few *Xanthomonas* species genomes.
65+
In the folder `/blue/share/xanthomonas/`, there are few *Xanthomonas* species genomes.
6666

6767
- *Xanthomonas euvesicatoria* &rarr; `Xeu.fasta`
6868
- *Xanthomonas perforans* &rarr; `Xp.fasta`
@@ -78,7 +78,7 @@ Before starting, copy all the required files to your working directory.
7878
```sh
7979
$ cd /blue/general_workshop/<username>
8080

81-
$ cp ../share/bacteria_genomes/xanthomonas ./
81+
$ cp ../share/xanthomonas ./
8282

8383
$ ls
8484
strep slurm xanthomonas
@@ -104,22 +104,22 @@ which in our case are the genome files `Xeu.fasta`, `Xp.fasta`, `Xg.fasta`, and
104104
is used for creating BLAST databases from FASTA files.
105105

106106
```sh
107-
$ makeblastdb -in Xeu.fasta -dbtype nucl
107+
$ makeblastdb -in Xeu.fasta -out Xeu -dbtype nucl
108108

109109
Building a new DB, current time: 09/06/2020 23:17:22
110-
New DB name: /blue/general_workshop/<username>/xanthomonas/Xeu.fasta
110+
New DB name: /blue/general_workshop/<username>/xanthomonas/Xeu
111111
New DB title: Xeu.fasta
112112
Sequence type: Nucleotide
113113
Keep MBits: T
114114
Maximum file size: 1000000000B
115115
Adding sequences from FASTA; added 3 sequences in 0.0926349 seconds.
116116

117117
$ ls
118-
avrBs2.fasta Xc.fasta Xeu.fasta Xeu.fasta.ndb Xeu.fasta.nhr
119-
Xeu.fasta.nin Xeu.fasta.not Xeu.fasta.nsq Xeu.fasta.ntf Xeu.fasta.nto
120-
Xg.fasta Xp.fasta
118+
avrBs2.fasta Xc.fasta Xeu.fasta Xeu.ndb Xeu.nhr
119+
Xeu.nin Xeu.not Xeu.nsq Xeu.ntf Xeu.nto
120+
Xg.fasta Xp.fasta
121121
```
122-
Tip: `makeblastdb -h` command displays options avaialbe for `makeblstdb`.
122+
Tip: `makeblastdb -h` command displays options avaialbe for `makeblastdb`.
123123

124124
Note that new database files with extensions `.ndb`, `.nhr`, `.nsq` etc. have been created.
125125

@@ -136,21 +136,25 @@ Extension - ‘.fasta’.
136136
We can specify all files in current path with fasta extension by `./*.fasta`.
137137

138138
```sh
139-
$ for genome in ./*.fasta; do makeblastdb -in "${genome}" --dbtype nucl; done
139+
$ genomes=`ls *.fasta | sed 's/.fasta//g'`
140+
141+
$ for genome in $genomes; do makeblastdb -in "$genome.fasta" -out $genome -dbtype nucl; done
140142
```
141143
Tip: Short loops can be written in a same line by separating commands with `;`.
142144
`;` is equivalent to pressing <kbd>Enter</kbd>.
143145

146+
Tip: `sed` command is used to remove `.fasta` extension from list of names.
147+
144148
### Performing BLAST search
145149

146150
We are now ready to do a BLAST search. Since both the query (`avrBs2.fasta`)
147151
and the database are nucleotide sequences, we will perform `blastn`.
148152

149153
```sh
150-
$ blastn -query avrBs2.fas -db Xeu.fasta -out Xeu_avrBs2.out -outfmt 0 -evalue 0.001
154+
$ blastn -query avrBs2.fas -db Xeu -out Xeu_avrBs2.out -outfmt 0 -evalue 0.001
151155

152156
$ ls
153-
avrBs2.fasta Xeu_avrBs2.out Xc.fasta Xeu.fasta Xeu.fasta.ndb
157+
avrBs2.fasta Xeu_avrBs2.out Xc.fasta Xeu.fasta Xeu.ndb
154158
...
155159
...
156160
```
@@ -182,8 +186,6 @@ Xc
182186
-----------------------------------------------------------------------------------------------
183187
```
184188

185-
Note, we are not putting `.fasta` part of the database. This is come handy later in naming outputs.
186-
187189
Press <kbd>Ctrl</kbd>+<kbd>o</kbd> (<kbd>Cmd</kbd>+<kbd>o</kbd> in MacOS) to save the file.
188190
Give it a name `dblist.txt` and press <kbd>Enter</kbd>.
189191

@@ -194,23 +196,23 @@ Now we can run the `blastn` in loop.
194196
```sh
195197
$ while read -r dbname
196198
$ do
197-
$ blastn -query avrBs2.fas -db "$dbname.fasta" -out $dbname"_avrBs2.out" -outfmt 0 -evalue 0.001
199+
$ blastn -query avrBs2.fas -db "$dbname" -out $dbname"_avrBs2.out" -outfmt 0 -evalue 0.001
198200
$ done < dblist.txt
199201
```
200202

201203
Note: BLAST+ also includes a command `blastdb_aliastool` for combining databases;
202204
however, it is outside the scope of this workshop.
203205

204206
```sh
205-
$ blastdb_aliastool -dblist "Xeu.fasta Xp.fasta Xg.fasta Xc.fasta" -dbtype nucl -out xanthomonas_all -title "Xanthomonas genomic"
207+
$ blastdb_aliastool -dblist "Xeu Xp Xg Xc" -dbtype nucl -out xanthomonas_all -title "Xanthomonas genomic"
206208
```
207209

208210
## Exercise: Performing blast search in SLURM
209211

210212
We can also run `blast` as a SLURM job, which is useful for long and resource intensive search.
211213

212214
The SLURM submission script is available in `/blue/general_workshop/share/scripts/slurm_blast.sh`.
213-
Genome and query files are available in `/blue/general_workshop/share/bacteria_genomes/xanthomonas`
215+
Genome and query files are available in `/blue/general_workshop/share/xanthomonas`
214216

215217
1. Change your location to your working directory `/blue/general_workshop/&lt;username&gt;`
216218
2. Make a folder in your working directory called `slurm_blast` and enter that directory.
@@ -221,32 +223,32 @@ Genome and query files are available in `/blue/general_workshop/share/bacteria_g
221223
7. Check status of the job as it is running.
222224
8. After job is completed, check the list of files in current directory.
223225

224-
<details>
226+
<details markdown="1">
225227
<summary> Click here for answer. </summary>
226228

227229
```sh
228230
#1
229-
$ cd /blue/general_workshop/<username>
231+
$ cd /blue/general_workshop/&lt;username&gt;
230232

231233
#2
232234
$ mkdir slurm_blast
233235

234236
$ cd slurm_blast
235237

236238
#3
237-
$ cp /blue/general_workshop/share/bacteria_genomes/xanthomonas/* ./
239+
$ cp /blue/general_workshop/share/xanthomonas/* ./
238240

239241
#4
240242
$ cp /blue/general_workshop/share/scripts/slurm_blast.sh ./
241243

242244
#5
243-
$ nano slurm_blast.sh > edit email > Ctrl+x > y
245+
$ nano slurm_blast.sh &rarr; edit email &rarr; Ctrl+x $rarr; y
244246

245247
#6
246248
$ sbatch slurm_blast.sh
247249

248250
#7
249-
$ squeue -u <username>
251+
$ squeue -u &lt;username&gt;
250252

251253
#8
252254
$ ls

0 commit comments

Comments
 (0)