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

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

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

