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

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

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

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

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

