Mercurial > repos > bgruening > diffbind
comparison diffbind.R @ 9:20c431b4cf74 draft
Uploaded
author | bgruening |
---|---|
date | Tue, 14 Jan 2014 18:07:20 -0500 |
parents | fa67bcb732f6 |
children | b1b96b6ed60c |
comparison
equal
deleted
inserted
replaced
8:7929c8b3f6f9 | 9:20c431b4cf74 |
---|---|
21 opt = getopt(spec); | 21 opt = getopt(spec); |
22 | 22 |
23 # if help was asked for print a friendly message | 23 # if help was asked for print a friendly message |
24 # and exit with a non-zero error code | 24 # and exit with a non-zero error code |
25 if ( !is.null(opt$help) ) { | 25 if ( !is.null(opt$help) ) { |
26 cat(getopt(spec, usage=TRUE)); | 26 cat(getopt(spec, usage=TRUE)); |
27 q(status=1); | 27 q(status=1); |
28 } | 28 } |
29 | 29 |
30 | 30 |
31 library('DiffBind') | 31 library('DiffBind') |
32 # used to save to BED, GFF or WIG format | 32 # used to save to BED, GFF or WIG format |
33 library('rtracklayer') | 33 library('rtracklayer') |
34 | 34 |
35 if ( !is.null(opt$plots) ) { | 35 if ( !is.null(opt$plots) ) { |
36 pdf(opt$plots) | 36 pdf(opt$plots) |
37 } | 37 } |
38 | 38 |
39 | 39 |
40 sample = dba(sampleSheet=opt$infile) | 40 sample = dba(sampleSheet=opt$infile, peakFormat='bed') |
41 sample_count = dba.count(sample) | 41 sample_count = dba.count(sample) |
42 sample_contrast = dba.contrast(sample_count, categories=DBA_CONDITION) | 42 sample_contrast = dba.contrast(sample_count, categories=DBA_CONDITION) |
43 sample_analyze = dba.analyze(sample_contrast) | 43 sample_analyze = dba.analyze(sample_contrast) |
44 diff_bind = dba.report(sample_analyze) | 44 diff_bind = dba.report(sample_analyze) |
45 | 45 |