Mercurial > repos > davidvanzessen > mutation_analysis
comparison wrapper.sh @ 22:d84c9791d8c4 draft
Uploaded
author | davidvanzessen |
---|---|
date | Tue, 07 Apr 2015 03:52:34 -0400 |
parents | c9f9623f1f76 |
children | 58a62d2c0377 |
comparison
equal
deleted
inserted
replaced
21:c9f9623f1f76 | 22:d84c9791d8c4 |
---|---|
4 input=$1 | 4 input=$1 |
5 method=$2 | 5 method=$2 |
6 output=$3 | 6 output=$3 |
7 outdir=$4 | 7 outdir=$4 |
8 title=$5 | 8 title=$5 |
9 include_fr1=$6 | |
9 mkdir $outdir | 10 mkdir $outdir |
10 | 11 |
11 unzip $input -d $PWD/files/ > $PWD/unziplog.log | 12 unzip $input -d $PWD/files/ > $PWD/unziplog.log |
12 cat $PWD/files/*/1_* > $PWD/summary.txt | 13 cat $PWD/files/*/1_* > $PWD/summary.txt |
13 cat $PWD/files/*/7_* > $PWD/mutationanalysis.txt | 14 cat $PWD/files/*/7_* > $PWD/mutationanalysis.txt |
14 cat $PWD/files/*/8_* > $PWD/mutationstats.txt | 15 cat $PWD/files/*/8_* > $PWD/mutationstats.txt |
15 cat $PWD/files/*/10_* > $PWD/hotspots.txt | 16 cat $PWD/files/*/10_* > $PWD/hotspots.txt |
16 | 17 |
17 #BLASTN_DIR="/home/galaxy/tmp/blast/ncbi-blast-2.2.30+/bin" | 18 BLASTN_DIR="/home/galaxy/tmp/blast/ncbi-blast-2.2.30+/bin" |
18 | 19 |
19 echo "${BLASTN_DIR}" | 20 echo "${BLASTN_DIR}" |
20 | 21 |
21 | 22 |
22 | 23 |
44 echo "merging" | 45 echo "merging" |
45 Rscript $dir/merge_and_filter.r $PWD/summary.txt $PWD/mutationanalysis.txt $PWD/mutationstats.txt $PWD/hotspots.txt $outdir/identified_genes.txt $outdir/merged.txt $outdir/unmatched.txt $method | 46 Rscript $dir/merge_and_filter.r $PWD/summary.txt $PWD/mutationanalysis.txt $PWD/mutationstats.txt $PWD/hotspots.txt $outdir/identified_genes.txt $outdir/merged.txt $outdir/unmatched.txt $method |
46 | 47 |
47 genes="ca,ca1,ca2,cg,cg1,cg2,cg3,cg4,cm" | 48 genes="ca,ca1,ca2,cg,cg1,cg2,cg3,cg4,cm" |
48 echo "R mutation analysis" | 49 echo "R mutation analysis" |
49 Rscript $dir/mutation_analysis.r $outdir/merged.txt $genes $outdir 2>&1 | 50 Rscript $dir/mutation_analysis.r $outdir/merged.txt $genes $outdir ${include_fr1} 2>&1 |
50 echo "python mutation analysis" | 51 echo "python mutation analysis" |
51 python $dir/mutation_analysis.py --input $outdir/merged.txt --genes $genes --output $outdir/hotspot_analysis.txt | 52 python $dir/mutation_analysis.py --input $outdir/merged.txt --genes $genes --output $outdir/hotspot_analysis.txt |
52 | 53 |
53 cat $outdir/mutations.txt $outdir/hotspot_analysis.txt > $outdir/result.txt | 54 cat $outdir/mutations.txt $outdir/hotspot_analysis.txt > $outdir/result.txt |
54 | 55 |
80 fi | 81 fi |
81 if [ -a $outdir/cg.png ] | 82 if [ -a $outdir/cg.png ] |
82 then | 83 then |
83 echo "<img src='cg.png'/><br />" >> $output | 84 echo "<img src='cg.png'/><br />" >> $output |
84 fi | 85 fi |
86 if [ -a $outdir/scatter.png ] | |
87 then | |
88 echo "<img src='scatter.png'/><br />" >> $output | |
89 fi | |
85 | 90 |
86 for gene in ${genes[@]} | 91 for gene in ${genes[@]} |
87 do | 92 do |
88 echo "<table border='1'><caption>$gene transition table</caption>" >> $output | 93 echo "<table border='1'><caption>$gene transition table</caption>" >> $output |
89 while IFS=, read from a c g t | 94 while IFS=, read from a c g t |