Skip to content
Martin Asser Hansen edited this page Oct 2, 2015 · 6 revisions

Biopiece: max_vals

Description

max_vals find the maximum values for given keys outputting a record with keys of the type <key>_MAX with the maximum as values.

Usage

... | max_vals [options]

Options

[-?          | --help]               #  Print full usage description.
[-x          | --no_stream]          #  Do not emit records.
[-o <file>   | --data_out=<file>]    #  Write result to file.
[-k <list>   | --keys=<list>]        #  Comma separated list of keys.
[-l <string> | --list=<string>]      #  Key with ; separated values to calculate max from.
[-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.

Examples

Consider the following table in the file test.tab:

Human   123     78      0;1;2;3;4;5
Dog     45      81      6;7;8
Mouse   6       5       9

To find the maximum value in the second column, read in the table with read_tab and then pipe to max_vals:

read_tab -i test.tab | max_vals -k V1 -x

V1_MAX: 123
REC_TYPE: MIN
---

And to get a second column:

read_tab -i test.tab | max_vals -k V1,V2 -x

V2_MAX: 81
V1_MAX: 123
REC_TYPE: MIN
---

Use the -l switch to get the max from a ; separeted list of values:

read_tab -i test.tab | max_vals -l V3      

V3_MAX: 5.00
V3: 0;1;2;3;4;5
V0: Human
V2: 78
V1: 123
---
V3_MAX: 8.00
V3: 6;7;8
V0: Dog
V2: 81
V1: 45
---
V3_MAX: 9.00
V3: 9
V0: Mouse
V2: 5
V1: 6
---

See also

sum_vals

min_vals

mean_vals

median_vals

analyze_vals

Author

Martin Asser Hansen - Copyright (C) - All rights reserved.

[email protected]

August 2007

License

GNU General Public License version 2

http://www.gnu.org/copyleft/gpl.html

Help

max_vals is part of the Biopieces framework.

http://www.biopieces.org

Clone this wiki locally