# HG changeset patch # User azomics # Date 1594899326 14400 # Node ID b94872d6505083533cb6317abedb188ec34ba259 # Parent e1f0194cf8fc72cf3b982c71dd77fe118d4487c7 "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/txt_diagnosis commit 41bbf946c933eb16a0a7d0eac7928e7bf7f465ca" diff -r e1f0194cf8fc -r b94872d65050 test-data/input_error.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/input_error.txt Thu Jul 16 07:35:26 2020 -0400 @@ -0,0 +1,16 @@ +Forward Scatter Side Scatter FITC CD4 PE CD25 PP CD3 APC CD45RA +289 56 438 0 626 nan +352 153 30 147 483 386 +383 190 156 228 734 408 +261 62 432 121 598 555 +451 120 537 338 568 nba +373 104 3 110 621 584 +418 105 561 0 610 562 +358 185 0 292 641 327 +733 970 139 227 293 259 +765 1023 71 239 bkl 253 +762 957 143 158 271 255 +406 191 513 122 646 264 +695 1023 168 251 234 283 +336 178 0 146 128 we +668 1023 167 306 302 253 diff -r e1f0194cf8fc -r b94872d65050 test-data/input_noerror.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/input_noerror.txt Thu Jul 16 07:35:26 2020 -0400 @@ -0,0 +1,16 @@ +Forward Scatter Side Scatter FITC CD4 PE CD25 PP CD3 APC CD45RA +289 56 438 0 626 0 +352 153 30 147 483 386 +383 190 156 228 734 408 +261 62 432 121 598 555 +451 120 537 338 568 111 +373 104 3 110 621 584 +418 105 561 0 610 562 +358 185 0 292 641 327 +733 970 139 227 293 259 +765 1023 71 239 54 253 +762 957 143 158 271 255 +406 191 513 122 646 264 +695 1023 168 251 234 283 +336 178 0 146 128 35 +668 1023 167 306 302 253 diff -r e1f0194cf8fc -r b94872d65050 test-data/output_error.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/output_error.txt Thu Jul 16 07:35:26 2020 -0400 @@ -0,0 +1,3 @@ +WARNING: line 6 in input_error.txt contains non-numeric results +WARNING: line 11 in input_error.txt contains non-numeric results +WARNING: line 15 in input_error.txt contains non-numeric results diff -r e1f0194cf8fc -r b94872d65050 test-data/output_noerror.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/output_noerror.txt Thu Jul 16 07:35:26 2020 -0400 @@ -0,0 +1,1 @@ +No errors in the file. diff -r e1f0194cf8fc -r b94872d65050 txtDiagnosis.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/txtDiagnosis.xml Thu Jul 16 07:35:26 2020 -0400 @@ -0,0 +1,64 @@ + + in txt-converted FCS files + + pandas + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r e1f0194cf8fc -r b94872d65050 txt_diagnosis/test-data/input_error.txt --- a/txt_diagnosis/test-data/input_error.txt Mon Feb 27 13:07:11 2017 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,16 +0,0 @@ -Forward Scatter Side Scatter FITC CD4 PE CD25 PP CD3 APC CD45RA -289 56 438 0 626 nan -352 153 30 147 483 386 -383 190 156 228 734 408 -261 62 432 121 598 555 -451 120 537 338 568 nba -373 104 3 110 621 584 -418 105 561 0 610 562 -358 185 0 292 641 327 -733 970 139 227 293 259 -765 1023 71 239 bkl 253 -762 957 143 158 271 255 -406 191 513 122 646 264 -695 1023 168 251 234 283 -336 178 0 146 128 we -668 1023 167 306 302 253 diff -r e1f0194cf8fc -r b94872d65050 txt_diagnosis/test-data/input_noerror.txt --- a/txt_diagnosis/test-data/input_noerror.txt Mon Feb 27 13:07:11 2017 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,16 +0,0 @@ -Forward Scatter Side Scatter FITC CD4 PE CD25 PP CD3 APC CD45RA -289 56 438 0 626 0 -352 153 30 147 483 386 -383 190 156 228 734 408 -261 62 432 121 598 555 -451 120 537 338 568 111 -373 104 3 110 621 584 -418 105 561 0 610 562 -358 185 0 292 641 327 -733 970 139 227 293 259 -765 1023 71 239 54 253 -762 957 143 158 271 255 -406 191 513 122 646 264 -695 1023 168 251 234 283 -336 178 0 146 128 35 -668 1023 167 306 302 253 diff -r e1f0194cf8fc -r b94872d65050 txt_diagnosis/test-data/output_error.txt --- a/txt_diagnosis/test-data/output_error.txt Mon Feb 27 13:07:11 2017 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -WARNING: line 6 in input_error.txt contains non-numeric results -WARNING: line 11 in input_error.txt contains non-numeric results -WARNING: line 15 in input_error.txt contains non-numeric results diff -r e1f0194cf8fc -r b94872d65050 txt_diagnosis/test-data/output_noerror.txt --- a/txt_diagnosis/test-data/output_noerror.txt Mon Feb 27 13:07:11 2017 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -No errors in the file. diff -r e1f0194cf8fc -r b94872d65050 txt_diagnosis/txtDiagnosis.xml --- a/txt_diagnosis/txtDiagnosis.xml Mon Feb 27 13:07:11 2017 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,75 +0,0 @@ - - in txt-converted FCS files. - - pandas - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r e1f0194cf8fc -r b94872d65050 txt_diagnosis/txtdiagnosis.py --- a/txt_diagnosis/txtdiagnosis.py Mon Feb 27 13:07:11 2017 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,68 +0,0 @@ -#!/usr/bin/env python -###################################################################### -# Copyright (c) 2016 Northrop Grumman. -# All rights reserved. -###################################################################### -from __future__ import print_function -from __future__ import division -import pandas as pd -from argparse import ArgumentParser -import sys - - -def is_number(s): - try: - float(s) - return True - except ValueError: - return False - - -def error_report(input_file, fname, output_file): - errors = 0 - df = pd.read_table(input_file) - with open(output_file, "w") as outf: - for cols in df.columns.values: - if df[cols].count() != len(df[cols]): - with open(input_file, "r") as checkfile: - fl = checkfile.readline() - count_lines = 1 - for checklines in checkfile: - to_check = checklines.strip().split("\t") - count_lines += 1 - for item in to_check: - if not is_number(item): - errors += 1 - outf.write(" ".join(["WARNING: line", str(count_lines), "in", fname, "contains non-numeric results\n"])) - if errors == 0: - outf.write("No errors in the file.\n") - return - - -if __name__ == "__main__": - parser = ArgumentParser( - prog="txtDiagnosis", - description="Reports potential errors in text-converted FCS files") - - parser.add_argument( - '-i', - dest="input_file", - required=True, - help="File location for the text file.") - - parser.add_argument( - '-n', - dest="filename", - required=True, - help="Filename location for the text file.") - - parser.add_argument( - '-o', - dest="output_file", - required=True, - help="Name of the output file.") - - args = parser.parse_args() - - error_report(args.input_file, args.filename, args.output_file) - sys.exit(0) diff -r e1f0194cf8fc -r b94872d65050 txtdiagnosis.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/txtdiagnosis.py Thu Jul 16 07:35:26 2020 -0400 @@ -0,0 +1,65 @@ +#!/usr/bin/env python +###################################################################### +# Copyright (c) 2016 Northrop Grumman. +# All rights reserved. +###################################################################### +import pandas as pd +from argparse import ArgumentParser +import sys + + +def is_number(s): + try: + float(s) + return True + except ValueError: + return False + + +def error_report(input_file, fname, output_file): + errors = 0 + df = pd.read_table(input_file) + with open(output_file, "w") as outf: + for cols in df.columns.values: + if df[cols].count() != len(df[cols]): + with open(input_file, "r") as checkfile: + fl = checkfile.readline() + count_lines = 1 + for checklines in checkfile: + to_check = checklines.strip().split("\t") + count_lines += 1 + for item in to_check: + if not is_number(item): + errors += 1 + outf.write(" ".join(["WARNING: line", str(count_lines), "in", fname, "contains non-numeric results\n"])) + if errors == 0: + outf.write("No errors in the file.\n") + return + + +if __name__ == "__main__": + parser = ArgumentParser( + prog="txtDiagnosis", + description="Reports potential errors in text-converted FCS files") + + parser.add_argument( + '-i', + dest="input_file", + required=True, + help="File location for the text file.") + + parser.add_argument( + '-n', + dest="filename", + required=True, + help="Filename location for the text file.") + + parser.add_argument( + '-o', + dest="output_file", + required=True, + help="Name of the output file.") + + args = parser.parse_args() + + error_report(args.input_file, args.filename, args.output_file)