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

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

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

