-
Notifications
You must be signed in to change notification settings - Fork 23
min_vals
Martin Asser Hansen edited this page Oct 2, 2015
·
6 revisions
min_vals find the minimum values for given keys outputting a
record with keys of the type <key>_MIN
with the minimum as values.
... | min_vals [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 min 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.
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 minimum value in the second column, read in the table with read_tab and then pipe to min_vals:
read_tab -i test.tab | min_vals -k V1 -x
REC_TYPE: MIN
V1_MIN: 6
---
To get the minimum value from two columns:
read_tab -i test.tab | min_vals -k V1,V2 -x
REC_TYPE: MIN
V1_MIN: 6
V2_MIN: 5
---
To get the minimum value from a ; separeted list of values use the
-l
switch:
read_tab -i test.tab | min_vals -l V3
V3: 0;1;2;3;4;5
V0: Human
V2: 78
V1: 123
V3_MIN: 0.00
---
V3: 6;7;8
V0: Dog
V2: 81
V1: 45
V3_MIN: 6.00
---
V3: 9
V0: Mouse
V2: 5
V1: 6
V3_MIN: 9.00
---
Martin Asser Hansen - Copyright (C) - All rights reserved.
August 2007
GNU General Public License version 2
http://www.gnu.org/copyleft/gpl.html
min_vals is part of the Biopieces framework.