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

Biopiece: length_vals

Description

length_vals appends the length of the value for specified keys for each record. For each specified key, key of the type <key>_LEN with the value length is added to the record.

Usage

... | length_vals [options]

Options

[-?         | --help]               #  Print full usage description.
[-k <list>  | --keys=<list>]        #  Comma separated list of keys.
[-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
Dog     45
Mouse   6

To find the length of all values in both columns, read in the table with read_tab and then pipe to length_vals:

read_tab -i test.tab | length_vals -k V0,V1   

V1_LEN: 3
V0_LEN: 5
V0: Human
V1: 123
---
V1_LEN: 2
V0_LEN: 3
V0: Dog
V1: 45
---
V1_LEN: 1
V0_LEN: 5
V0: Mouse
V1: 6
---

See also

sum_vals

min_vals

max_vals

mean_vals

analyze_vals

Author

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

mail@maasha.dk

August 2007

License

GNU General Public License version 2

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

Help

length_vals is part of the Biopieces framework.

http://www.biopieces.org

Clone this wiki locally