Change order of groups in .shared file


I am currently working on the beta diversity analysis in Mothur. My .shared file contains all the samples of interest, arranged in a certain order (from somewhere upstream, I assume). The order of the samples seem to be quite important in interpreting the visual results in the beta diversity analysis, i.e. the heatmaps. I know I can specify what groups to visualize (groups=A-B-C…) manually. I have 86 samples, all with more complex names than “A”, “B”, “C” etc., so this will be quite a hazzle.

Is there a way to more easily control what order the samples will be outputted in the beta diversity analysis?



You can manually edit the row order in the shared file. Even better and more reproducible and automated would be to generate a heat map in R and order the rows using their commands.


Great, thanks for answering!