comparison report_clonality/r_wrapper.sh @ 48:efe0a2b5d163 draft

Uploaded
author davidvanzessen
date Tue, 18 Jun 2019 09:23:41 -0400
parents 942eea8359fe
children 124b7fd92a3e
comparison
equal deleted inserted replaced
47:9ba44c15cad1 48:efe0a2b5d163
57 echo "</center></html>" >> $2 57 echo "</center></html>" >> $2
58 58
59 echo "<html><head><title>Report on:" >> $outputFile 59 echo "<html><head><title>Report on:" >> $outputFile
60 60
61 mkdir $outputDir/circos 61 mkdir $outputDir/circos
62 cp $dir/circos/* $outputDir/circos/ 62 cp -R $dir/circos/* $outputDir/circos/
63 #CIRCOSTOOLS="/data/galaxy/galaxy-dist/toolsheddependencies/circos/0.64/saskia-hiltemann/cg_circos_plots/bbfdd52d64fd/circos-tools-0.21/tools"
64 #CIRCOSDIR="/data/galaxy/galaxy-dist/toolsheddependencies/circos/0.64/saskia-hiltemann/cg_circos_plots/bbfdd52d64fd/bin/"
65
66 #CIRCOSTOOLS="/home/galaxy/circos/circos-tools-0.22/tools"
67 #CIRCOSDIR="/home/galaxy/Anaconda3/bin"
68 63
69 USECIRCOS="no" 64 USECIRCOS="no"
70 if [ -d "$CIRCOSDIR" ]; then 65 path_to_circos=$(which circos)
66 if [ -x "$path_to_circos" ]; then
71 USECIRCOS="yes" 67 USECIRCOS="yes"
72 else
73 if [ -d "/data/galaxy/galaxy-dist/toolsheddependencies/circos/0.64/saskia-hiltemann/cg_circos_plots/bbfdd52d64fd/bin/" ]; then #hopefully temporary fix
74 USECIRCOS="yes"
75 CIRCOSTOOLS="/data/galaxy/galaxy-dist/toolsheddependencies/circos/0.64/saskia-hiltemann/cg_circos_plots/bbfdd52d64fd/circos-tools-0.21/tools"
76 CIRCOSDIR="/data/galaxy/galaxy-dist/toolsheddependencies/circos/0.64/saskia-hiltemann/cg_circos_plots/bbfdd52d64fd/bin/"
77 fi
78
79 if [ -d "/home/galaxy/Anaconda3/bin" ]; then #hopefully temporary fix #or not
80 USECIRCOS="yes"
81 CIRCOSTOOLS="/home/galaxy/circos/circos-tools-0.22/tools"
82 CIRCOSDIR="/home/galaxy/Anaconda3/bin"
83 fi
84
85 if [ -d "/media/galaxy/data/other_backup/circos/galaxian-circos//bin" ]; then #hopefully temporary fix #or not #really not
86 USECIRCOS="yes"
87 CIRCOSTOOLS="/media/galaxy/data/other_backup/circos/galaxian-circos/tools"
88 CIRCOSDIR="/media/galaxy/data/other_backup/circos/galaxian-circos/bin"
89 fi
90 fi 68 fi
91 69
92 echo "Using Circos: $USECIRCOS" 70 echo "Using Circos: $USECIRCOS"
93 sed -i "s%DATA_DIR%$outputDir/circos%" $outputDir/circos/circos.conf 71 sed -i "s%DATA_DIR%$outputDir/circos%" $outputDir/circos/circos.conf
94 for sample in $samples; do #output the samples to a file and create the circos plots with the R script output 72 for sample in $samples; do #output the samples to a file and create the circos plots with the R script output
100 78
101 circos_file="$outputDir/${sample}_VJ_circos.txt" 79 circos_file="$outputDir/${sample}_VJ_circos.txt"
102 sed -i -- 's%/%:%g' $circos_file 80 sed -i -- 's%/%:%g' $circos_file
103 echo -e -n "labels$(cat ${circos_file})" > ${circos_file} 81 echo -e -n "labels$(cat ${circos_file})" > ${circos_file}
104 echo "Circos tools command:" 82 echo "Circos tools command:"
105 echo "cat \"${circos_file}\" | $CIRCOSTOOLS/tableviewer/bin/parse-table -configfile $dir/circos/parse-table.conf 2>&1 | $CIRCOSTOOLS/tableviewer/bin/make-conf -dir $outputDir/circos/" 83 echo "cat \"${circos_file}\" | parse-table -configfile $dir/circos/parse-table.conf 2>&1 | make-conf -dir $outputDir/circos/"
106 cat "${circos_file}" | $CIRCOSTOOLS/tableviewer/bin/parse-table -configfile $dir/circos/parse-table.conf 2>&1 | $CIRCOSTOOLS/tableviewer/bin/make-conf -dir $outputDir/circos/ 84 cat "${circos_file}" | parse-table -configfile $dir/circos/parse-table.conf 2>&1 | make-conf -dir $outputDir/circos/
107 85
108 echo "Circos command:" 86 echo "Circos command:"
109 echo "$CIRCOSDIR/circos -conf $outputDir/circos/circos.conf 2>&1" 87 echo "circos -conf $outputDir/circos/circos.conf 2>&1"
110 $CIRCOSDIR/circos -conf $outputDir/circos/circos.conf 2>&1 88 circos -conf $outputDir/circos/circos.conf 2>&1
111 mv $outputDir/circos/circos.png $outputDir/circosVJ_${sample}.png 89 mv $outputDir/circos/circos.png $outputDir/circosVJ_${sample}.png
112 mv $outputDir/circos/circos.svg $outputDir/circosVJ_${sample}.svg 90 mv $outputDir/circos/circos.svg $outputDir/circosVJ_${sample}.svg
113 91
114 92
115 if [[ "$useD" == "true" ]] ; then 93 if [[ "$useD" == "true" ]] ; then
116 circos_file="$outputDir/${sample}_VD_circos.txt" 94 circos_file="$outputDir/${sample}_VD_circos.txt"
117 sed -i -- 's%/%:%g' $circos_file 95 sed -i -- 's%/%:%g' $circos_file
118 echo -e -n "labels$(cat ${circos_file})" > ${circos_file} 96 echo -e -n "labels$(cat ${circos_file})" > ${circos_file}
119 cat "${circos_file}" | $CIRCOSTOOLS/tableviewer/bin/parse-table -configfile $dir/circos/parse-table.conf 2>&1 | $CIRCOSTOOLS/tableviewer/bin/make-conf -dir $outputDir/circos/ 97 cat "${circos_file}" | parse-table -configfile $dir/circos/parse-table.conf 2>&1 | make-conf -dir $outputDir/circos/
120 sed -i -- 's%/%:%g' $outputDir/circos/cells.txt 98 sed -i -- 's%/%:%g' $outputDir/circos/cells.txt
121 $CIRCOSDIR/circos -conf $outputDir/circos/circos.conf 2>&1 99 circos -conf $outputDir/circos/circos.conf 2>&1
122 mv $outputDir/circos/circos.png $outputDir/circosVD_${sample}.png 100 mv $outputDir/circos/circos.png $outputDir/circosVD_${sample}.png
123 mv $outputDir/circos/circos.svg $outputDir/circosVD_${sample}.svg 101 mv $outputDir/circos/circos.svg $outputDir/circosVD_${sample}.svg
124 102
125 circos_file="$outputDir/${sample}_DJ_circos.txt" 103 circos_file="$outputDir/${sample}_DJ_circos.txt"
126 sed -i -- 's%/%:%g' $circos_file 104 sed -i -- 's%/%:%g' $circos_file
127 echo -e -n "labels$(cat ${circos_file})" > ${circos_file} 105 echo -e -n "labels$(cat ${circos_file})" > ${circos_file}
128 cat "${circos_file}" | $CIRCOSTOOLS/tableviewer/bin/parse-table -configfile $dir/circos/parse-table.conf 2>&1 | $CIRCOSTOOLS/tableviewer/bin/make-conf -dir $outputDir/circos/ 106 cat "${circos_file}" | parse-table -configfile $dir/circos/parse-table.conf 2>&1 | make-conf -dir $outputDir/circos/
129 sed -i -- 's%/%:%g' $outputDir/circos/cells.txt 107 sed -i -- 's%/%:%g' $outputDir/circos/cells.txt
130 $CIRCOSDIR/circos -conf $outputDir/circos/circos.conf 2>&1 108 circos -conf $outputDir/circos/circos.conf 2>&1
131 mv $outputDir/circos/circos.png $outputDir/circosDJ_${sample}.png 109 mv $outputDir/circos/circos.png $outputDir/circosDJ_${sample}.png
132 mv $outputDir/circos/circos.svg $outputDir/circosDJ_${sample}.svg 110 mv $outputDir/circos/circos.svg $outputDir/circosDJ_${sample}.svg
133 fi 111 fi
134 done 112 done
135 echo "</title><script type='text/javascript' src='jquery-1.11.0.min.js'></script>" >> $outputFile 113 echo "</title><script type='text/javascript' src='jquery-1.11.0.min.js'></script>" >> $outputFile