foo(){
    #cut -f 2 mstime > mstmrca
	#cut -f 2 scrmtime > scrmtmrca
	echo "TMRCA" > figuretitle
	R CMD BATCH tmrca.r

    #cut -f 3 mstime > msbl
	#cut -f 3 scrmtime > scrmbl
	echo "BL" > figuretitle
	R CMD BATCH bl.r

	cut -f 6 ms_stats > msdata
	cut -f 6 scrm_stats > scrmdata
	echo "Tajima_D" > figuretitle
	R CMD BATCH ks.r

	cut -f 2 ms_stats > msdata
	cut -f 2 scrm_stats > scrmdata
	echo "Pairewise_difference" > figuretitle
	R CMD BATCH ks.r

	cut -f 8 ms_stats > msdata
	cut -f 8 scrm_stats > scrmdata
	echo "theta_H" > figuretitle
	R CMD BATCH ks.r

	cut -f 10 ms_stats > msdata
	cut -f 10 scrm_stats > scrmdata
	echo "H" > figuretitle
	R CMD BATCH ks.r
	}

mstime(){
    cat msout | gawk '/^\/\//{f="xx"++d} f{print > f} '
    for file in $(seq 1 1 ${rep})
        do 
        grep ";" xx${file} | sed -e 's/\[.*\]//g' | tail -1 >> msTrees
        done
        hybrid-Lambda -gt msTrees -tmrca mstmrca
        hybrid-Lambda -gt msTrees -bl msbl
        find . -name "xx*" -print0 | xargs -0 rm    
    }	
	
scrmtime(){
    cat scrmout | gawk '/^\/\//{f="xx"++d} f{print > f} '
    for file in $(seq 1 1 ${rep})
        do 
        grep ";" xx${file} | sed -e 's/\[.*\]//g' | tail -1 >> scrmTrees
        done
        hybrid-Lambda -gt scrmTrees -tmrca scrmtmrca
        hybrid-Lambda -gt scrmTrees -bl scrmbl
        find . -name "xx*" -print0 | xargs -0 rm    
    }	
		
