#!/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 ./CBCAcoNH_xy.pipe
if (-e ./CBCAcoNH_xy.pipe) then
	echo "Deleteing ./CBCAcoNH_xy.pipe"
	rm -fr ./CBCAcoNH_xy.pipe 
endif

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

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

