-
Notifications
You must be signed in to change notification settings - Fork 23
bin_vals
Martin Asser Hansen edited this page Oct 2, 2015
·
6 revisions
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
... | bin_vals [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.
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
---
Martin Asser Hansen - Copyright (C) - All rights reserved.
September 2010
GNU General Public License version 2
http://www.gnu.org/copyleft/gpl.html
bin_vals is part of the Biopieces framework.