Fitting a principal curve into a diffusion map
If fit$ord gives you the order of cells on the curve, you should be able to obtain the first and last cells by doing the following:

first_cell_index &lt;- which.min(fit$ord)
last_cell_index &lt;- which.max(fit$ord)


However, I'm not sure this is so informative - if you're looking to get representative gene expression for the start and end of the curve, you should really be looking at the cluster of cells towards the start and end of the curve - for example, by comparing cells in clusters 1 and 3 that you showed in your first plot. A single cell will suffer from dropout and not tell you a lot about the cluster.