diff diffbind.R @ 10:b1b96b6ed60c draft

Uploaded
author bgruening
date Thu, 16 Jan 2014 04:17:16 -0500
parents 20c431b4cf74
children a8dc71379df0
line wrap: on
line diff
--- a/diffbind.R	Tue Jan 14 18:07:20 2014 -0500
+++ b/diffbind.R	Thu Jan 16 04:17:16 2014 -0500
@@ -30,7 +30,6 @@
 
 library('DiffBind')
 # used to save to BED, GFF or WIG format
-library('rtracklayer')
 
 if ( !is.null(opt$plots) ) {
     pdf(opt$plots)
@@ -39,12 +38,14 @@
 
 sample = dba(sampleSheet=opt$infile, peakFormat='bed')
 sample_count = dba.count(sample)
-sample_contrast = dba.contrast(sample_count, categories=DBA_CONDITION)
+sample_contrast = dba.contrast(sample_count, categories=DBA_CONDITION, minMembers=2)
 sample_analyze = dba.analyze(sample_contrast)
 diff_bind = dba.report(sample_analyze)
-
+orvals = dba.plotHeatmap(sample_analyze, contrast=1, correlations=FALSE)
 
-export(diff_bind, opt$outfile, format=opt$format)
+resSorted <- diff_bind[order(diff_bind$FDR),]
+write.table(as.data.frame(resSorted), file = opt$outfile, sep="\t", quote = FALSE, append=TRUE, row.names = FALSE, col.names = FALSE)
+
 
 dev.off()
 sessionInfo()