I had a GRanges object that I converted to a data frame. I am then sorting it by chr and start position:
df[order(df$seqnames, df$start),]
However, the resulting data frame starts with chr17. All chromosomes are present, including chr1 and chr10, which should come up before chr17. Is there some additional metadata that I am not aware of?
I forgot that factors have their own order. I converted seqnames to characters. I think that's even easier.
Perhaps. But you lose the information that the factor provides. For example, if you plot the data by chromosome, they will likely be rendered in a non-natural order.