This is a question on the dba.report function of DiffBind.
I'm trying to retrieve only the upregulated differential sites and have been using the "bUP" and "fold" arguments with the dba.report function, but I've not been able to filter out to obtain only the upregulated differential sites.
My R scripts for this purpose are as follow:
contrast.res <- dba.contrast(count.data, dba.object$masks$IL4c, dba.object$masks$Res, "IL4c", "Res")
diff.analysis.res <- dba.analyze(contrast.res, method=DBA_DESEQ2, bCorPlot=TRUE, bReduceObjects=TRUE)
dba.report(diff.analysis.res, method=DBA_DESEQ2, th=0.1, bUsePval=FALSE, fold=0, file="diff_sites_res_up300")
dba.report(diff.analysis.res, method=DBA_DESEQ2, th=0.1, bUsePval=FALSE, bALL=FASLSE, bUP=TRUE, file="diff_sites_res_up300")
I'm using R 3.0.2 and DiffBind 1.8.5
I'd appreciate any help on this.
Thanks,
Mei San
Hi Rory,
Thanks, it helped.
However, I've a couple points for clarification:
1. Could you suggest a way to capture the subset negative and positive fold changes reports as a csv file (equivalent to the "file" parameter in dba.report)? I eventually exported the GRanges object as a bed file using rtracklayer's export.bed function, but I would still like to capture a direct csv file from the subset reports for comparison. The conventional write.table won't work.
2. When I exported the differential sites report as a bed file, I did not have the strand information (i.e. if it's + or -). This is because the count data was used to generate the output and there was no strand information involved, that's why it's lost in the eventual bed file - please correct me if I'm wrong.
Thanks,
Mei San
Hi Mei San-
1, It sounds like you have found a way to do this already. You can;t really do it directly from the interface. I can tell you that the write function used internally is:
2. You are more or less correct about strand information, Basically peak data from ChIP is not strand-specific -- we can detect that the protein is binding to the DNA at the given location, but not if the binding is strand-specific. Peak intervals are generally specified on the + strand by default.
Cheers-
Rory