|
| 1 | +#!/bin/bash |
| 2 | + |
| 3 | +scriptDir="$(dirname "$(realpath "$0")")" |
| 4 | + |
| 5 | +if [ $# -ge 1 ] ; then |
| 6 | + workdir="$1" |
| 7 | + outputdir="$2" |
| 8 | +else |
| 9 | + echo "Usage: $0 {workdir} {outputdir}" |
| 10 | + exit 1 |
| 11 | +fi |
| 12 | + |
| 13 | +if [ ! -d "$workdir" ] ; then |
| 14 | + "$SHELL" "$scriptDir"/download-NXF-and-amplicon-analysis-pipeline.bash "$workdir" |
| 15 | +fi |
| 16 | + |
| 17 | +downloadDir="${workdir}/downloads" |
| 18 | +softDir="${workdir}/soft" |
| 19 | + |
| 20 | +JAVA_HOME="${softDir}" |
| 21 | +export JAVA_HOME |
| 22 | +PATH="${softDir}/bin:$PATH" |
| 23 | +export PATH |
| 24 | + |
| 25 | +workflowDir="$(echo "${workdir}"/amplicon-analysis-pipeline-*)" |
| 26 | + |
| 27 | +declare genome=R64-1-1 |
| 28 | +declare genome_source=Ensembl |
| 29 | +declare organism=Saccharomyces_cerevisiae |
| 30 | +declare igenomes_base="${downloadDir}"/igenomes_base |
| 31 | + |
| 32 | +declare igenomes_prefix="${igenomes_base}"/${organism}/${genome_source}/${genome} |
| 33 | + |
| 34 | +echo Creating input and yaml run files |
| 35 | +#cat > "${workdir}"/inputs.csv <<EOF |
| 36 | +#sample,fastq_1,fastq_2,single_end |
| 37 | +#SAMPLE1_PE,${downloadDir}/sample1_R1.fastq.gz,${downloadDir}/sample1_R2.fastq.gz,false |
| 38 | +#SAMPLE2_PE,${downloadDir}/sample2_R1.fastq.gz,${downloadDir}/sample2_R2.fastq.gz,false |
| 39 | +#EOF |
| 40 | +# SAMPLE3_SE,${downloadDir}/sample1_R1.fastq.gz,,true |
| 41 | +# SAMPLE3_SE,${downloadDir}/sample2_R1.fastq.gz,,true |
| 42 | +cat > "${workdir}"/inputs.csv <<EOF |
| 43 | +sample,fastq_1,fastq_2,single_end |
| 44 | +ERR2237853,${downloadDir}/amplicon-paired-ERR2237853_1.fastq.gz,${downloadDir}/amplicon-paired-ERR2237853_2.fastq.gz,false |
| 45 | +ERR1594332,${downloadDir}/amplicon-single-ERR1594332.fastq.gz,,true |
| 46 | +SRR1620013,${downloadDir}/wgs-paired-SRR1620013_1_small.fastq.gz,${downloadDir}/wgs-paired-SRR1620013_2_small.fastq.gz,false |
| 47 | +EOF |
| 48 | + |
| 49 | +cat > "${workdir}"/input_params.yml <<EOF |
| 50 | +input: ${workdir}/inputs.csv |
| 51 | +
|
| 52 | +ssu_db_fasta: ${downloadDir}/ssu_db/SILVA-SSU.fasta |
| 53 | +ssu_db_tax: ${downloadDir}/ssu_db/SILVA-SSU-tax.txt |
| 54 | +ssu_db_otu: ${downloadDir}/ssu_db/SILVA-SSU.otu |
| 55 | +ssu_db_mscluster: ${downloadDir}/ssu_db/SILVA-SSU.fasta.mscluster |
| 56 | +
|
| 57 | +lsu_db_fasta: ${downloadDir}/lsu_db/SILVA-LSU.fasta |
| 58 | +lsu_db_tax: ${downloadDir}/lsu_db/SILVA-LSU-tax.txt |
| 59 | +lsu_db_otu: ${downloadDir}/lsu_db/SILVA-LSU.otu |
| 60 | +lsu_db_mscluster: ${downloadDir}/lsu_db/SILVA-LSU.fasta.mscluster |
| 61 | +
|
| 62 | +unite_db_fasta: ${downloadDir}/unite_db/UNITE.fasta |
| 63 | +unite_db_tax: ${downloadDir}/unite_db/UNITE-tax.txt |
| 64 | +unite_db_otu: ${downloadDir}/unite_db/UNITE.otu |
| 65 | +unite_db_mscluster: ${downloadDir}/unite_db/UNITE.fasta.mscluster |
| 66 | +
|
| 67 | +itsone_db_fasta: ${downloadDir}/itsone_db/ITSone.fasta |
| 68 | +itsone_db_tax: ${downloadDir}/itsone_db/ITSone-tax.txt |
| 69 | +itsone_db_otu: ${downloadDir}/itsone_db/ITSone.otu |
| 70 | +itsone_db_mscluster: ${downloadDir}/itsone_db/ITSone.fasta.mscluster |
| 71 | +
|
| 72 | +pr2_db_fasta: ${downloadDir}/pr2_db/PR2.fasta |
| 73 | +pr2_db_tax: ${downloadDir}/pr2_db/PR2-tax.txt |
| 74 | +pr2_db_otu: ${downloadDir}/pr2_db/PR2.otu |
| 75 | +pr2_db_mscluster: ${downloadDir}/pr2_db/PR2.fasta.mscluster |
| 76 | +
|
| 77 | +rrnas_rfam_covariance_model: ${downloadDir}/rrnas_rfam/ |
| 78 | +rrnas_rfam_claninfo: ${downloadDir}/rrnas_rfam/ribo.clan_info |
| 79 | +
|
| 80 | +genome: ${genome} |
| 81 | +igenomes_base: ${igenomes_base} |
| 82 | +genomes: |
| 83 | + R64-1-1: |
| 84 | + fasta: ${igenomes_prefix}/Sequence/WholeGenomeFasta/genome.fa |
| 85 | + bwa: ${igenomes_prefix}/Sequence/BWAIndex/version0.6.0/ |
| 86 | + bowtie2: ${igenomes_prefix}/Sequence/Bowtie2Index/ |
| 87 | + star: ${igenomes_prefix}/Sequence/STARIndex/ |
| 88 | + bismark: ${igenomes_prefix}/Sequence/BismarkIndex/ |
| 89 | + gtf: ${igenomes_prefix}/Annotation/Genes/genes.gtf |
| 90 | + bed12: ${igenomes_prefix}/Annotation/Genes/genes.bed |
| 91 | +
|
| 92 | +validationSchemaIgnoreParams: genomes |
| 93 | +
|
| 94 | +outdir: ${outputdir} |
| 95 | +EOF |
| 96 | + |
| 97 | +cat > "${workdir}"/custom.conf <<EOF |
| 98 | +docker { |
| 99 | + enabled = true |
| 100 | + autoMounts = true |
| 101 | + registry = "quay.io" |
| 102 | +} |
| 103 | +EOF |
| 104 | + |
| 105 | +nextflow run "${workflowDir}" -c "${workdir}"/custom.conf -params-file "${workdir}"/input_params.yml |
0 commit comments