changeset 0:313332cb7745 draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/chipseeker commit 9324a8e21c41d62b461dce9c3c17df544e5cd0ce
author rnateam
date Thu, 24 May 2018 18:22:53 -0400
parents
children 2019b4dd86a8
files chipseeker.xml test-data/in.diffbind test-data/out.pdf test-data/out.tab
diffstat 4 files changed, 154 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/chipseeker.xml	Thu May 24 18:22:53 2018 -0400
@@ -0,0 +1,142 @@
+<tool id="chipseeker" name="ChIPseeker" version="1.14.2">
+    <description>for ChIP peak annotation and visualization</description>
+    <requirements>
+        <requirement type="package" version="1.14.2">bioconductor-chipseeker</requirement>
+        <requirement type="package" version="3.4.0">bioconductor-txdb.hsapiens.ucsc.hg38.knowngene</requirement>
+        <requirement type="package" version="3.2.2">bioconductor-txdb.hsapiens.ucsc.hg19.knowngene</requirement>
+        <requirement type="package" version="3.4.0">bioconductor-txdb.Mmusculus.UCSC.mm10.knownGene</requirement>
+        <requirement type="package" version="3.5.0">bioconductor-org.hs.eg.db</requirement>
+        <requirement type="package" version="3.5.0">bioconductor-org.mm.eg.db</requirement>
+    </requirements>
+    <version_command><![CDATA[
+echo $(R --version | grep version | grep -v GNU)", ChIPseeker version" $(R --vanilla --slave -e "library(ChIPseeker); cat(sessionInfo()\$otherPkgs\$ChIPseeker\$Version)" 2> /dev/null | grep -v -i "WARNING: ")", TxDb.Hsapiens.UCSC.hg38.knownGene version" $(R --vanilla --slave -e "library(TxDb.Hsapiens.UCSC.hg38.knownGene); cat(sessionInfo()\$otherPkgs\$TxDb.Hsapiens.UCSC.hg38.knownGene\$Version)" 2> /dev/null | grep -v -i "WARNING: ")", TxDb.Hsapiens.UCSC.hg19.knownGene version" $(R --vanilla --slave -e "library(TxDb.Hsapiens.UCSC.hg19.knownGene); cat(sessionInfo()\$otherPkgs\$TxDb.Hsapiens.UCSC.hg19.knownGene\$Version)" 2> /dev/null | grep -v -i "WARNING: ")", TxDb.Mmusculus.UCSC.mm10.knownGene version" $(R --vanilla --slave -e "library(TxDb.Mmusculus.UCSC.mm10.knownGene); cat(sessionInfo()\$otherPkgs\$TxDb.Mmusculus.UCSC.mm10.knownGene\$Version)" 2> /dev/null | grep -v -i "WARNING: ")", org.Hs.eg.db version" $(R --vanilla --slave -e "library(org.Hs.eg.db); cat(sessionInfo()\$otherPkgs\$org.Hs.eg.db\$Version)" 2> /dev/null | grep -v -i "WARNING: ")", org.Mm.eg.db version" $(R --vanilla --slave -e "library(org.Mm.eg.db); cat(sessionInfo()\$otherPkgs\$org.Mm.eg.db\$Version)" 2> /dev/null | grep -v -i "WARNING: ")
+    ]]></version_command>
+    <command detect_errors="exit_code"><![CDATA[
+        #if $rscript:
+            cp '${chipseeker_script}' '${out_rscript}' &&
+        #end if
+        Rscript '${chipseeker_script}'
+    ]]>
+    </command>
+    <configfiles>
+        <configfile name="chipseeker_script"><![CDATA[
+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.
+loc <- Sys.setlocale("LC_MESSAGES", "en_US.UTF-8")
+
+suppressPackageStartupMessages(library(ChIPseeker))
+
+genome <- "${genome}"
+
+if (genome == "hg38") {
+    suppressPackageStartupMessages({
+        library(TxDb.Hsapiens.UCSC.hg38.knownGene)
+        library(org.Hs.eg.db)
+    })
+    txdb <- TxDb.Hsapiens.UCSC.hg38.knownGene
+    annodb <- "org.Hs.eg.db"
+} else if (genome == "hg19") {
+    suppressPackageStartupMessages({
+        library(TxDb.Hsapiens.UCSC.hg19.knownGene)
+        library(org.Hs.eg.db)
+    })
+    txdb <- TxDb.Hsapiens.UCSC.hg19.knownGene
+    annodb <- "org.Hs.eg.db"
+} else if (genome == "mm10") {
+    suppressPackageStartupMessages({
+        library(TxDb.Mmusculus.UCSC.mm10.knownGene)
+        library(org.Mm.eg.db)
+    })
+    txdb <- TxDb.Mmusculus.UCSC.mm10.knownGene
+    annodb <- "org.Mm.eg.db"
+} else {
+    cat(paste("Genome not supported", genome))
+}
+
+peaks <- readPeakFile('$peaks_file')
+peakAnno <-  annotatePeak(peaks, TxDb=txdb, annoDb=annodb)
+write.table(peakAnno, file='$out_tab', sep="\t", row.names=FALSE, quote=FALSE)
+
+if (!is.null("${pdf}")) {
+    pdf("out.pdf", width=14)
+    plotAnnoPie(peakAnno)
+    plotAnnoBar(peakAnno)
+    vennpie(peakAnno)
+    upsetplot(peakAnno)
+    plotDistToTSS(peakAnno, title="Distribution of transcription factor-binding loci\nrelative to TSS")
+    dev.off()
+}
+    ]]></configfile>
+    </configfiles>
+
+    <inputs>
+        <param name="peaks_file" type="data" format="bed" label="Peaks file" help="A peaks file in BED format." />
+        <param name="genome" type="select" label="Genome" help="Select the genome. Options are hg38, hg19 or mm10.">
+            <option value="hg38">hg38</option>
+            <option value="hg19">hg19</option>
+            <option value="mm10">mm10</option>
+        </param>
+
+        <param name="pdf" type="boolean" truevalue="True" falsevalue="" checked="True" label="Output a PDF file of plots?" help="Default: Yes" />
+        <param name="rscript" type="boolean" truevalue="TRUE" falsevalue="FALSE" checked="False" label="Output Rscript?" help="If this option is set to Yes, the Rscript used to annotate the IDs will be provided as a text file in the output. Default: No" />
+    </inputs>
+
+        <outputs>
+            <data name="out_tab" format="tabular" from_work_dir="out.tab" label="${tool.name} on ${on_string}: Annotated Peaks" />
+            <data name="out_plots" format="pdf" from_work_dir="out.pdf" label="${tool.name} on ${on_string}: Plots">
+                <filter>pdf</filter>
+            </data>
+            <data name="out_rscript" format="txt" from_work_dir="out_rscript.txt" label="${tool.name} on ${on_string}: Rscript">
+                <filter>rscript</filter>
+            </data>
+        </outputs>
+
+    <tests>
+        <!-- Ensure outputs work -->
+        <test expect_num_outputs="3">
+            <param name="peaks_file" value="in.diffbind" ftype="bed"/>
+            <param name="genome" value="hg19"/>
+            <param name="rscript" value="True"/>
+            <output name="out_tab" file="out.tab" />
+            <output name="out_plots" file="out.pdf" compare="sim_size"/>
+            <output name="out_rscript" >
+                <assert_contents>
+                    <has_text_matching expression="peakAnno.*annotatePeak" />
+                </assert_contents>
+            </output>
+        </test>
+    </tests>
+    <help><![CDATA[
+
+.. class:: infomark
+
+**What it does**
+
+ChIPseeker_ is a Bioconductor package for annotating ChIP-seq data analysis. See
+the `ChIPseeker vignette`_ for more information.
+
+-----
+
+**Inputs**
+
+A peaks file in BED format e.g from MACS2 or DiffBind.
+
+-----
+
+**Outputs**
+
+This tool outputs
+
+    * a table of annotated peaks
+    * a PDF of plots
+    * the R script used by this tool
+
+.. _ChIPseeker: https://bioconductor.org/packages/release/bioc/html/ChIPseeker.html
+.. _`ChIPseeker vignette`: http://bioconductor.org/packages/release/bioc/vignettes/ChIPseeker/inst/doc/ChIPseeker.html
+
+]]></help>
+    <citations>
+        <citation type="doi">10.1093/bioinformatics/btv145</citation>
+    </citations>
+</tool>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/in.diffbind	Thu May 24 18:22:53 2018 -0400
@@ -0,0 +1,6 @@
+seqnames	start	end	width	strand	Conc	Conc_Responsive	Conc_Resistant	Fold	p.value	FDR
+chr18	394600	396513	1914	*	7.15	5.55	7.89	-2.35	7.06e-24	9.84e-21
+chr18	111567	112005	439	*	5.71	6.53	3.63	2.89	1.27e-08	8.88e-06
+chr18	346464	347342	879	*	5	5.77	3.24	2.52	6.51e-06	0.00303
+chr18	399014	400382	1369	*	7.62	7	8.05	-1.04	1.04e-05	0.00364
+chr18	371110	372102	993	*	4.63	3.07	5.36	-2.3	8.1e-05	0.0226
Binary file test-data/out.pdf has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/out.tab	Thu May 24 18:22:53 2018 -0400
@@ -0,0 +1,6 @@
+seqnames	start	end	width	strand	width.1	strand.1	Conc	Conc_Responsive	Conc_Resistant	Fold	p.value	FDR	annotation	geneChr	geneStart	geneEnd	geneLength	geneStrand	geneId	transcriptId	distanceToTSS	ENSEMBL	SYMBOL	GENENAME
+chr18	394601	396513	1913	*	1914	*	7.15	5.55	7.89	-2.35	7.06e-24	9.84e-21	Intron (uc002kkm.3/81035, intron 2 of 9)	18	319355	500729	181375	2	81035	uc002kkm.3	104216	ENSG00000158270	COLEC12	collectin subfamily member 12
+chr18	111568	112005	438	*	439	*	5.71	6.53	3.63	2.89	1.27e-08	8.88e-06	Promoter (2-3kb)	18	109065	122222	13158	1	727758	uc002kke.3	2503	ENSG00000263006	ROCK1P1	Rho associated coiled-coil containing protein kinase 1 pseudogene 1
+chr18	346465	347342	878	*	879	*	5	5.77	3.24	2.52	6.51e-06	0.00303	Exon (uc002kkm.3/81035, exon 5 of 10)	18	225089	268059	42971	2	9984	uc002kkl.2	-78406	ENSG00000079134	THOC1	THO complex 1
+chr18	399015	400382	1368	*	1369	*	7.62	7	8.05	-1.04	1.04e-05	0.00364	Intron (uc002kkm.3/81035, intron 2 of 9)	18	319355	500729	181375	2	81035	uc002kkm.3	100347	ENSG00000158270	COLEC12	collectin subfamily member 12
+chr18	371111	372102	992	*	993	*	4.63	3.07	5.36	-2.3	8.1e-05	0.0226	Intron (uc002kkm.3/81035, intron 2 of 9)	18	225089	268059	42971	2	9984	uc002kkl.2	-103052	ENSG00000079134	THOC1	THO complex 1