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

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

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

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

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

