From ce4635094b0ca0376bf2e2352d7804d29fb7f3fe Mon Sep 17 00:00:00 2001
From: Mike Smith <grimbough@gmail.com>
Date: Thu, 3 May 2018 18:13:48 +0200
Subject: [PATCH] updated bwa example to run longer

---
 exercises/batch_job.sh     |  6 +++++-
 exercises/bwa/bwa_batch.sh | 18 +++++++++++-------
 2 files changed, 16 insertions(+), 8 deletions(-)

diff --git a/exercises/batch_job.sh b/exercises/batch_job.sh
index 7d6ad3b..ee75630 100644
--- a/exercises/batch_job.sh
+++ b/exercises/batch_job.sh
@@ -1,3 +1,7 @@
 #!/bin/bash
 #SBATCH --mem=150
-./hpc_example.py -t 60 -l 2000
+
+srun ./hpc_example.py -t 40 -l 2000
+
+srun --mem=3000 ./hpc_example.py -t 30 -l 80000000
+
diff --git a/exercises/bwa/bwa_batch.sh b/exercises/bwa/bwa_batch.sh
index 9540f7a..7242204 100644
--- a/exercises/bwa/bwa_batch.sh
+++ b/exercises/bwa/bwa_batch.sh
@@ -1,19 +1,23 @@
 #!/bin/bash
-#SBATCH -t 00:15:00
+#SBATCH -t 00:06:00
 #SBATCH --mem=150
 #SBATCH --nodes=1
 
+## load required modules
+module load SAMtools BWA
+
 ## copy data to /scratch and change directory
-cp reference.fa reads.fq $SCRATCHDIR && cd $SCRATCHDIR
+cp /g/huber/users/msmith/embl_hpc/Ecoli_genome.fa.gz /g/huber/users/msmith/embl_hpc/reads_*.fq.gz $SCRATCHDIR 
+cd $SCRATCHDIR
 
 ## create an index
-bwa index reference.fa
+bwa index -p ecoli Ecoli_genome.fa.gz 
 
 ## perform alignment
-bwa aln -I reference.fa reads.fq > out.sai
+bwa mem ecoli reads_1.fq.gz reads_2.fq.gz > aligned.sam
 
-## create SAM file
-bwa samse reference.fa out.sai reads.fq > out.sam
+## create a compressed BAM file
+samtools view -b aligned.sam > aligned.bam
 
 ## copy results back
-cp out.sam $HOME/embl_hpc/exercises/bwa/
+cp aligned.bam $HOME/embl_hpc/exercises/bwa/
-- 
GitLab