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

Biopiece: bin_vals

Description

bin_vals bins values to a specified key from records in the stream into bins of a specified bin size. A record key suffixed with _BIN and the binned value is added to each record.

The bins are calculated like this:

bin = ( value / bin_size ).to_integer * bin_size

Usage

... | bin_vals [options]

Options

[-?          | --help]               #  Print full usage description.
[-k <string> | --key=<string>]       #  Key who's values to bin.
[-b <uint>   | --bin_size=<uint>]    #  Bin size                     -  Default=10
[-I <file!>  | --stream_in=<file!>]  #  Read input stream from file  -  Default=STDIN
[-O <file>   | --stream_out=<file>]  #  Write output stream to file  -  Default=STDOUT
[-v          | --verbose]            #  Verbose output.

Examples

Consider the following values in the file test.tab:

1
2
3
4
5
6
7
8
9
10

We can read in these values using read_tab like this:

V0: 1
V0_BIN: 0
---
V0: 2
V0_BIN: 0
---
V0: 3
V0_BIN: 0
---
V0: 4
V0_BIN: 0
---
V0: 5
V0_BIN: 5
---
V0: 6
V0_BIN: 5
---
V0: 7
V0_BIN: 5
---
V0: 8
V0_BIN: 5
---
V0: 9
V0_BIN: 5
---
V0: 10
V0_BIN: 10
---

See also

read_tab

Author

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

[email protected]

September 2010

License

GNU General Public License version 2

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

Help

bin_vals is part of the Biopieces framework.

http://www.biopieces.org

Clone this wiki locally