Debian Codegraph @

paper/containers/data/simulated/build.sh

raw
1 #!/bin/bash
2 # This script simulates reads using ART (Huang et al. 2012) that was modified to add adapter sequences
3 # (Jiang et al. 2014). We simulated ~1M 125 bp PE reads (0.1x genome coverage) using the empirically
4 # determined quality score profile (based on data derived from real HiSeq 2500 sequencing reads) -
5 # which has an overall error rate of 0.11% - and transformations of the empircal profile for which the
6 # quality score distribution was artificially left-shifited to result in higher overall error rates of
7 # 0.5% and 1%.
8 #
9 # References:
10 # Huang et al. 2012, http://bioinformatics.oxfordjournals.org/content/28/4/593.full
11 # Jiang et al. 2014, http://bmcbioinformatics.biomedcentral.com/articles/10.1186/1471-2105-15-182
12
13 # Generate error-shifted read quality profiles
14 R_CMD="docker run --rm -v "$PWD":/home/docker -w /home/docker -u docker r-base Rscript --vanilla"
15 for err in 005 01
16 do
17 for mate in 1 2
18 do
19 $R_CMD adjust_error_profiles.R -g -p art_profiles/HiSeq2500L125R${mate}_001.txt -o art_profiles/data/HiSeq2500L125R${mate}_${err}.txt -e 0.${err} -t art_profiles.txt
20 done
21 done
22
23 # Variables used in read simulation
24 seed=42
25 read_len=125
26 mean_frag=200
27 sd_frag=100
28 cov=0.1
29
30 # prepare the reference genome data volume
31 docker create -v /data/reference/hg37 --name hg37 jdidion/hg37_reference
32 REF_GENOME="/data/reference/hg37/hg37.fa"
33 # Simulate reads
34 ART_CMD="docker run --rm -v "$PWD":/art --volumes-from hg37 -w /art jdidion/art_skewer art_illumina"
35 for prof in 001 005 01
36 do
37 $ART_CMD -i $REF_GENOME -p -l $read_len -f $cov -m $mean_frag -s $sd_frag -rs $seed -o sim_${prof} \
38 -1 art_profiles/HiSeq2500L125R1_${prof}.txt \
39 -2 art_profiles/HiSeq2500L125R2_${prof}.txt
40 # rename and fix files
41 for mate in 1 2
42 do
43 for ext in aln fq
44 do
45 mv sim_${prof}${mate}.${ext} sim_${prof}.${mate}.${ext}
46 # There is a bug in the modified ART in which reads that are shorter
47 # than the read length even with the adapter apended have null characters
48 # tacked on to the end. We replace them with 'A's.
49 perl -pe 's/\x00/A/g' sim_${prof}.${mate}.${ext}
50 done
51 done
52 done
53
54 docker build -f Dockerfile -t jdidion/atropos_simulated .