-
Notifications
You must be signed in to change notification settings - Fork 3
/
plot_DRISEE_shell.sh
executable file
·53 lines (42 loc) · 2.3 KB
/
plot_DRISEE_shell.sh
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
#!/bin/sh
#written 10-18-11
if [ $# -lt 2 ] # usage and exit if 4 args are not supplied
then
echo "plot_DRISEE_shell.sh"
echo "A shell script to plot linear graphs from *.DRISEE or *.DRISEE.per files (DRISEE analysis outputs)"
echo
echo "USAGE: >plot_DRISEE_shell.sh <file_in> <bps_indexed>"
echo
echo " <file_in> : no default :: (string) name of the input file (tab delimited file) assumes *.DRISEE or *.DRISEE.per and converts"
echo " <image_type> : dafault = pdf :: (string) type of image - can choose pdf or png"
echo " <bps_indexed> : default = 1 :: (int) 0|1 does the input file contain bp index"
echo
echo "NOTE: This script requires a copy of plot_DRISEE.11-19-12.r to be placed in your /usr/bin/ directory"
echo
echo "Citation:"
echo " Keegan KP, Trimble WL, Wilkening J, Wilke A, Harrison T, et al. (2012)"
echo " A Platform-Independent Method for Detecting Errors in Metagenomic Sequencing Data: DRISEE."
echo " PLoS Comput Biol 8(6): e1002541. doi:10.1371/journal.pcbi.1002541"
echo
exit 1
fi
time_stamp=`date +%m-%d-%y_%H:%M:%S:%N`; # create the time stamp month-day-year_hour:min:sec:nanosec
FILE_IN=$1
IMAGETYPE=$2
BPSINDEXED=$3
# set variable defaults
: ${IMAGETYPE:="pdf"} # set default value for image_type
: ${BPSINDEXED:=1} # set default value for bps_indexed
# perl ~/bin/STAT_to_R.pl -input_file $1 -output_pattern $1;
# drisee_stat_file=$1".PERCENT_COUNTS";
echo "# script generated by plot_DRISEE_shell.sh to run plot_pco.r" >> plot_DRISEE_script.$time_stamp.r
echo "# time stamp; $time_stamp" >> plot_DRISEE_script.$time_stamp.r
echo "source(\"~/bin/plot_DRISEE.11-28-12.r\")" >> plot_DRISEE_script.$time_stamp.r
#echo "plot_DRISEE(file_in = \"$1\", bps_indexed = \"$2\")" >> plot_DRISEE_script.$time_stamp.r
#echo "plot_DRISEE(file_in = \"$drisee_stat_file\", bps_indexed = \"$2\")" >> plot_DRISEE_script.$time_stamp.r
echo "plot_DRISEE(file_in = \"$FILE_IN\", image_type = \"$IMAGETYPE\", bps_indexed = \"$BPSINDEXED\")" >> plot_DRISEE_script.$time_stamp.r
R --vanilla --slave < plot_DRISEE_script.$time_stamp.r
#if [ -e plot_DRISEE_script.$time_stamp.r ]
#then
# rm plot_DRISEE_script.$time_stamp.r
#fi