Skip to content
This repository has been archived by the owner on Feb 16, 2019. It is now read-only.

Commit

Permalink
Merge pull request #29 from jessicamizzi/patch-1
Browse files Browse the repository at this point in the history
Add set -e to scripts in 03-automation
  • Loading branch information
taylorreiter authored Oct 22, 2018
2 parents a1eff96 + 28300e8 commit 330867a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
7 changes: 5 additions & 2 deletions _episodes/03-automation.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,10 @@ $ nano read_qc.sh

**Enter the following pieces of code into your shell script (not into your terminal prompt).**

Our first line will move us into the `untrimmed_fastq/` directory when we run our script.
Our first line will ensure that our script will exit if an error occurs, and is a good idea to include at the beginning of your scripts. The second line will move us into the `untrimmed_fastq/` directory when we run our script.

~~~
set -e
cd ~/dc_workshop/data/untrimmed_fastq/
~~~
{: .output}
Expand Down Expand Up @@ -177,6 +178,7 @@ cat */summary.txt > ~/dc_workshop/docs/fastqc_summaries.txt
Your full shell script should now look like this:

~~~
set -e
cd ~/dc_workshop/data/untrimmed_fastq/
echo "Running FastQC ..."
Expand Down Expand Up @@ -236,7 +238,7 @@ replace SRR2584866_fastqc/Icons/fastqc_icon.png? [y]es, [n]o, [A]ll, [N]one, [r]

We can extend these principles to the entire variant calling workflow. To do this, we will take all of the individual commands that we wrote before, put them into a single file, add variables so that the script knows to iterate through our input files and write to the appropriate output files. This is very similar to what we did with our `read_qc.sh` script, but will be a bit more complex.

Download the script from **ADD DOWNLOAD LINK** (download to ~/dc_workshop/scripts)
Download the script from (here)[https://github.com/data-lessons/wrangling-genomics/blob/gh-pages/files/run_variant_calling.sh] (download to ~/dc_workshop/scripts).

Our variant calling workflow has the following steps:

Expand All @@ -258,6 +260,7 @@ $ less run_variant_calling.sh
The script should look like this:

~~~
set -e
cd ~/dc_workshop/results
genome=~/dc_workshop/data/ref_genome/ecoli_rel606.fasta
Expand Down
3 changes: 0 additions & 3 deletions _extras/guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ This lesson currently uses the `open` command to view FastQC output on its local
## SAMtools or IGV?
Some instructors chose to use SAMtools tview for visualization of variant calling results while other prefer than IGV. SAMtools is the default because installation of IGV can take up additional instruction time, and SAMtools tview is sufficient to visualize results. However, episode 02-variant_calling includes instructions for installation and using IGV.

## A note on the Shell Scripting Episode
At the beginning of the section titled "Automating the Rest of our Variant Calling Workflow", a link to download the script referenced is missing. However, this script is present shortly below in the lesson so it can be passed on to learners in an Etherpad or by referencing the lesson materials page. After presenting the variant calling script in full, the lesson goes through the line by line portions of it.

## Commands with Lengthy Run Times

#### Raw Data Downloads
Expand Down
1 change: 1 addition & 0 deletions files/run_variant_calling.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
set -e
cd ~/dc_workshop/results

genome=~/dc_workshop/data/ref_genome/ecoli_rel606.fasta
Expand Down

0 comments on commit 330867a

Please sign in to comment.