I have been using the DeSeq2 function to look at differential expression. I have one factor (treatment) but three levels (or three different types of treatment). How do I know which group is my reference? When I do it with only two levels, how do I know my reference group?
The first factor group is the primary factor that all of the others are compared against.
Quote from the tool form
Inputs
Count Files
DESeq2 takes count tables generated from featureCounts, HTSeq-count or StringTie as input. Count tables must be generated for each sample individually. One header row is assumed, but files with no header (e.g from HTSeq) can be input with the Files have header? option set to No. DESeq2 is capable of handling multiple factors that affect your experiment. The first factor you input is considered as the primary factor that affects gene expressions. Optionally, you can input one or more secondary factors that might influence your experiment. But the final output will be changes in genes due to primary factor in presence of secondary factors. Each factor has two levels/states. You need to select appropriate count table from your history for each factor level.
If you are looking for more control over the comparisons, consider trying out Limma and the “contrasts” options. It makes use of similar types of count files: see the tutorial linked on the tool form (also down in the Help).