diff report_clonality/r_wrapper.sh @ 45:ee7209928db8 draft

Uploaded
author davidvanzessen
date Wed, 27 Jan 2016 05:35:55 -0500
parents 4c5033eb708f
children fee06348bfad
line wrap: on
line diff
--- a/report_clonality/r_wrapper.sh	Tue Jan 26 10:10:04 2016 -0500
+++ b/report_clonality/r_wrapper.sh	Wed Jan 27 05:35:55 2016 -0500
@@ -53,10 +53,18 @@
 cp $dir/circos/* $outputDir/circos/
 CIRCOSTOOLS="/data/galaxy/galaxy-dist/toolsheddependencies/circos/0.64/saskia-hiltemann/cg_circos_plots/bbfdd52d64fd/circos-tools-0.21/tools"
 CIRCOSDIR="/data/galaxy/galaxy-dist/toolsheddependencies/circos/0.64/saskia-hiltemann/cg_circos_plots/bbfdd52d64fd/bin/"
+USECIRCOS="no"
+if [ -d "$CIRCOSDIR" ]; then
+	USECIRCOS="yes"
+fi
 sed -i "s%DATA_DIR%$outputDir/circos%" $outputDir/circos/circos.conf
 for sample in $samples; do #output the samples to a file and create the circos plots with the R script output
 	echo " $sample" >> $outputFile
 	
+	if [[ "$USECIRCOS" == "no" ]]; then
+		continue
+	fi
+	
 	circos_file="$outputDir/${sample}_VJ_circos.txt"
 	echo -e -n "labels$(cat ${circos_file})" > ${circos_file}
 	cat "${circos_file}" | $CIRCOSTOOLS/tableviewer/bin/parse-table -configfile $dir/circos/parse-table.conf 2>&1 | $CIRCOSTOOLS/tableviewer/bin/make-conf -dir $outputDir/circos/
@@ -119,21 +127,23 @@
 
 #circos
 
-echo "<div class='tabbertab' title='Circos'><div class='tabber'>" >> $outputFile
-for sample in $samples; do
-	echo "<div class='tabbertab' title='$sample'><table border='1'><center>" >> $outputFile
-	if [[ "$useD" == "true" ]] ; then
-		echo "<tr><td>V-D</td><td><img src='circosVD_${sample}.png' width='700' height='700'/></td></tr>" >> $outputFile
-	fi
-	echo "<tr><td>V-J</td><td><img src='circosVJ_${sample}.png' width='700' height='700'/></td></tr>" >> $outputFile
-	if [[ "$useD" == "true" ]] ; then
-		echo "<tr><td>D-J</td><td><img src='circosDJ_${sample}.png' width='700' height='700'/></td></tr>" >> $outputFile
-	fi
-	echo "<center></table></div>" >> $outputFile
-	count=$((count+1))
-done
-echo "</div></div>" >> $outputFile
+if [[ "$USECIRCOS" == "no" ]]; then
 
+	echo "<div class='tabbertab' title='Circos'><div class='tabber'>" >> $outputFile
+	for sample in $samples; do
+		echo "<div class='tabbertab' title='$sample'><table border='1'><center>" >> $outputFile
+		if [[ "$useD" == "true" ]] ; then
+			echo "<tr><td>V-D</td><td><img src='circosVD_${sample}.png' width='700' height='700'/></td></tr>" >> $outputFile
+		fi
+		echo "<tr><td>V-J</td><td><img src='circosVJ_${sample}.png' width='700' height='700'/></td></tr>" >> $outputFile
+		if [[ "$useD" == "true" ]] ; then
+			echo "<tr><td>D-J</td><td><img src='circosDJ_${sample}.png' width='700' height='700'/></td></tr>" >> $outputFile
+		fi
+		echo "<center></table></div>" >> $outputFile
+		count=$((count+1))
+	done
+	echo "</div></div>" >> $outputFile
+fi
 #echo "<div class='tabbertab' title='Interactive'><svg class='chart'></svg><script src='http://d3js.org/d3.v3.min.js'></script></div>" >> $outputFile
 
 hasReplicateColumn="$(if head -n 1 $inputFile | grep -q 'Replicate'; then echo 'Yes'; else echo 'No'; fi)"