comparison FCSstats_txt.py @ 1:715c9696dcf5 draft default tip

"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flowtext_summary commit 0c146c1d2b137b710b743afa63fcda21beb92ff7"
author azomics
date Tue, 04 Aug 2020 07:51:15 -0400
parents
children
comparison
equal deleted inserted replaced
0:d61ed37c06ee 1:715c9696dcf5
1 #!/usr/bin/env python
2
3 ######################################################################
4 # Copyright (c) 2016 Northrop Grumman.
5 # All rights reserved.
6 ######################################################################
7
8 from __future__ import print_function
9 import pandas as pd
10 from argparse import ArgumentParser
11
12
13 def get_txt_stats(in_file, out_file):
14 df = pd.read_table(in_file)
15 summary = df.describe().round(1)
16 df1 = summary[1:]
17 x = summary[:1].values.tolist()
18 df1.to_csv(out_file, sep="\t")
19 with open(out_file, "a") as ot:
20 ot.write("\n\n" + str(int(x[0][0])) + " events\n")
21 return
22
23
24 if __name__ == "__main__":
25 parser = ArgumentParser(
26 prog="getTxtStats",
27 description="Prints summary statistics from given file.")
28
29 parser.add_argument(
30 '-i',
31 dest="input_file",
32 required=True,
33 help="File location for the text file.")
34
35 parser.add_argument(
36 '-o',
37 dest="output_file",
38 required=True,
39 help="Name of the output file.")
40
41 args = parser.parse_args()
42
43 get_txt_stats(args.input_file, args.output_file)