Skip to content

Commit 7dc6d4e

Browse files
committed
Added more complete a long example about running a workflow with a pre-determined set of parameters
1 parent 30505e8 commit 7dc6d4e

File tree

2 files changed

+99
-0
lines changed

2 files changed

+99
-0
lines changed
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
#!/bin/bash
2+
3+
workdir="$(mktemp -d --tmpdir treecript_demo_nextflow.XXXXXXXXXX)"
4+
#workdir=/tmp/ATINA/WORKDIR
5+
#mkdir -p "$workdir"
6+
7+
cleanup() {
8+
set +e
9+
# This is needed in order to avoid
10+
# potential "permission denied" messages
11+
chmod -R u+w "${workdir}"
12+
rm -rf "${workdir}"
13+
}
14+
15+
trap cleanup EXIT
16+
17+
downloadDir="${workdir}/downloads"
18+
mkdir -p "${downloadDir}"
19+
20+
jvm=https://github.com/AdoptOpenJDK/openjdk11-upstream-binaries/releases/download/jdk-11.0.16%2B8/OpenJDK11U-jdk-shenandoah_x64_linux_11.0.16_8.tar.gz
21+
#nextflow=https://github.com/nextflow-io/nextflow/releases/download/v24.04.0/nextflow-24.04.0-all
22+
nextflow=https://github.com/nextflow-io/nextflow/releases/download/v19.04.1/nextflow-19.04.1-all
23+
workflow=https://github.com/inab/Wetlab2Variations/archive/31348ed533961f84cf348bf1af660ad9de6f870c.zip
24+
25+
declare -a general_rawreads=(
26+
ftp://ftp-trace.ncbi.nih.gov/giab/ftp/data/NA12878/NIST_NA12878_HG001_HiSeq_300x/140407_D00360_0017_BH947YADXX/Project_RM8398/Sample_U5c/U5c_CCGTCC_L001_R1_001.fastq.gz
27+
ftp://ftp-trace.ncbi.nih.gov/giab/ftp/data/NA12878/NIST_NA12878_HG001_HiSeq_300x/140407_D00360_0017_BH947YADXX/Project_RM8398/Sample_U5c/U5c_CCGTCC_L001_R2_001.fastq.gz
28+
)
29+
30+
declare general_referencegenome=ftp://ftp.1000genomes.ebi.ac.uk/vol1/ftp/technical/reference/phase2_reference_assembly_sequence/hs37d5.fa.gz
31+
32+
declare -a BSQR_files=(
33+
ftp://ftp.broadinstitute.org/bundle/b37/Mills_and_1000G_gold_standard.indels.b37.vcf.gz
34+
ftp://ftp.broadinstitute.org/bundle/b37/dbsnp_138.b37.vcf.gz
35+
)
36+
37+
declare -a BSQR_indexes=(
38+
ftp://ftp.broadinstitute.org/bundle/b37/Mills_and_1000G_gold_standard.indels.b37.vcf.idx.gz
39+
ftp://ftp.broadinstitute.org/bundle/b37/dbsnp_138.b37.vcf.idx.gz
40+
)
41+
42+
bwamem_rgheader='@RG\tID:H947YADXX\tSM:NA12878\tPL:ILLUMINA'
43+
44+
echo Fetching jvm, nextflow and workflow
45+
wget -c -nv -P "${downloadDir}" "${jvm}" "${nextflow}" "${workflow}"
46+
47+
echo Sleeping 2 seconds
48+
sleep 2
49+
50+
echo Fetching input files
51+
wget -c -nv -P "${downloadDir}" "${general_rawreads[@]}" "${general_referencegenome}"
52+
wget -c -nv -P "${downloadDir}" --user=gsapubftp-anonymous --password= "${BSQR_files[@]}" "${BSQR_indexes[@]}"
53+
54+
echo Sleeping 2 more seconds
55+
sleep 2
56+
57+
softDir="${workdir}/soft"
58+
59+
if [ ! -d "${softDir}" ] ; then
60+
mkdir -p "${softDir}"
61+
62+
echo Install JVM
63+
tar -x -C "${softDir}" -f "${downloadDir}"/OpenJDK*
64+
mv "${softDir}"/openjdk-*/* "${softDir}"
65+
66+
echo Install Nextflow
67+
cp -p "${downloadDir}"/nextflow* "${softDir}"/bin/nextflow
68+
chmod +x "${softDir}"/bin/nextflow*
69+
70+
echo Extract workflow
71+
unzip -d "${workdir}" "${downloadDir}"/*.zip
72+
fi
73+
74+
JAVA_HOME="${softDir}"
75+
export JAVA_HOME
76+
PATH="${softDir}/bin:$PATH"
77+
export PATH
78+
79+
echo Creating yaml run file
80+
cat > "${workdir}"/input_params.yml <<EOF
81+
general:
82+
rawreads:
83+
- ${downloadDir}/U5c_CCGTCC_L001_R1_001.fastq.gz
84+
- ${downloadDir}/U5c_CCGTCC_L001_R2_001.fastq.gz
85+
referencegenome: ${downloadDir}/hs37d5.fa.gz
86+
BSQR:
87+
files:
88+
- ${downloadDir}/Mills_and_1000G_gold_standard.indels.b37.vcf.gz
89+
- ${downloadDir}/dbsnp_138.b37.vcf.gz
90+
indexes:
91+
- ${downloadDir}/Mills_and_1000G_gold_standard.indels.b37.vcf.idx.gz
92+
- ${downloadDir}/dbsnp_138.b37.vcf.idx.gz
93+
bwamem:
94+
rgheader: '${bwamem_rgheader}'
95+
outputDir: ${workdir}/OUTPUTS
96+
metricsDir: ${workdir}/WFMETRICS
97+
EOF
98+
99+
nextflow run "${workdir}"/Wetlab2Variations-*/nextflow -params-file "${workdir}"/input_params.yml

sample-work-to-measure/download-and-test-linux-6.6.bash

100644100755
File mode changed.

0 commit comments

Comments
 (0)