-
Notifications
You must be signed in to change notification settings - Fork 23
plot_lendist
plot_lendist uses a specified key to plot a histogram where each column is the value of the key, and the height of the column indicates the number of records with this value. This is almost the same as plot_histogram generates nicer x-axis intervals. 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_lendist to work. Read more here:
... | plot_lendist [options]
[-? | --help] # Print full usage description.
[-x | --no_stream] # Do not emit records.
[-o <file> | --data_out=<file>] # Write result to file.
[-k <string> | --key=<string>] # Key to use for plotting.
[-t <string> | --terminal=<string>] # Terminal for output: dumb|post|svg|x11|aqua - Default=dumb
[-T <string> | --title=<string>] # Set plot title - Default="Length Distribution"
[-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.
[-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.
To generate a ASCII graphics length distrubution you merely need to pipe the stream through plot_lendist:
read_fasta -i test.fna | plot_lendist -xk SEQ_LEN
Length Distribution
45000 ++--------------------------------------------------------**-------++
| ** |
40000 ++ **** ++
| **** |
35000 ++ **** ++
| **** |
30000 ++ **** ++
| **** |
25000 ++ **** ++
| **** |
20000 ++ ******** ++
| ******** |
15000 ++ ********** ++
| *********** |
10000 ++ *********** ++
| *********** |
5000 ++ ************* ++
| ******************* |
0 +*************************************************************-----++
+ + + + + + + +
0 5 10 15 20 25 30 35
Obviously the ASCII graphics is crufty and the x axis is messed up, but still you
can get an idea of the length distribution. However, if you want publication
grade graphics you can change the terminal from dumb
to postscript
or SVG
(Scalable Vector Graphics):
To generate a postscript image:
read_fasta -i test.fna | plot_lendist -xk SEQ_LEN -t post -o lendist.ps
And the result will look like this:
If you choose -t svg
instead of -t post
the output will be in SVG which is
neat since it can easily be modified using e.g. Inkscape to apply labels and such.
Read more about Inkscape here:
Martin Asser Hansen - Copyright (C) - All rights reserved.
August 2007
GNU General Public License version 2
http://www.gnu.org/copyleft/gpl.html
plot_lendist is part of the Biopieces framework.