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

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

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

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

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

