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

Biopiece: merge_vals

Description

merge_vals merges the values of a list of keys using a delimiter and saves the new value as value of the first key.

Usage

... | merge_vals [options]

Options

[-?          | --help]               #  Print full usage description.
[-k <list>   | --keys=<list>]        #  List of values to merge.
[-d <string> | --delimit=<string>]   #  Merge delimiter              -  Default='_'
[-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 record:

STRAND: +
Q_ID: test
CHR_END: 24515
SCORE: 78
CHR_BEG: 24477
BED_LEN: 39
REC_TYPE: BED
CHR: chr4
BED_COLS: 6
---

To merge the values so that the Q_ID is joined with CHR, CHR_BEG and CHR_END, do:

... | merge_vals -k Q_ID,CHR,CHR_BEG,CHR_END

STRAND: +
CHR_END: 24515
Q_ID: test_chr4_24477_24515
CHR_BEG: 24477
SCORE: 78
REC_TYPE: BED
BED_LEN: 39
BED_COLS: 6
CHR: chr4
---

See also

rename_keys

remove_keys

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

merge_vals is part of the Biopieces framework.

http://www.biopieces.org

Clone this wiki locally