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

Biopiece: plot_lines

Description

plot_lines is somewhat unfinished, but is intended to be able to plot a list of values to specified keys as multiple lines. Alternatively, plot a key with a list of ; separated values.

Plotting is done using GNUplot which allows for different types of output the default one being crufty ASCII graphics.

GNUplot must be installed for plot_lines to work. Read more here:

http://www.gnuplot.info/

Usage

... | plot_lines [options]

Options

[-?          | --help]               #  Print full usage description.
[-x          | --no_stream]          #  Do not emit records.
[-o <file>   | --data_out=<file>]    #  Write result to file.
[-k <list>   | --keys=<list>]        #  List of keys that holds values to plot.
[-l <string> | --list=<string>]      #  Key with a list of ; seperated values to plot.
[-t <string> | --terminal=<string>]  #  Terminal for output: dumb|post|svg|x11|aqua  -  Default=dumb
[-T <string> | --title=<string>]     #  Set plot title  -  Default="Lines".
[-X <string> | --xlabel=<string>]    #  Set x-axis label.
[-Y <string> | --ylabel=<string>]    #  Set y-axis label.
[-L          | --logscale_y]         #  Set y-axis to log scale.
[-s <sting>  | --sort=<string>]      #  Sort criteria for x-axis keys: num|alph   -  Default=alph
[-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

Considere the following table in the file test.tab:

38;37;36;36;36;35;35;35;34;33;33;19;16;17;16;18;19;15;13;13;12;13;12;12;11;11;10;9;9;8;8

Now, reading in this data using read_tab will result in the following Biopieces record:

read_tab -i test.tab                      

V0: 38;37;36;36;36;35;35;35;34;33;33;19;16;17;16;18;19;15;13;13;12;13;12;12;11;11;10;9;9;8;8
---

This data is a ; separated list and can be plottet with ASCII graphics using plot_lines with the -l switch:

read_tab -i test.tab | plot_lines -l V0 -x

                                       Lines

    40 ++------------------------------------------------------------------++
       **                                                         V0 ****** |
       | **********                                                         |
    35 ++          *********                                               ++
       |                    ***                                             |
    30 ++                     *                                            ++
       |                       *                                            |
       |                       *                                            |
    25 ++                      *                                           ++
       |                       *                                            |
       |                        *                                           |
    20 ++                       ***        **                              ++
       |                            ***  **  *                              |
       |                           *   **    *                              |
    15 ++                                     **                           ++
       |                                        **************              |
    10 ++                                                     *******      ++
       |                                                             ********
       |                                                                    |
     5 ++----------+----------+-----------+----------+-----------+---------++
       0           5          10          15         20          25         30

Similarly, a table with multiple records can be plotted as multiple lines as for an example the below data:

38;37;36;36;36;35;35;35;34;33;33;19;16;17;16
18;19;15;13;13;12;13;12;12;11;11;10;9;9;8
read_tab -i test.tab | plot_lines -l V0 -x

                                       Lines

    40 ++------------------------------------------------------------------++
       *****                                                      V0 ****** |
       |    ********************                                  V0 ###### |
    35 ++                       *******************                        ++
       |                                           ******                   |
    30 ++                                                *                 ++
       |                                                 *                  |
       |                                                  *                 |
    25 ++                                                  *               ++
       |                                                    *               |
       |                                                    *               |
    20 ++ #####                                              ****          ++
       ###     ##                                                *   *******|
       |                                                          ***       *
    15 ++        #####                                                     ++
       |              #############################                         |
    10 ++                                          ###############         ++
       |                                                          ###########
       |                                                                    |
     5 ++--------+---------+---------+--------+---------+---------+--------++
       0         2         4         6        8         10        12        14

See also

plot_histogram

plot_lendist

Author

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

[email protected]

January 2010

License

GNU General Public License version 2

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

Help

plot_lines is part of the Biopieces framework.

http://www.biopieces.org

Clone this wiki locally