# HG changeset patch # User bjoern-gruening # Date 1389741122 18000 # Node ID c0f5b21335067f4ec6f7afd0bb05aa3e66ab8f2a initial commit for DiffBind diff -r 000000000000 -r c0f5b2133506 diffbind.R --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/diffbind.R Tue Jan 14 18:12:02 2014 -0500 @@ -0,0 +1,50 @@ +## Setup R error handling to go to stderr +options( show.error.messages=F, error = function () { cat( geterrmessage(), file=stderr() ); q( "no", 1, F ) } ) +# we need that to not crash galaxy with an UTF8 error on German LC settings. +Sys.setlocale("LC_MESSAGES", "en_US.UTF-8") + +library('getopt'); +options(stringAsfactors = FALSE, useFancyQuotes = FALSE) +args <- commandArgs(trailingOnly = TRUE) + +#get options, using the spec as defined by the enclosed list. +#we read the options from the default: commandArgs(TRUE). +spec = matrix(c( + 'verbose', 'v', 2, "integer", + 'help' , 'h', 0, "logical", + 'outfile' , 'o', 1, "character", + 'plots' , 'p', 2, "character", + 'infile' , 'i', 1, "character", + 'format', 'f', 1, 'character' +), byrow=TRUE, ncol=4); + +opt = getopt(spec); + +# if help was asked for print a friendly message +# and exit with a non-zero error code +if ( !is.null(opt$help) ) { + cat(getopt(spec, usage=TRUE)); + q(status=1); +} + + +library('DiffBind') +# used to save to BED, GFF or WIG format +library('rtracklayer') + +if ( !is.null(opt$plots) ) { + pdf(opt$plots) +} + + +sample = dba(sampleSheet=opt$infile, peakFormat='bed') +sample_count = dba.count(sample) +sample_contrast = dba.contrast(sample_count, categories=DBA_CONDITION) +sample_analyze = dba.analyze(sample_contrast) +diff_bind = dba.report(sample_analyze) + + +export(diff_bind, opt$outfile, format=opt$format) + +dev.off() +sessionInfo() diff -r 000000000000 -r c0f5b2133506 diffbind.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/diffbind.xml Tue Jan 14 18:12:02 2014 -0500 @@ -0,0 +1,91 @@ + + differential binding analysis of ChIP-Seq peak data + + Rscript + DESeq2 + R_3_0_1 + deseq2 + diffbind + + + diffbind.R + -i $infile + -o $outfile + -p $plots + -f $format + ; + cat $infile; + + + + + + + + + + + + + + + + + + + + + + + + + + +SampleID,Tissue,Factor,Condition,Replicate,bamReads,bamControl,Peaks +#for $sample in $samples: +$sample.sample_id,$sample.tissue,$sample.factor,$sample.condition,$sample.replicate,$sample.bamreads,$sample.bamcontrol,$sample.peaks +#end for + + + + + + + + + + + pdf == True + + + + + +.. class:: infomark + +**What it does** + + +------ + +**References** + +DiffBind_ Authors: Rory Stark, Gordon Brown + +.. _DiffBind: http://www.bioconductor.org/packages/release/bioc/html/DiffBind.html + +Wrapper authors: Bjoern Gruening, Pavankumar Videm + + + diff -r 000000000000 -r c0f5b2133506 tool_dependencies.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tool_dependencies.xml Tue Jan 14 18:12:02 2014 -0500 @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + https://github.com/bgruening/download_store/raw/master/DiffBind-1_8_3/BiocGenerics_0.8.0.tar.gz + https://github.com/bgruening/download_store/raw/master/DiffBind-1_8_3/IRanges_1.20.6.tar.gz + https://github.com/bgruening/download_store/raw/master/DiffBind-1_8_3/XVector_0.2.0.tar.gz + https://github.com/bgruening/download_store/raw/master/DiffBind-1_8_3/limma_3.18.9.tar.gz + https://github.com/bgruening/download_store/raw/master/DiffBind-1_8_3/gtools_3.1.1.tar.gz + https://github.com/bgruening/download_store/raw/master/DiffBind-1_8_3/gdata_2.13.2.tar.gz + https://github.com/bgruening/download_store/raw/master/DiffBind-1_8_3/bitops_1.0-6.tar.gz + https://github.com/bgruening/download_store/raw/master/DiffBind-1_8_3/caTools_1.16.tar.gz + https://github.com/bgruening/download_store/raw/master/DiffBind-1_8_3/Biostrings_2.30.1.tar.gz + https://github.com/bgruening/download_store/raw/master/DiffBind-1_8_3/GenomicRanges_1.14.4.tar.gz + https://github.com/bgruening/download_store/raw/master/DiffBind-1_8_3/RColorBrewer_1.0-5.tar.gz + https://github.com/bgruening/download_store/raw/master/DiffBind-1_8_3/amap_0.8-7.tar.gz + https://github.com/bgruening/download_store/raw/master/DiffBind-1_8_3/edgeR_3.4.2.tar.gz + https://github.com/bgruening/download_store/raw/master/DiffBind-1_8_3/gplots_2.12.1.tar.gz + https://github.com/bgruening/download_store/raw/master/DiffBind-1_8_3/zlibbioc_1.8.0.tar.gz + https://github.com/bgruening/download_store/raw/master/DiffBind-1_8_3/Rsamtools_1.14.2.tar.gz + https://github.com/bgruening/download_store/raw/master/DiffBind-1_8_3/DiffBind_1.8.3.tar.gz + https://github.com/bgruening/download_store/raw/master/DiffBind-1_8_3/XML_3.98-1.1.tar.gz + https://github.com/bgruening/download_store/raw/master/DiffBind-1_8_3/BSgenome_1.30.0.tar.gz + https://github.com/bgruening/download_store/raw/master/DiffBind-1_8_3/RCurl_1.95-4.1.tar.gz + https://github.com/bgruening/download_store/raw/master/DiffBind-1_8_3/rtracklayer_1.22.0.tar.gz + https://github.com/bgruening/download_store/raw/master/DiffBind-1_8_3/getopt_1.20.0.tar.gz + + + + + Differential Binding Analysis of ChIP-Seq peak data + http://www.bioconductor.org/packages/release/bioc/html/DiffBind.html + + +