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

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

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

