Skip to content

Instantly share code, notes, and snippets.

@drio
Created May 5, 2010 15:36
Show Gist options
  • Save drio/390952 to your computer and use it in GitHub Desktop.
Save drio/390952 to your computer and use it in GitHub Desktop.
#!/bin/bash
#
# ./dqc postalignqc -f bf.indexes/ecoli.drio.test.fa \
# -r 0:2000 /Users/drio/projects/synthetic.pipe/bf.bwt.sorted.bam > /tmp/foo.txt
# R CMD BATCH '--args in.file="/tmp/foo.txt" out.type="png" space="0" expid="test"' plot_dqc_postalignqc.R
#
sample="test"
data_f="/tmp/data.txt"
gp_cfg_f="/tmp/gplot.${sample}.cfg"
input_file=$1
#1 220 5220
#2 252 5215
cat $input_file | head -27 | tail -25 |\
awk '{print $1"\t"$4"\t"$5}' > $data_f
(
cat <<-EOF
set terminal png nocrop size 750,450
set nokey
set xtics 2
set grid x y
#set datafile separator ","
set t png
#set xrange [0:800]
#set yrange [0:100]
set output "output.png"
set xlabel "cycle"
set ylabel "mismatch rate"
set title "$sample"
plot "$data_f" using 1:((\$2*100)/\$3)
EOF
) > $gp_cfg_f
cat $gp_cfg_f | gnuplot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment