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

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

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

