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

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

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

