All your questions would be answered by help("plotMD.DGEList") or help("plotMD").
It's hard to understand what the difficulty could be, since you simply use plotMD(fit). In what way have you been having difficulties? Have you actually tried the plotMD function, or is it simply a matter of not knowing what function to use? If the former, then show us what code you tried that lead to difficulties.
Have you looked at the example case studies that use plotMD, like this one:
https://f1000research.com/articles/5-1438
Your reference to a "two column data.frame" seems strange to me, because there is no documentation for an MD plot anywhere in R that calls for a two column data.frame. My only guess is that perhaps you have read the plotMA help page in geneplotter by mistake, but even that calls for a three column data.frame.
Later
In your second post you have now given the code you are using. I still don't see what the "challenge" is however. You seem to have been able to make an MD plot without any problems. There is no difficulty at all with your experimental design, in fact it's even simpler than the F1000Research example. You could BTW have simply used
plotMD(et)
which is even simpler than what you have, and would give the same plot. Did you try this?
As you can see, plotMD does color the DE genes automatically, and you obviously know how to change the colours yourself anyway. Of course, if there aren't actually any DE genes, then nothing will be highlighted.
So I ask again, what is the problem?
Thank you for the link you provided. However, the case study analysed is a 2 factor x 3 level one. The challenge I have is that I am using a single factor design with 4 levels. I used the exactTest function for fitting a linear model as shown in the code below:
data<-read.delim("Study1_counttable.txt")
sample_info<-read.delim('Study1_columntable.txt')
data.dge<-DGEList(data)
counts.per.million<-cpm(data.dge$counts)
table(rowSums(counts.per.million>1)>=3)
keep.exprs<-rowSums(counts.per.million>1)>=3
table(keep.exprs)
data.dge.removed<-data.dge[keep.exprs,,keep.lib.sizes=F]
tmm<-calcNormFactors(data.dge.removed,method='TMM')
design<-model.matrix(~0+treatment)
rownames(design)<-colnames(tmm)
colnames(design)<-levels(sample_info_ordered$condition)
y<-estimateDisp(tmm)
y$common.dispersion
plotBCV(y)
et<-exactTest(y)
plotMD(et, values=c(1,-1), col=c("red","blue"))
There are problems with your DE code here. You seem to be mixing up some code from the edgeR glm pipeline and some code from the edgeR classic pipeline in a way that doesn't go together. exactTest() assumes that you have set the group membership as part of the DGEList, but your code doesn't do that. On the other hand, exactTest() doesn't make any use of design matrices, so there is no purpose in creating one.
If you ran the code you give here, you would certainly get an error message from exactTest().