comparison test-data.sh @ 2:2a90d2fd3336 draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit f2a33fe115fef9d711112b53136cf7619f1b19be"
author iuc
date Mon, 16 Mar 2020 08:41:08 -0400
parents
children
comparison
equal deleted inserted replaced
1:fa11922f3d91 2:2a90d2fd3336
1 #!/usr/bin/env bash
2
3 # install conda
4 if type conda > /dev/null; then
5 true
6 else
7 tmp=$(mktemp -d)
8 wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
9 bash Miniconda3-latest-Linux-x86_64.sh -b -p "$tmp/miniconda"
10 source "$tmp/miniconda/bin/activate"
11 fi
12
13 eval "$(conda shell.bash hook)"
14
15 # install conda env
16 if grep -Fq __bioconductor-dada2@1.14 <<< $(conda env list); then
17 true
18 else
19 conda create -y --quiet --override-channels --channel conda-forge --channel bioconda --channel defaults --name __bioconductor-dada2@1.14 bioconductor-dada2=1.14
20 fi
21
22 conda activate __bioconductor-dada2@1.14
23
24 # create test data
25 cd test-data/
26
27 # download Mothur SOP data from zenodo (GTN), same as
28 # http://www.mothur.org/w/images/d/d6/MiSeqSOPData.zip but stable links
29 # but file names need to be fixed
30 wget -nc -O F3D0_S188_L001_R1_001.fastq https://zenodo.org/record/800651/files/F3D0_R1.fastq?download=1
31 wget -nc -O F3D0_S188_L001_R2_001.fastq https://zenodo.org/record/800651/files/F3D0_R2.fastq?download=1
32 wget -nc -O F3D141_S207_L001_R1_001.fastq https://zenodo.org/record/800651/files/F3D141_R1.fastq?download=1
33 wget -nc -O F3D141_S207_L001_R2_001.fastq https://zenodo.org/record/800651/files/F3D141_R2.fastq?download=1
34
35 # zip and reduce data to ~ 10% (for speed)
36 for i in *fastq
37 do
38 head -n 3000 "$i" | gzip -c > "$i.gz"
39 done
40 rm *fastq
41
42 # download data bases from https://zenodo.org/record/158955
43 # as mentioned in https://benjjneb.github.io/dada2/training.html
44 wget -nc -O reference.fa.gz https://zenodo.org/record/158955/files/rdp_train_set_14.fa.gz?download=1
45 wget -nc -O reference_species.fa.gz https://zenodo.org/record/158955/files/rdp_species_assignment_14.fa.gz?download=1
46
47 # take ~ 5% of the reference (for speed)
48 zcat reference.fa.gz | head -n 1000 | gzip -c > t && mv t reference.fa.gz
49 zcat reference_species.fa.gz | head -n 1000 | gzip -c > t && mv t reference_species.fa.gz
50
51
52 # generate outputs
53 Rscript gentest.R
54
55 conda deactivate
56
57 # # remove files only needed for test generation
58 # rm learnErrors_F3D0_R2.pdf dada_F3D0_R2.Rdata