Skip to content

plot_nucleotide_distribution

Martin Asser Hansen edited this page Oct 2, 2015 · 7 revisions

Biopiece: plot_nucleotide_distribution

Description

plot_nucleotide_distribution creates a nucleotide distribution plot per sequence position of sequences in the stream. Plotting is done using GNUplot which allows for different types of output the default one being crufty ASCII graphics.

If plotting distributions from sequences of variable length you can use the -c swith to co-plot the relative count at each base position. This allow you to explain areas with a scewed distribution.

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

http://www.gnuplot.info/

Also, the GNUplot gem for Ruby is required - run: gem install gnuplot

Usage

... | plot_nucleotide_distribution [options]

Options

[-?          | --help]               #  Print full usage description.
[-o <file>   | --data_out=<file>]    #  Write result to file.
[-x          | --no_stream]          #  Do not emit records.
[-c          | --count]              #  Plot relative count.
[-t <string> | --terminal=<string>]  #  Terminal for output: dumb|post|svg|x11|aqua|png|pdf  -  Default=dumb
[-T <string> | --title=<string>]     #  Set plot title                                       -  Default="Nucleotide Distribution"
[-X <string> | --xlabel=<string>]    #  Set x-axis label                                     -  Default="Sequence position"
[-Y <string> | --ylabel=<string>]    #  Set y-axis label                                     -  Default="Nucleotide distribution (%)"
[-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

Here we plot the nucleotide distribution of sequences a FASTA file and save the result in a PNG image file:

read_fasta -i test.fna | plot_nucleotide_distribution -t png -o plot_nucleotide_distribution.png -x

And the result will look like this:

To co-plot the relative count at each position use the -c switch:

read_fasta -i test.fna | plot_nucleotide_distribution -c -t png -o plot_nucleotide_distribution.png -x

And the result will look like this:

http://biopieces.googlecode.com/svn/wiki/plot_nucleotide_distribution_count.png

If you choose -t svg instead of -t png 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:

http://www.inkscape.org/

See also

read_fasta

plot_distribution

plot_lines

Author

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

mail@maasha.dk

August 2012

License

GNU General Public License version 2

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

Help

plot_nucleotide_distribution is part of the Biopieces framework.

http://www.biopieces.org

Clone this wiki locally