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


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

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

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

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

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

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

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

