|
| 1 | +#!/bin/bash |
| 2 | +#tests all tools with all alignments we had deemed necessary |
| 3 | +#usage: ./doall.sh <output name> |
| 4 | +#example: ./doall.sh newoutput |
| 5 | +# creates a directory called "newoutput" that contains the results of all four alignments for each tool |
| 6 | +#if no outputn name is provided, a timestamp is used as a default |
| 7 | + |
| 8 | +echo "calling tools with predeterminded parameters" |
| 9 | + |
| 10 | +declare -a params=("BSY10_red" |
| 11 | + "BSY11_red" |
| 12 | + "BSY10_full" |
| 13 | + "BSY11_full") |
| 14 | + |
| 15 | +stamp="$(date +'%Y_%m_%d-%H_%M_%S')" |
| 16 | +oname="$1" |
| 17 | + |
| 18 | +if [ -z "$1" ] |
| 19 | +then |
| 20 | + echo "No name supplied, setting time stamp as default" |
| 21 | + oname="$stamp" |
| 22 | +fi |
| 23 | + |
| 24 | +mkdir output_"$oname" |
| 25 | +mkdir output_"$oname"/BSY11 |
| 26 | +mkdir output_"$oname"/BSY11/red |
| 27 | +mkdir output_"$oname"/BSY11/full |
| 28 | + |
| 29 | +mkdir output_"$oname"/BSY10 |
| 30 | +mkdir output_"$oname"/BSY10/red |
| 31 | +mkdir output_"$oname"/BSY10/full |
| 32 | + |
| 33 | +declare -a tools=("bdmax" "delly" "gridss" "lumpy" "manta" "softsv" "breseq" "metasv") |
| 34 | +for tool in "${tools[@]}" |
| 35 | +do |
| 36 | + mkdir output_"$oname"/BSY11/red/"$tool" |
| 37 | + mkdir output_"$oname"/BSY11/full/"$tool" |
| 38 | + mkdir output_"$oname"/BSY10/red/"$tool" |
| 39 | + mkdir output_"$oname"/BSY10/full/"$tool" |
| 40 | +done |
| 41 | + |
| 42 | +ref="reference/cbs_7435_full" |
| 43 | + |
| 44 | +for p in "${params[@]}" |
| 45 | +do |
| 46 | + echo "calling with $p" |
| 47 | + |
| 48 | + if [[ $p == *"BSY11"* ]] |
| 49 | + then |
| 50 | + if [[ $p == *"_red"* ]]; then |
| 51 | + output=output_"$oname"/BSY11/red |
| 52 | + bam="BSY11/BSY11_red" |
| 53 | + fastq1="BSY11/BSY11_1_trimmed_red" |
| 54 | + fastq2="BSY11/BSY11_2_trimmed_red" |
| 55 | + else |
| 56 | + output=output_"$oname"/BSY11/full |
| 57 | + bam="BSY11/BSY11_full" |
| 58 | + fastq1="BSY11/BSY11_1_trimmed" |
| 59 | + fastq2="BSY11/BSY11_2_trimmed" |
| 60 | + fi |
| 61 | + else |
| 62 | + if [[ $p == *"_red"* ]]; then |
| 63 | + output=output_"$oname"/BSY10/red |
| 64 | + bam="BSY10/BSY10_red" |
| 65 | + fastq1="BSY10/BSY10_1_trimmed_red" |
| 66 | + fastq2="BSY10/BSY10_2_trimmed_red" |
| 67 | + else |
| 68 | + output=output_"$oname"/BSY10/full |
| 69 | + bam="BSY10/BSY10_full" |
| 70 | + fastq1="BSY10/BSY10_1_trimmed" |
| 71 | + fastq2="BSY10/BSY10_2_trimmed" |
| 72 | + fi |
| 73 | + fi |
| 74 | + |
| 75 | + bash ./doit.sh "$bam" "$ref" "$fastq1" "$fastq2" "$oname" "$output" 2>&1 |
| 76 | +done |
| 77 | + |
| 78 | +echo "doall done, fingers crossed" |
0 commit comments