=Biopiece: write_tab= ==Synopsis== Write tabular output from stream. ==Description== Outputting the data stream as a table can be done with [write_tab] which will write generate one row per record with the values as columns. ==Usage== {{{ ... | write_tab [options] }}} ==Options== {{{ [-x | --no_stream] - Do not emit records. [-o | --data_out=] - Write result to file. [-c | --comment] - Print comment line - Default=no [-d | --delimit=] - Changes delimiter - Default='\t' [-k | --keys=] - Comma separated list of keys to print in that order. [-K | --no_keys=] - Comma separated list of keys to ignore. [-I | --stream_in=] - Read input from stream file - Default=STDIN [-O | --stream_out=] - Write output to stream file - Default=STDOUT [-Z | --compress] - Compress output using gzip. }}} ==Examples== To write all records from the stream as a table, do: {{{ ... | write_tab }}} If you supply the optional `-c` switch, when the first row in the table will be a 'comment' line prefixed with a '#': {{{ ... | write_tab -c }}} You can also change the delimiter from the default (tab) to e.g. ',': {{{ ... | write_tab -d ',' }}} If you want the values output in a specific order you have to supply a comma separated list using the `-k` switch that will print only those keys in that order: {{{ ... | write_tab -k SEQ_NAME,COUNT }}} Keys from e.g. [read_tab] V0, V1, V2 ... Vn, is automagically sorted numerically. Alternatively, if you have some keys that you don't want in the tabular output, use the `-K` switch. So to print all keys except SEQ and SEQ_TYPE do: {{{ ... | write_tab -K SEQ,SEQ_TYPE }}} Finally, if you have a stream containing a mix of different records types, e.g. records with sequences and records with matches, then you can use [write_tab] to output all the records in tabluar format, however, the `-c`, `-k`, and `-K` switches will only respond to records of the first type encountered. The reason is that outputting mixed records is probably not what you want anyway, and you should remove all the unwanted records from the stream before outputting the table: [grab] is your friend. ==See also== [read_tab] [grab] ==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== [write_tab] is part of the Biopieces framework. http://code.google.com/p/biopieces/