Highly variable genes analysis by DESeq2 In the following article. There are two ways of getting highly variable genes:

resSig &lt;- subset(res, padj &lt; 0.1)
head(resSig[ order(resSig$log2FoldChange, decreasing=TRUE), ])


Getting genes that are statistically significant, then ordering them by the log2FoldChange which is 


  The column log2FoldChange is the effect size estimate. It tells us how much the gene’s expression seems to have changed due to treatment with dexamethasone in comparison to untreated samples.


And the second one:

topVarGenes &lt;- head(order(rowVars(assay(rld)),decreasing=TRUE),20)


I am struggling to understand what are the differences between the two ways of getting the most variable genes. What is the difference?
The first method (resSig$log2FoldChange) is for getting the most differentially expressed genes. These are the genes with the biggest differences between specific groups you pre-define.

The second method (rowVars(assay(rld))) is for getting the highly variable genes. These are the genes most variable across all samples regardless of which samples they are.