Repository 'flowtext_summary'
hg clone https://toolshed.g2.bx.psu.edu/repos/immport-devteam/flowtext_summary

Changeset 0:d61ed37c06ee (2017-02-27)
Next changeset 1:715c9696dcf5 (2020-08-04)
Commit message:
Uploaded
added:
flowtext_summary/FCSstats_text.xml
flowtext_summary/FCSstats_txt.py
flowtext_summary/test-data/graph.png
flowtext_summary/test-data/input.flowtext
flowtext_summary/test-data/output.tabular
b
diff -r 000000000000 -r d61ed37c06ee flowtext_summary/FCSstats_text.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/flowtext_summary/FCSstats_text.xml Mon Feb 27 12:59:41 2017 -0500
[
@@ -0,0 +1,55 @@
+<tool id="get_txt_fcs_stats" name="Get summary" version="1.0">
+  <description>of txt-converted FCS files.</description>
+  <requirements>
+    <requirement type="package" version="0.17.1">pandas</requirement>
+  </requirements>
+  <stdio>
+    <exit_code range="2:" level="fatal" description="See stderr for more details." />
+  </stdio>
+  <command><![CDATA[
+    python $__tool_directory__/FCSstats_txt.py -i "${input}" -o "${output}"
+  ]]>
+  </command>
+  <inputs>
+    <param format="flowtext" name="input" type="data" label="txt-converted FCS file"/>
+  </inputs>
+  <outputs>
+    <data format="tabular" name="output" label="Summary statisitics of ${input.name}"/>
+  </outputs>
+  <tests>
+    <test>
+      <param name="input" value="input.flowtext"/>
+      <output name="output" file="output.tabular"/>
+    </test>
+  </tests>
+  <help><![CDATA[
+   This tool generates a summary of a txt-converted FCS file and list of markers.
+
+-----
+
+**Input file**
+
+This tool uses txt-converted FCS files as input.
+
+**Output file**
+
+File summary includes number of events, list of markers and parameters, and summary statistics for each.
+
+-----
+
+**Example**
+
+*Output*::
+
+        FSC    SSC    CD4   CCR3   CD8    CCR4
+   mean 475.4  413.4  288.8 157.9  218.1  179.6
+   std  165.2  390.7  199.9 117.3  201.7  95.7
+   min  261.0  18.0   0.0   0.0    0.0    0.0
+   25%  354.0  121.0  112.0 65.0   58.0   109.0
+   50%  398.0  167.0  209.0 159.0  180.0  179.0
+   75%  609.0  951.2  512.0 237.0  275.0  245.0
+   max  1023.0 1023.0 775.0 1023.0 1023.0 841.0
+   20000 events
+  ]]>
+  </help>
+</tool>
b
diff -r 000000000000 -r d61ed37c06ee flowtext_summary/FCSstats_txt.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/flowtext_summary/FCSstats_txt.py Mon Feb 27 12:59:41 2017 -0500
[
@@ -0,0 +1,45 @@
+#!/usr/bin/env python
+
+######################################################################
+#                  Copyright (c) 2016 Northrop Grumman.
+#                          All rights reserved.
+######################################################################
+
+from __future__ import print_function
+import sys
+import pandas as pd
+from argparse import ArgumentParser
+
+
+def get_txt_stats(in_file, out_file):
+    df = pd.read_table(in_file)
+    summary = df.describe().round(1)
+    df1 = summary[1:]
+    x = summary[:1].values.tolist()
+    df1.to_csv(out_file, sep="\t")
+    with open(out_file, "a") as ot:
+        ot.write("\n\n" + str(int(x[0][0])) + " events\n")
+    return
+
+
+if __name__ == "__main__":
+    parser = ArgumentParser(
+             prog="getTxtStats",
+             description="Prints summary statistics from given file.")
+
+    parser.add_argument(
+            '-i',
+            dest="input_file",
+            required=True,
+            help="File location for the text file.")
+
+    parser.add_argument(
+            '-o',
+            dest="output_file",
+            required=True,
+            help="Name of the output file.")
+
+    args = parser.parse_args()
+
+    get_txt_stats(args.input_file, args.output_file)
+    sys.exit(0)
b
diff -r 000000000000 -r d61ed37c06ee flowtext_summary/test-data/graph.png
b
Binary file flowtext_summary/test-data/graph.png has changed
b
diff -r 000000000000 -r d61ed37c06ee flowtext_summary/test-data/input.flowtext
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/flowtext_summary/test-data/input.flowtext Mon Feb 27 12:59:41 2017 -0500
b
b'@@ -0,0 +1,20001 @@\n+Forward Scatter\tSide Scatter\tFITC CD4\tPE CCR3\tPP CD8\tAPC CCR4\n+449\t157\t551\t129\t169\t292\n+894\t1023\t199\t277\t320\t227\n+262\t73\t437\t69\t0\t146\n+340\t115\t509\t268\t0\t74\n+316\t76\t50\t0\t60\t129\n+394\t144\t83\t138\t335\t194\n+383\t139\t499\t0\t0\t224\n+800\t1023\t239\t284\t288\t280\n+388\t97\t534\t111\t83\t177\n+481\t117\t566\t247\t157\t99\n+652\t997\t118\t236\t250\t300\n+333\t100\t526\t82\t21\t34\n+636\t1023\t162\t290\t242\t261\n+283\t137\t0\t32\t137\t151\n+389\t105\t538\t36\t0\t130\n+684\t1023\t111\t180\t205\t186\n+688\t1023\t156\t255\t233\t77\n+431\t83\t64\t114\t586\t144\n+788\t1023\t167\t258\t158\t241\n+687\t1023\t94\t234\t218\t133\n+676\t1023\t149\t287\t215\t102\n+869\t1023\t223\t285\t277\t388\n+986\t1023\t267\t290\t261\t224\n+603\t1018\t193\t272\t255\t135\n+404\t168\t532\t113\t0\t0\n+661\t501\t418\t184\t256\t248\n+381\t169\t508\t0\t125\t204\n+686\t860\t49\t190\t225\t97\n+402\t202\t117\t90\t693\t316\n+418\t89\t566\t19\t0\t306\n+303\t119\t35\t155\t87\t108\n+402\t184\t70\t111\t627\t309\n+304\t107\t0\t118\t86\t257\n+360\t124\t26\t10\t615\t209\n+372\t118\t558\t125\t0\t120\n+659\t1023\t341\t246\t228\t256\n+720\t1023\t180\t178\t212\t229\n+712\t1002\t228\t163\t282\t195\n+321\t90\t472\t35\t151\t178\n+376\t154\t54\t61\t587\t264\n+744\t1023\t229\t271\t226\t216\n+329\t149\t82\t173\t629\t269\n+447\t153\t524\t161\t138\t197\n+364\t294\t248\t335\t0\t222\n+645\t1023\t177\t179\t282\t254\n+1023\t1023\t456\t557\t482\t445\n+440\t297\t403\t122\t82\t135\n+432\t115\t572\t165\t78\t225\n+366\t112\t299\t0\t23\t98\n+673\t1023\t230\t330\t294\t261\n+707\t1023\t222\t246\t206\t242\n+628\t1023\t161\t288\t241\t234\n+601\t1023\t126\t296\t278\t191\n+347\t157\t531\t0\t42\t49\n+262\t65\t210\t36\t0\t176\n+349\t101\t481\t139\t96\t211\n+596\t1023\t193\t252\t233\t288\n+375\t112\t546\t184\t59\t88\n+436\t141\t123\t229\t611\t218\n+389\t131\t576\t0\t0\t144\n+353\t97\t477\t204\t0\t221\n+400\t149\t91\t143\t639\t310\n+742\t1023\t225\t277\t114\t241\n+747\t1023\t132\t254\t227\t176\n+350\t122\t489\t194\t0\t99\n+407\t131\t535\t209\t0\t57\n+269\t92\t0\t0\t5\t128\n+355\t142\t540\t103\t115\t84\n+387\t123\t529\t116\t115\t0\n+358\t86\t523\t18\t32\t101\n+388\t132\t105\t99\t653\t329\n+305\t165\t509\t126\t0\t63\n+454\t168\t113\t124\t629\t251\n+400\t121\t176\t0\t581\t240\n+405\t230\t115\t233\t632\t289\n+596\t942\t74\t236\t280\t279\n+380\t211\t72\t236\t670\t255\n+392\t127\t546\t204\t47\t105\n+519\t409\t169\t117\t136\t417\n+767\t1023\t196\t278\t269\t192\n+367\t121\t528\t95\t0\t117\n+378\t175\t507\t201\t0\t227\n+664\t668\t359\t287\t268\t166\n+435\t161\t543\t185\t67\t197\n+358\t233\t0\t136\t148\t331\n+633\t977\t95\t250\t175\t187\n+373\t128\t564\t0\t35\t119\n+386\t123\t547\t0\t65\t181\n+319\t110\t497\t77\t101\t0\n+401\t86\t503\t126\t184\t138\n+364\t136\t0\t161\t15\t0\n+741\t1023\t188\t221\t270\t230\n+677\t510\t416\t268\t195\t188\n+311\t212\t17\t22\t91\t146\n+642\t1023\t152\t268\t221\t196\n+739\t395\t291\t219\t174\t75\n+760\t1023\t175\t247\t284\t198\n+410\t168\t528\t125\t0\t211\n+338\t158\t71\t69\t1\t155\n+401\t137\t34\t223\t641\t291\n+780\t853\t198\t256\t230\t270\n+389\t185\t160\t28\t664\t319\n+369\t130\t567\t21\t0\t38\n+359\t119\t60\t55\t660\t217\n+349\t97\t522\t0\t21\t0\n+553\t762\t136\t193\t137\t198\n+476\t91\t554\t0\t0\t102\n+372\t77\t506\t0\t89\t0\n+628\t1023\t202\t285\t305\t61\n+493\t351\t403\t242\t150\t196\n+393\t181\t128\t0\t148\t83\n+400\t143\t554\t109\t89\t115\n+387\t91\t544\t199\t141\t45\n+564\t924\t104\t220\t170\t249\n+673\t237\t124\t79\t648\t268\n+363\t203\t84\t213\t79\t224\n+353\t83\t517\t168\t70\t133\n+378\t157\t577\t0\t68\t205\n+338\t139\t25\t41\t38\t92\n+330\t70\t0\t55\t597\t165\n+558\t280\t421\t143\t113\t226\n+447\t288\t156\t211\t5\t33\n+341\t112\t457\t22\t0\t116\n+757\t1023\t205\t268\t291\t189\n+375\t112\t541\t20\t14\t0\n+657\t1023\t141\t206\t196\t125\n+356\t114\t550\t0\t0\t101\n+700\t1023\t196\t256\t272\t64\n+629\t1023\t189\t174\t253\t149\n+360\t141\t554\t0\t32\t52\n+362\t108\t543\t219\t158\t128\n+337\t112\t511\t107\t65\t178\n+398\t277\t67\t116\t277\t95\n+767\t1023\t157\t205\t212\t95\n+609\t1023\t348\t474\t390\t429\n+369\t96\t532\t255\t0\t212\n+386\t174\t46\t65\t619\t231\n+336\t115\t492\t87\t0\t105\n+469\t164\t580\t94\t50\t12\n+396\t108\t535\t84\t4\t82\n+452\t159\t534\t176\t169\t176\n+410\t129\t537\t107\t0\t67\n+304\t141\t31\t0\t112\t176\n+863\t1023\t242\t349\t309\t330\n+391\t226\t83\t224\t576\t232\n+701\t1023\t77\t158\t258\t111\n+674\t1023\t151\t247\t256\t238\n+309\t70\t73\t137\t287\t110\n+352\t154\t0\t23\t602\t271\n+352\t152\t130\t0\t29\t161\n+542\t1011\t70\t282\t223\t208\n+713\t1023\t160\t223\t253\t199\n+329\t156\t62\t242\t103\t106\n+341\t112\t537\t34\t102\t138\n+825\t1023\t203\t273\t294\t277\n+537\t308\t449\t0\t0\t86\n+587\t1023\t176\t297\t207\t278\n+402\t121\t513\t130\t0\t131\n+390\t155\t572\t130\t92\t176\n+787\t1023\t206\t298\t198\t167\n+409\t158\t514\t0\t127\t358\n+268\t107\t94\t18\t71\t148\n+395\t112\t66\t0\t486\t162\n+402\t117\t537\t0\t242\t79\n+396\t153\t555\t32\t96\t337\n+322\t120\t259\t134\t0\t123\n'..b'47\t220\n+354\t99\t525\t0\t142\t353\n+753\t1023\t190\t260\t336\t230\n+435\t149\t561\t67\t10\t301\n+376\t113\t545\t87\t0\t141\n+559\t783\t126\t247\t112\t238\n+393\t169\t562\t222\t118\t177\n+287\t93\t447\t95\t0\t175\n+648\t988\t186\t161\t237\t143\n+360\t96\t536\t218\t0\t116\n+308\t159\t0\t137\t55\t93\n+379\t260\t111\t176\t570\t245\n+421\t99\t508\t0\t128\t100\n+316\t69\t527\t244\t0\t52\n+346\t88\t82\t84\t196\t98\n+424\t180\t563\t119\t0\t56\n+387\t203\t60\t69\t623\t243\n+418\t117\t508\t283\t0\t149\n+653\t800\t119\t209\t182\t110\n+358\t182\t80\t44\t667\t310\n+512\t1023\t125\t168\t262\t201\n+466\t240\t133\t157\t196\t5\n+302\t139\t471\t0\t7\t19\n+361\t114\t533\t0\t0\t275\n+1023\t1023\t263\t311\t246\t309\n+334\t118\t371\t156\t0\t44\n+820\t1023\t294\t313\t318\t305\n+407\t150\t547\t133\t138\t210\n+271\t65\t486\t0\t48\t0\n+364\t121\t541\t49\t94\t229\n+654\t1023\t151\t256\t251\t230\n+366\t143\t555\t195\t0\t15\n+512\t571\t107\t220\t20\t192\n+556\t265\t448\t81\t172\t103\n+424\t228\t43\t132\t616\t310\n+753\t1023\t224\t268\t192\t116\n+360\t96\t533\t15\t109\t138\n+426\t207\t276\t99\t578\t328\n+432\t207\t142\t0\t408\t0\n+640\t580\t445\t287\t171\t207\n+658\t1023\t201\t282\t277\t300\n+666\t1023\t92\t257\t172\t234\n+354\t216\t87\t176\t336\t106\n+356\t176\t42\t0\t170\t134\n+689\t1023\t186\t217\t283\t198\n+346\t115\t516\t155\t0\t132\n+387\t128\t579\t203\t51\t141\n+665\t1023\t122\t229\t165\t78\n+400\t168\t0\t160\t600\t249\n+357\t95\t517\t0\t87\t186\n+373\t158\t534\t228\t53\t103\n+372\t103\t525\t238\t7\t175\n+298\t86\t428\t55\t0\t174\n+348\t131\t546\t6\t0\t55\n+368\t135\t549\t144\t0\t12\n+589\t1023\t333\t446\t322\t395\n+337\t117\t81\t149\t643\t348\n+372\t258\t139\t113\t174\t374\n+827\t1023\t128\t271\t263\t132\n+693\t1023\t179\t292\t201\t287\n+732\t946\t187\t253\t264\t121\n+370\t268\t125\t182\t104\t97\n+554\t761\t111\t293\t224\t233\n+411\t188\t525\t185\t124\t208\n+356\t165\t123\t85\t672\t282\n+353\t92\t508\t124\t141\t66\n+684\t902\t144\t248\t244\t173\n+402\t185\t135\t497\t774\t472\n+380\t144\t527\t156\t62\t31\n+765\t1023\t202\t261\t254\t258\n+1023\t1023\t500\t508\t445\t550\n+1023\t1023\t538\t456\t358\t450\n+652\t921\t131\t204\t107\t223\n+480\t181\t541\t223\t133\t294\n+651\t1023\t174\t340\t182\t19\n+619\t1023\t133\t263\t239\t231\n+374\t93\t520\t0\t0\t138\n+547\t760\t70\t0\t162\t224\n+427\t278\t113\t238\t385\t170\n+753\t1023\t156\t296\t263\t300\n+640\t942\t122\t265\t237\t242\n+348\t94\t507\t300\t109\t22\n+599\t1023\t135\t321\t261\t212\n+591\t948\t188\t176\t247\t130\n+386\t92\t515\t201\t32\t79\n+423\t156\t562\t8\t120\t144\n+581\t1023\t146\t214\t153\t145\n+779\t1023\t208\t308\t295\t319\n+1022\t174\t372\t274\t253\t397\n+395\t112\t554\t213\t64\t109\n+398\t283\t104\t418\t52\t211\n+459\t215\t559\t287\t198\t109\n+366\t160\t536\t218\t156\t122\n+380\t197\t123\t74\t638\t287\n+624\t1023\t133\t241\t194\t265\n+400\t163\t518\t139\t69\t225\n+380\t131\t564\t126\t0\t36\n+283\t146\t65\t180\t134\t0\n+379\t112\t173\t0\t646\t223\n+752\t1023\t129\t258\t239\t245\n+409\t206\t179\t149\t641\t290\n+635\t525\t409\t225\t206\t227\n+680\t1023\t234\t196\t249\t165\n+702\t458\t425\t271\t150\t46\n+734\t511\t416\t176\t152\t200\n+409\t171\t20\t29\t574\t212\n+413\t251\t83\t12\t21\t64\n+737\t1023\t180\t287\t284\t283\n+431\t175\t361\t239\t132\t0\n+353\t114\t50\t0\t621\t271\n+408\t141\t559\t0\t132\t196\n+531\t798\t102\t253\t209\t75\n+619\t1023\t205\t294\t235\t212\n+667\t1023\t187\t234\t288\t219\n+392\t247\t261\t675\t198\t451\n+311\t102\t514\t99\t110\t146\n+460\t125\t559\t0\t0\t73\n+400\t99\t564\t212\t139\t96\n+633\t1023\t168\t232\t214\t195\n+404\t166\t556\t177\t58\t46\n+678\t1023\t210\t305\t274\t229\n+364\t174\t98\t36\t615\t267\n+372\t118\t543\t109\t3\t52\n+672\t1023\t188\t292\t133\t249\n+643\t1023\t216\t273\t296\t169\n+445\t134\t552\t0\t143\t94\n+400\t151\t556\t179\t191\t181\n+701\t1023\t226\t239\t247\t291\n+365\t157\t122\t0\t667\t233\n+385\t88\t542\t89\t180\t60\n+358\t87\t482\t10\t0\t55\n+710\t487\t449\t284\t139\t96\n+371\t134\t510\t19\t14\t351\n+264\t69\t463\t0\t0\t80\n+428\t103\t512\t263\t0\t70\n+614\t490\t462\t229\t120\t325\n+466\t219\t513\t117\t0\t174\n+674\t525\t400\t208\t194\t194\n+324\t110\t506\t66\t32\t128\n+394\t115\t28\t0\t557\t193\n+411\t175\t63\t139\t618\t323\n+611\t303\t345\t92\t88\t100\n+450\t239\t160\t99\t195\t210\n+356\t129\t33\t90\t602\t94\n+605\t1006\t213\t204\t220\t220\n+773\t1023\t237\t275\t210\t167\n+429\t142\t570\t272\t0\t141\n+263\t33\t417\t0\t0\t194\n+347\t148\t26\t0\t630\t300\n+364\t121\t528\t182\t70\t194\n+339\t87\t483\t0\t43\t74\n+692\t1009\t147\t285\t115\t156\n+596\t988\t133\t305\t113\t273\n+847\t1023\t244\t216\t316\t101\n+386\t135\t531\t166\t184\t117\n+621\t970\t37\t127\t238\t274\n+298\t99\t482\t88\t0\t130\n+658\t1023\t117\t165\t208\t188\n+326\t172\t76\t12\t149\t77\n+360\t84\t532\t57\t138\t102\n+886\t1023\t229\t361\t290\t234\n+634\t972\t248\t277\t271\t215\n+332\t164\t0\t73\t246\t210\n+447\t121\t548\t0\t0\t393\n+391\t119\t74\t0\t628\t238\n+340\t100\t528\t245\t0\t8\n+385\t99\t179\t115\t513\t163\n+400\t157\t126\t99\t638\t313\n+431\t97\t527\t156\t122\t197\n'
b
diff -r 000000000000 -r d61ed37c06ee flowtext_summary/test-data/output.tabular
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/flowtext_summary/test-data/output.tabular Mon Feb 27 12:59:41 2017 -0500
b
@@ -0,0 +1,11 @@
+ Forward Scatter Side Scatter FITC CD4 PE CCR3 PP CD8 APC CCR4
+mean 475.4 413.4 288.8 157.9 218.1 179.6
+std 165.2 390.7 199.9 117.3 201.7 95.7
+min 261.0 18.0 0.0 0.0 0.0 0.0
+25% 354.0 121.0 112.0 65.0 58.0 109.0
+50% 398.0 167.0 209.0 159.0 180.0 179.0
+75% 609.0 951.2 512.0 237.0 275.0 245.0
+max 1023.0 1023.0 775.0 1023.0 1023.0 841.0
+
+
+20000 events