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

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

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

