This a reasonably standard pipeline.
If, for whatever reason, you can't run the lightweight Python wrapper on the computing cluster (if so - we'd like to hear why!), then it's a reasonably simple few lines of Python using our kwiklib API to add the .clu back into the .kwik; something like this:
from kwiklib import Experiment, read_clusters, add_clustering
def add_clu_to_kwik(filename, shank=1, dir=None):
"""Reads a .clu file and adds it to the .kwik file, overwriting any existing clusterings. The .clu file must have the same number of spikes as the .kwik."""
# Read the clusters.
clu = read_clusters(dir+filename + '.clu.' + str(shank))
with Experiment(filename, dir=dir, mode='a') as exp:
# Put the clusters in the kwik file.
add_clustering(exp._files, channel_group_id=str(shank), name='original', spike_clusters=clu, overwrite=True)
add_clustering(exp._files, channel_group_id=str(shank), name='main', spike_clusters=clu, overwrite=True)
filebase = 'my_experiment' # .clu, .kwik, .kwx should be in same directory
directory = '' # leave blank for current directory
shank = 1
add_clu_to_kwik(filebase, shank, dir = directory)