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

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

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

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

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

