#!/bin/csh
#
# This UCSF Generation and Cleanup script was created by AGNuS 2.0.
#


# Testing to delete ./pipe_conversion/
if (-e ./pipe_conversion/) then
	echo "Deleteing ./pipe_conversion/"
	rm -fr ./pipe_conversion/ 
endif

# Testing to delete ./pipe_processing/
if (-e ./pipe_processing/) then
	echo "Deleteing ./pipe_processing/"
	rm -fr ./pipe_processing/ 
endif

# Testing to delete ./cbcaconhgp3d_xy.pipe
if (-e ./cbcaconhgp3d_xy.pipe) then
	echo "Deleteing ./cbcaconhgp3d_xy.pipe"
	rm -fr ./cbcaconhgp3d_xy.pipe 
endif

# Testing to delete ./cbcaconhgp3d_xz.pipe
if (-e ./cbcaconhgp3d_xz.pipe) then
	echo "Deleteing ./cbcaconhgp3d_xz.pipe"
	rm -fr ./cbcaconhgp3d_xz.pipe 
endif

# Generate UCSF if ./cbcaconhgp3d.pipe exists
if (-e ./cbcaconhgp3d.pipe) then
	echo "Attempting to generate UCSF file ./cbcaconhgp3d.ucsf"
	if ( { pipe2ucsf  ./cbcaconhgp3d.pipe ./cbcaconhgp3d.ucsf } ) then 
		if (-e ./Convert_cbcaconhgp3d.csh ) then
			echo "ZZZZZZZZZZConversion_script_begin" >> ./cbcaconhgp3d.ucsf
			cat ./Convert_cbcaconhgp3d.csh >> ./cbcaconhgp3d.ucsf
			echo "ZZZZZZZZZZConversion_script_end" >> ./cbcaconhgp3d.ucsf
		endif
		if (-e ./Process_cbcaconhgp3d.csh ) then
			echo "ZZZZZZZZZZProcessing_script_begin" >> ./cbcaconhgp3d.ucsf
			cat ./Process_cbcaconhgp3d.csh >> ./cbcaconhgp3d.ucsf
			echo "ZZZZZZZZZZProcessing_script_end" >> ./cbcaconhgp3d.ucsf
		endif
		echo "Deleteing ./cbcaconhgp3d.pipe"
		rm -f ./cbcaconhgp3d.pipe 
	endif
endif

