25
|
1 #!/bin/bash
|
|
2 TOOLDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
|
3
|
|
4 echo "Start falco sh"
|
|
5
|
|
6 ## ----------
|
|
7 ## Variables setup
|
|
8 ## ----------
|
|
9 source $1
|
|
10
|
|
11 bam_base=`echo $bam_name | sed 's#.bam$##' - `
|
|
12
|
|
13 ## ----------
|
|
14 ## Create extra init script
|
|
15 ## ----------
|
|
16 if [ $design_file != 'None' ] # Galaxy default is "None"
|
|
17 then
|
|
18 BED_PATH=$design_file
|
|
19 else
|
|
20 BED_PATH="$TOOLDIR/tool-data/GALAXY_TSACP.bed"
|
|
21 fi
|
|
22
|
|
23 if [ $manifest_file != 'None' ] # Galaxy default is "None"
|
|
24 then
|
|
25 MAN_PATH=$manifest_file
|
|
26 else
|
|
27 MAN_PATH="$TOOLDIR/tool-data/GALAXY_TruSeq_Amplicon_Cancer_Panel_Manifest_AFP1_PN15032433.txt"
|
|
28 fi
|
|
29
|
|
30 echo "BED:"$design_file
|
|
31 echo "MAN:"$manifest_file
|
|
32 echo "BED chosen:"$BED_PATH
|
|
33 echo "MAN chosen:"$MAN_PATH
|
|
34 #echo "VARSCAN_PATH1:"$SNPEFF_JAR_PATH
|
|
35 #echo "VARSCAN_PATH2:"\$SNPEFF_JAR_PATH
|
|
36
|
|
37 init_file="galaxy_init.sh"
|
|
38 echo '#!/bin/bash' > $init_file
|
|
39
|
|
40 ## executables
|
|
41 #echo "snpEff=/ccagc/lib/snpEff/snpEff_v3_4" >> $init_file
|
|
42 #echo "snpEff=\$SNPEFF_JAR_PATH/" >> $init_file
|
|
43 #echo "snpSift=/ccagc/lib/SnpSift" >> $init_file
|
|
44 #echo "snpSift=\$SNPEFF_JAR_PATH/" >> $init_file
|
|
45 #echo "varscan=/ccagc/lib/VarScan/VarScan.v2.2.11.jar" >> $init_file
|
|
46 #echo "varscan=\$JAVA_JAR_PATH/VarScan.v2.3.5.jar" >> $init_file
|
33
|
47 echo "samtools=samtools" >> $init_file
|
|
48 echo "bcftools=bcftools" >> $init_file
|
25
|
49
|
|
50 ## files
|
|
51 echo "targetBed=$BED_PATH" >> $init_file
|
|
52 echo "manifest=$MAN_PATH" >> $init_file
|
|
53
|
|
54 ## ----------
|
|
55 ## Status / debug
|
|
56 ## ----------
|
|
57 echo "BAM: "$bam_file
|
|
58 echo "OUT: "$bam_name
|
|
59 echo "BAMBASE: "$bam_base
|
|
60 #echo "OUTPATH: "$out_path
|
|
61 #echo "HTMLOUT: "$html_out
|
|
62 echo "VCFOUT : "$vcf_out
|
|
63 echo "INIT : "$init_file
|
|
64
|
|
65 source $init_file
|
|
66
|
26
|
67 echo "------ --- ------"
|
|
68 echo "------ sam ------"
|
|
69 echo "------ --- ------"
|
31
|
70 $samtools
|
26
|
71 echo "------ --- ------"
|
27
|
72 echo "------ bcf ------"
|
26
|
73 echo "------ --- ------"
|
31
|
74 $bcftools
|
25
|
75 #echo "--- snpsift ---"
|
|
76 #java -jar $snpSift/SnpSift.jar
|
|
77 #echo "--- snpeff ---"
|
|
78 #java -jar $snpEff/snpeff.jar
|
|
79 #echo "--- varscan ---"
|
|
80 #java -jar $varScan
|
|
81
|
29
|
82
|
|
83
|
25
|
84
|
|
85 ## ----------
|
|
86 ## create output files dir
|
|
87 ## ----------
|
26
|
88 #mkdir $out_path
|
|
89 #mkdir $out_path/$bam_base
|
25
|
90
|
|
91 ## ----------
|
|
92 ## running analysis
|
|
93 ## ----------
|
|
94 echo "Starting VcAn"
|
29
|
95
|
|
96 ## DEBUG
|
32
|
97 #exit 0
|
29
|
98
|
25
|
99 $TOOLDIR/falco/amplicon-VcAn-TSACP.sh $bam_file $bam_base
|
32
|
100 echo "...done with VcAn"
|
25
|
101 #$TOOLDIR/falco/amplicon-AlVcAn-TSACP.sh ## this contains more
|
|
102
|
|
103 #echo "Starting amplicon-Report"
|
|
104 #$TOOLDIR/falco/amplicon-Report.sh $bam_base
|
|
105
|
|
106 #echo "Starting QC"
|
|
107 #$TOOLDIR/falco/amplicon-QC.sh $bam_file
|
|
108
|
|
109 #echo "Starting plots.R"
|
|
110 #$TOOLDIR/falco/misc/plots.R $bam_base.qc.ann.txt $bam_base.qc.targets.txt $bam_base.pdf
|
|
111
|
|
112 #echo "Starting mkHtmlReport"
|
|
113 #$TOOLDIR/falco/misc/mkHtmlReport.pl ./ ./
|
|
114
|
|
115
|
|
116
|
|
117 ## ----------
|
|
118 ## create index html for main galaxy output
|
|
119 ## ----------
|
|
120 # echo "<!DOCTYPE html>" >> $html_out
|
|
121 # echo "<html>" >> $html_out
|
|
122 # echo "<head>" >> $html_out
|
|
123 # echo "<style>" >> $html_out
|
|
124 # echo " body{ padding: 0px 20px; }" >> $html_out
|
|
125 # echo " h1{ color: red; }" >> $html_out
|
|
126 # echo " table{ border: 1px solid black; padding: 5px }" >> $html_out
|
|
127 # echo "</style>" >> $html_out
|
|
128 # echo "</head>" >> $html_out
|
|
129 # echo "<body>" >> $html_out
|
|
130 # echo " <h1>FALCO</h1>" >> $html_out
|
|
131 # echo " <a href=\"index.html\">HTML</a>" >> $html_out
|
|
132 # echo " <table><tbody>" >> $html_out
|
|
133 # #for file in *.vcf *.txt *.tsv
|
|
134 # for file in *
|
|
135 # do
|
|
136 # lineCount=`wc -l $file | cut -f 1 -d " "`
|
|
137 # echo " <tr><td><a href=\"$file\">$file</a> has $lineCount lines</td></tr>" >> $html_out
|
|
138 # #echo " <tr><td> HEAD: " `head $file` "</td></tr>" >> $html_out
|
|
139 # done
|
|
140 # echo " </tbody></table>" >> $html_out
|
|
141 # echo "</body>" >> $html_out
|
|
142 # echo "</html>" >> $html_out
|
|
143
|
|
144 ## ----------
|
|
145 ## creating galaxy history outputs
|
|
146 ## ----------
|
|
147 #cp 'index.html' $html_out # this is the overview of samples html
|
|
148 #cp $bam_base'.html' $out_path/'out.html' # this is the sample html
|
|
149 cp $bam_base'.vcf' $vcf_out
|
|
150
|
|
151 ## ----------
|
|
152 ## copy files to keep to output path
|
|
153 ## ----------
|
|
154 #cp -r ./$bam_base/*png $out_path/$bam_base/
|
|
155 #cp -r ./* $out_path
|
|
156 #cp *.vcf $out_path; cp *.tsv $out_path; cp *.txt $out_path; cp *.html $out_path
|
|
157
|
|
158 ## ----------
|
|
159 echo "END falco sh"
|
|
160 exit 0 |