changeset 0:67d79ba0f7aa draft default tip

"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/check_headers commit 14b2e4d834a9856236affb7b77debecca360c542"
author azomics
date Tue, 27 Jul 2021 21:47:56 +0000
parents
children
files images/checkpanel.png images/h metacyto_checkpanel.R metacyto_checkpanel.xml test-data/mc_preprocesss_summary.metacyto_summary.txt
diffstat 5 files changed, 126 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
Binary file images/checkpanel.png has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/images/h	Tue Jul 27 21:47:56 2021 +0000
@@ -0,0 +1,1 @@
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/metacyto_checkpanel.R	Tue Jul 27 21:47:56 2021 +0000
@@ -0,0 +1,37 @@
+#!/usr/bin/env Rscript
+######################################################################
+#                  Copyright (c) 2018 Northrop Grumman.
+#                          All rights reserved.
+######################################################################
+#
+# Version 1 - January 2018
+# Author: Cristel Thomas
+#
+#
+
+library(MetaCyto)
+
+check_panel <- function(df, outfile = "") {
+  report <- panelSummary(df, ".", cluster = F, width = 30, height = 20)
+  markers <- data.frame("Markers" = row.names(report))
+  s <- cbind(markers, report)
+  write.table(s, file = outfile, quote = F, row.names = F, col.names = T, sep = "\t")
+}
+
+check_input_format <- function(infile = "", outfile = "") {
+  df <- read.table(infile, sep = "\t", header = T, colClasses = "character")
+  nm <- colnames(df)
+  check_ab <- if ("antibodies" %in% nm) TRUE else FALSE
+  check_sdy <- if ("study_id" %in% nm) TRUE else FALSE
+
+  if (check_sdy && check_ab) {
+    check_panel(df, outfile)
+  } else {
+    quit(save = "no", status = 10, runLast = FALSE)
+  }
+}
+
+################################################################################
+args <- commandArgs(trailingOnly = TRUE)
+
+check_input_format(args[1], args[2])
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/metacyto_checkpanel.xml	Tue Jul 27 21:47:56 2021 +0000
@@ -0,0 +1,81 @@
+<tool id="metacyto_checkpanel" name="Check markers in analysis panels" version="1.0+galaxy0" profile="18.01">
+  <description>for MetaCyto</description>
+  <requirements>
+    <requirement type="package" version="1.4.0">bioconductor-metacyto</requirement>
+  </requirements>
+  <stdio>
+    <exit_code range="1:9" />
+    <exit_code range="10" level="fatal" description="The input file cannot be used. Please check input format." />
+    <exit_code range="11:" />
+  </stdio>
+  <command><![CDATA[
+    Rscript --slave --vanilla '$__tool_directory__/metacyto_checkpanel.R' '${input_file}' '${output_file}';
+    #if $graph=="TRUE"
+      mv panel_summary.pdf '${pdf_out}'
+    #end if
+  ]]>
+  </command>
+  <inputs>
+    <param format="metacyto_summary.txt" name="input_file" type="data" label="MetaCyto preprocessing summary"/>
+    <param name="graph" type="boolean" label="Output visual summary?" checked="false" truevalue="TRUE" falsevalue="FALSE" />
+  </inputs>
+  <outputs>
+    <data format="tabular" name="output_file" label="Panel Summary of ${input_file.name}"/>
+    <data format="pdf" name="pdf_out" label="Visual Panel Summary of ${input_file.name}">
+      <filter>(graph)</filter>
+    </data>
+  </outputs>
+  <tests>
+      <test>
+        <param name="input_file" value="mc_preprocesss_summary.metacyto_summary.txt"/>
+        <param name="graph" value="True"/>
+        <output name="output_file" ftype="tabular">
+          <assert_contents>
+            <has_n_columns n="3" />
+            <has_text text="CD95" />
+            <has_n_lines n="14" />
+          </assert_contents>
+        </output>
+        <output name="pdf_out" ftype="pdf">
+          <assert_contents>
+            <has_size value="4569" delta="500" />
+          </assert_contents>
+        </output>
+      </test>
+  </tests>
+  <help><![CDATA[
+    Metacyto Check Markers in analysis panels
+    -----------------------------------------
+
+    This tool uses MetaCyto's panel summary function to compare marker names between groups of FCS files.
+
+    **Input**
+    This tool requires the MetaCyto pre-processing Summary as input.
+
+    **Output**
+    This tool generates a table and an optional visual representation in PDF of how markers are distributed in the FCS file sets.
+
+
+    **Example**
+
+    *Input* - Summary Table::
+
+       study_id antibodies                  filenames
+       group1   Marker1|Marker2|Marker3|... file1.fcs
+       group2   Marker1|Marker2|Marker3|... file2.fcs
+       ...      ...                         ...
+
+    *Output* - Panel Summary::
+
+       Markers group1 group2 ...
+       Marker1 1      1      ...
+       Marker2 1      1      ...
+       Marker3 0      1      ...
+       ...     ...    ...    ...
+
+    *Graphical output*
+
+    .. image:: ./images/checkpanel.png
+  ]]>
+  </help>
+</tool>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/mc_preprocesss_summary.metacyto_summary.txt	Tue Jul 27 21:47:56 2021 +0000
@@ -0,0 +1,7 @@
+study_id	antibodies	filenames
+group 1	FSC-A|SSC-A|CD11A|CD4|CD16|CD28|CD95|CD3|CD62L|CD8B|CCR7|TIME|SAMPLE_ID	Hs90208Bd_C20090205_00.583331.fcs
+group 1	FSC-A|SSC-A|CD11A|CD4|CD16|CD28|CD95|CD3|CD62L|CD8B|CCR7|TIME|SAMPLE_ID	Hs90210Bd_C20090205_00.583065.fcs
+group 1	FSC-A|SSC-A|CD11A|CD4|CD16|CD28|CD95|CD3|CD62L|CD8B|CCR7|TIME|SAMPLE_ID	Hs90211Bd_C20090205_00.583066.fcs
+group 2	FSC-A|SSC-A|CD11A|CD4|CD16|CD28|CD95|CD3|CD62L|CD8B|CCR7|TIME|SAMPLE_ID	T_Hs60003Bd_C200900407A_00.581924.fcs
+group 2	FSC-A|SSC-A|CD11A|CD4|CD16|CD28|CD95|CD3|CD62L|CD8B|CCR7|TIME|SAMPLE_ID	T_Hs60011Bd_C200900505A_00.581822.fcs
+group 2	FSC-A|SSC-A|CD11A|CD4|CD16|CD28|CD95|CD3|CD62L|CD8B|CCR7|TIME|SAMPLE_ID	T_Hs60012Bd_C200900505A_00.581833.fcs