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

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

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

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

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

