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

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

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

