#!/bin/sh now="$(date +%s)" clear printf "Current directory is: \n\n"; pwd echo "\nEnter input file name: \c" read input echo "\nHow are your groups delimited? \nFor example, \"_\" (underscore), \"-\" (dash), \" \" (space), etc.: \c" read delimiter echo "\nDo you need to cluster sequences into OTUs? y/n: \c" read cd_hit_choice echo "\nCan you afford to pay for color graphics? y/n: \c" read graphics_color printf "\nEnter number of seconds to pause between steps... " read sleep if [ $cd_hit_choice = "y" ] ; then #---run cdhit--- #printf "\n\nRunning CD-HIT for 0.01 cutoff...\n\n" #cdhit-est -i $input -o output_file_99 -c 0.99 -n 9 -g 1 #clear printf "\n\nRunning CD-HIT for 0.03 cutoff...\n\n" cdhit-est -i $input -o output_file_97 -c 0.97 -n 9 -g 1 clear printf "\n\nRunning CD-HIT for 0.05 cutoff...\n\n" cdhit-est -i $input -o output_file_95 -c 0.95 -n 8 -g 1 clear printf "\n\nRunning CD-HIT for 0.1 cutoff...\n\n" cdhit-est -i $input -o output_file_90 -c 0.90 -n 7 -g 1 clear #printf "\n\nRunning CD-HIT for 0.15 cutoff...\n\n" #cdhit-est -i $input -o output_file_85 -c 0.85 -n 6 -g 1 #clear fi #---print number of clusters to screen--- printf "\nNumber of clusters in each file is:\n\n" grep -c ">Clus" *_??.clstr printf "\n\n" #---pause--- sleep $sleep #---Making summary data table for downstream R scripts--- printf "\nReformatting cd-hit output into single data table for downstream analyses...\n" sleep $sleep my_cluster_cleaner.pl -d $delimiter #---Converting cd-hit output to mothur--- printf "\nDone.\n\nReformatting cd-hit output files into mothur format...\n" sleep $sleep my_cd-hit_to_mothur_converter.pl #---Generating group file for mothur--- printf "\nGenerating group file for mothur...\n" sleep $sleep my_group_file_maker.pl -i $input -d $delimiter #---Call mothur for venn diagrams and tree file--- mothur "#read.otu(list=mothur_converter_output.list, group=group_file.groups); venn(); tree.shared()" sleep $sleep #======Make graphics and stats output with R======= clear printf "\nRunning R scripts to make graphics and perform stats:\n" printf "\nContact brian.oakley at arsdotusdadotgov if any questions...\n" printf "\n--------------------------------------------------------\n\n"; printf "\nMaking rarefaction curves for each cutoff...." if [ $graphics_color = "y" ]; then R CMD BATCH ~/shell_scripts/make_rarefaction_curves_color.r fi if [ $graphics_color = "n" ]; then R CMD BATCH ~/shell_scripts/make_rarefaction_curves_bw.r fi printf "Done.\n\n\nMaking OTU distributions for each cutoff...." R CMD BATCH ~/shell_scripts/make_OTU_distributions.r printf "Done.\n\n\nMaking OTU frequency distributions for each cutoff ...." R CMD BATCH ~/shell_scripts/make_freq_dists_w_constant_clusters.r printf "Done.\n\n\nRunning cca for each cutoff...." R CMD BATCH ~/shell_scripts/make_cca_plots.r printf "Done.\n\n\nCalculating richness and diversity stats for each cutoff...." R CMD BATCH ~/shell_scripts/make_richness_diversity_stats.r printf "Done!\n\n\n" #=======Done with graphics========= later="$(date +%s)" elapsed_seconds="$(expr $later - $now)" printf "Done!\n\n\n\nElapsed time: $elapsed_seconds seconds\n\n\n\n"