#!/bin/csh
#
# This UCSF Generation and Cleanup script was created by AGNuS 2.0.
#


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

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

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

