Use single quote with double back slash you will not get any error.

touch ~/deleted/$(echo "directory_"$(readlink -f foo)|tr '/' '\\')