-
Notifications
You must be signed in to change notification settings - Fork 23
analyze_vals
analyze_vals analyzes all records in the stream and outputs a single record in the form:
KEY: SCORES
TYPE: Alphabetic
COUNT: 10000
MIN: 50
MAX: 50
SUM: 500000
MEAN: 50.0
---
analyze_vals in pretty print mode.
... | analyze_vals [options]
[-? | --help] # Print full usage description.
[-k <list> | --keys=<list>] # Comma separated list of keys to analyze.
[-K <list> | --no_keys=<list>] # Comma separated list of keys _not_ to analyze.
[-x | --no_stream] # Do not emit records.
[-o <file> | --data_out=<file>] # Write result to file.
[-I <file!> | --stream_in=<file!>] # Read input from stream file - Default=STDIN
[-O <file> | --stream_out=<file>] # Write output to stream file - Default=STDOUT
[-v | --verbose] # Verbose output.
Consider the following table in the file test.tab
:
Human 123
Dog 45
Mouse 6
To analyze the values of all columns, read in the table with read_tab and then pipe to analyze_vals:
read_tab -i test.tab | analyze_vals -x | write_tab -cpx
+-----+------------+-------+-----+-----+-----+------+
| KEY | TYPE | COUNT | MIN | MAX | SUM | MEAN |
+-----+------------+-------+-----+-----+-----+------+
| V0 | Alphabetic | 3 | 3 | 5 | 13 | 4.3 |
| V1 | Numeric | 3 | 6 | 123 | 174 | 58.0 |
+-----+------------+-------+-----+-----+-----+------+
To save the output of analyze_vals in a file use the -o
switch. This allows further analysis of records in
the stream if you also omit the -x
switch:
read_tab -i test.tab | analyze_vals -o analysis.txt | write_tab -cpx
+-------+-----+
| V0 | V1 |
+-------+-----+
| Human | 123 |
| Dog | 45 |
| Mouse | 6 |
+-------+-----+
And the output of analysis.txt
is a list of Biopiece records that can be read and pretty printed with write_tab:
write_tab -I analysis.txt -cpx
+-----+------------+-------+-----+-----+-----+-------+
| KEY | TYPE | COUNT | MIN | MAX | SUM | MEAN |
+-----+------------+-------+-----+-----+-----+-------+
| V0 | Alphabetic | 3 | 3 | 5 | 13 | 4.33 |
| V1 | Numeric | 3 | 6 | 123 | 174 | 58.00 |
+-----+------------+-------+-----+-----+-----+-------+
To only analyze the values of the first column, use the ´-k´ switch:
read_tab -i test.tab | analyze_vals -k V0 -x | write_tab -cpx
+-----+------------+-------+-----+-----+-----+------+
| KEY | TYPE | COUNT | MIN | MAX | SUM | MEAN |
+-----+------------+-------+-----+-----+-----+------+
| V0 | Alphabetic | 3 | 3 | 5 | 13 | 4.3 |
+-----+------------+-------+-----+-----+-----+------+
To analyze the values of all columns, execpt the first, use the ´-K´ switch:
read_tab -i test.tab | analyze_vals -K V0 -x | write_tab -cpx
+-----+---------+-------+-----+-----+-----+------+
| KEY | TYPE | COUNT | MIN | MAX | SUM | MEAN |
+-----+---------+-------+-----+-----+-----+------+
| V1 | Numeric | 3 | 6 | 123 | 174 | 58.0 |
+-----+---------+-------+-----+-----+-----+------+
Martin Asser Hansen - Copyright (C) - All rights reserved.
August 2007
GNU General Public License version 2
http://www.gnu.org/copyleft/gpl.html
analyze_vals is part of the Biopieces framework.