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