library(data.table) setorder(setDT(Spot_manifest)[, barcode := colnames(count)], barcode)
library(data.table) setorder(setDT(DF)[, index := factor(index, levels = ord)], index)