Download this file

144 lines (113 with data), 3.6 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
#!/bin/bash
# Use getopt instead of getopts for long options
set -e
OPTS=`getopt -o o: --long out-dir:,out-vcf:,tumor-bam:,normal-bam:,human-reference:,selector:,extra-arguments:,action:,MEM:,dbsnp:,singularity -n 'submit_MuSE.sh' -- "$@"`
if [ $? != 0 ] ; then echo "Failed parsing options." >&2 ; exit 1 ; fi
#echo "$OPTS"
eval set -- "$OPTS"
MYDIR="$( cd "$( dirname "$0" )" && pwd )"
VAF=0.05
action=echo
MEM=4
singularity=''
while true; do
case "$1" in
--out-vcf )
case "$2" in
"") shift 2 ;;
*) outvcf=$2 ; shift 2 ;;
esac ;;
--out-dir )
case "$2" in
"") shift 2 ;;
*) outdir=$2 ; shift 2 ;;
esac ;;
--tumor-bam )
case "$2" in
"") shift 2 ;;
*) tumor_bam=$2 ; shift 2 ;;
esac ;;
--normal-bam )
case "$2" in
"") shift 2 ;;
*) normal_bam=$2 ; shift 2 ;;
esac ;;
--human-reference )
case "$2" in
"") shift 2 ;;
*) HUMAN_REFERENCE=$2 ; shift 2 ;;
esac ;;
--selector )
case "$2" in
"") shift 2 ;;
*) SELECTOR=$2 ; shift 2 ;;
esac ;;
--dbsnp )
case "$2" in
"") shift 2 ;;
*) dbsnp=$2 ; shift 2 ;;
esac ;;
--extra-arguments )
case "$2" in
"") shift 2 ;;
*) extra_arguments=$2 ; shift 2 ;;
esac ;;
--MEM )
case "$2" in
"") shift 2 ;;
*) MEM=$2 ; shift 2 ;;
esac ;;
--action )
case "$2" in
"") shift 2 ;;
*) action=$2 ; shift 2 ;;
esac ;;
--singularity )
singularity=1 ; shift ;;
-- ) shift; break ;;
* ) break ;;
esac
done
logdir=${outdir}/logs
mkdir -p ${logdir}
out_script=${outdir}/logs/muse.cmd
echo "#!/bin/bash" > $out_script
echo "" >> $out_script
echo "#$ -o ${logdir}" >> $out_script
echo "#$ -e ${logdir}" >> $out_script
echo "#$ -S /bin/bash" >> $out_script
echo "#$ -l h_vmem=${MEM}G" >> $out_script
echo 'set -e' >> $out_script
echo "" >> $out_script
echo 'echo -e "Start at `date +"%Y/%m/%d %H:%M:%S"`" 1>&2' >> $out_script
echo "" >> $out_script
echo "cat ${SELECTOR} | awk -F \"\t\" '{print \$1 \"\t\" \$2 \"\t\" \$3}' > ${outdir}/bed_3columns.bed" >> $out_script
echo "" >> $out_script
if [[ $singularity ]]; then
echo "singularity exec --bind /:/mnt docker://marghoob/muse:1.0rc_c \\" >> $out_script
else
echo "docker run --rm -v /:/mnt -u $UID --memory ${MEM}G marghoob/muse:1.0rc_c \\" >> $out_script
fi
echo "MuSEv1.0rc_submission_c039ffa call \\" >> $out_script
echo "-O /mnt/${outdir}/MuSE \\" >> $out_script
echo "-l /mnt/${outdir}/bed_3columns.bed \\" >> $out_script
echo "-f /mnt/${HUMAN_REFERENCE} \\" >> $out_script
echo "/mnt/${tumor_bam} \\" >> $out_script
echo "/mnt/${normal_bam}" >> $out_script
echo "" >> $out_script
if [[ $singularity ]]; then
echo "singularity exec --bind /:/mnt docker://marghoob/muse:1.0rc_c \\" >> $out_script
else
echo "docker run --rm -v /:/mnt -u $UID --memory ${MEM}G marghoob/muse:1.0rc_c \\" >> $out_script
fi
echo "MuSEv1.0rc_submission_c039ffa sump \\" >> $out_script
echo "-I /mnt/${outdir}/MuSE.MuSE.txt \\" >> $out_script
echo "${extra_arguments} -O /mnt/${outdir}/${outvcf} \\" >> $out_script
if [[ $dbsnp ]]; then
echo "-D /mnt/${dbsnp}.gz" >> $out_script
else
echo "" >> $out_script
fi
echo "" >> $out_script
echo 'echo -e "Done at `date +"%Y/%m/%d %H:%M:%S"`" 1>&2' >> $out_script
${action} $out_script