0
|
1 #!/bin/bash
|
|
2
|
|
3 #JunctionDiff-vs-background.sh $variants $genomes ${reference.fields.crr_path} ${reference.fields.31G_var_paths} ${reference.54G_var_paths} $output_filtered $output_report $scoreThresholdA $scoreThresholdB $distance $minlength
|
|
4
|
|
5 #set some defaults
|
|
6 output_report="output_reports.tsv"
|
|
7
|
|
8 set -- `getopt -n$0 -u -a --longoptions="variants: reference: VN_junctions: cgatools_binary: outputfile_filtered: outputfile_report: scoreThresholdA: scoreThresholdB: distance: minlength: " "h:" "$@"` || usage
|
|
9 [ $# -eq 0 ] && usage
|
|
10
|
|
11 while [ $# -gt 0 ]
|
|
12 do
|
|
13 case "$1" in
|
|
14 --variants) variants=$2;shift;;
|
|
15 --reference) crr=$2;shift;;
|
|
16 --VN_junctions) VN_junctionfiles_list=$2;shift;;
|
|
17 --cgatools_binary) cgatools_binary=$2;shift;; #cgatools binary to use
|
|
18 --outputfile_filtered) output_filtered=$2;shift;;
|
|
19 --outputfile_report) output_report=$2;shift;;
|
|
20 --scoreThresholdA) scoreThresholdA=$2;shift;;
|
|
21 --scoreThresholdB) scoreThresholdB=$2;shift;;
|
|
22 --distance) distance=$2;shift;;
|
|
23 --minlength) minlength=$2;shift;;
|
|
24 -h) shift;;
|
|
25 --) shift;break;;
|
|
26 -*) usage;;
|
|
27 *) break;;
|
|
28 esac
|
|
29 shift
|
|
30 done
|
|
31
|
|
32
|
|
33 # make copy of input junctions file, as this file will be altered
|
|
34 junctions="junctions.tsv"
|
|
35 cp $variants $junctions
|
|
36
|
|
37
|
|
38 ### run JunctionDiff against all of the VN junctionfiles
|
|
39
|
|
40 echo "running JunctionDiff against each of the VN genomes"
|
|
41
|
|
42 # for each line in VN genomes list of junctionfiles, run junctiondiff
|
|
43 count=0
|
|
44 while read line
|
|
45 do
|
|
46 if [[ $line != "" ]] # catch empty lines
|
|
47 then
|
|
48 count=$[$count+1]
|
|
49 ${cgatools_binary} junctiondiff \
|
|
50 --beta \
|
|
51 --statout \
|
|
52 --reference $crr \
|
|
53 --junctionsA $junctions \
|
|
54 --junctionsB $line \
|
|
55 --scoreThresholdA $scoreThresholdA \
|
|
56 --scoreThresholdB $scoreThresholdB \
|
|
57 --distance $distance \
|
|
58 --minlength $minlength
|
|
59
|
|
60 #concatenate all reports
|
|
61 echo -e "report of run $count:\n----------------------" >> $output_report
|
|
62 cat report.tsv >> $output_report
|
|
63 echo "" >> $output_report
|
|
64
|
|
65
|
|
66 #rename output file to junctions file for next iteration
|
|
67 rm $junctions
|
|
68 mv "diff-$junctions" $junctions
|
|
69 fi
|
|
70 done < $VN_junctionfiles_list
|
|
71
|
|
72 cp $junctions $output_filtered
|
|
73
|
|
74
|
|
75
|