MassSpec::ViewSpectrum - Perl extension for viewing a mass spectrum.


MassSpec-ViewSpectrum documentation  | view source Contained in the MassSpec-ViewSpectrum distribution.

Index


NAME

Top

MassSpec::ViewSpectrum - Perl extension for viewing a mass spectrum.

SYNOPSIS

Top

  use MassSpec::ViewSpectrum;

  open PNG, ">mygraphic.png" or die "Unable to open output file\n";
  binmode PNG;

  my @masses = (1036.4,1133,1437,1480,1502);
  my @intensities = (0.1,0.15,0.05,0.10,0.2);
  my @annotations = ('b','w','internal w', '','internal y');

  my $vs = MassSpec::ViewSpectrum->new(\@masses,\@intensities, \@annotations);
  $vs->set(yaxismultiplier => 1.8); # a sample tweak to adjust the output
  my $output = $vs->plot();

  print PNG $output;
  close PNG;

DESCRIPTION

Top

MassSpec::ViewSpectrum - Perl extension for viewing a mass spectrum, e.g. typically obtained from the fragmentation of proteins or peptides.

At present this is only implemented using GD graphics, but in principle this could be subclassed in the future to include alternative graphic paradigms such as SVG and Tk.

The current implementation uses a mixture of GD::Graph and native GD, since GD::Graph 1.43 fails to draw the required vertical lines correctly.

Negative peak intensity values are permitted; this permits the drawing of "pseudospectra" which, for example, illustrate peaks present in one spectrum but missing in another.

OPTIONS

width, height

The width and height of the canvas in pixels. Default: 500 x 500

linewidth

Width of vertical spectra in pixels. Default: 2

ylabeldelta

Offset of annotations on y axis measured in pixels. This is used to permit some whitespace separation between annotations and peaks. Default: 4

xticknumber

Number of tick marks on X axis. Default: 5

xlabeldelta

Number of pixels for offset of annotations on x axis. Default: 6

yaxismultiplier

A ratio, used to permit vertical room for peak annotations. Default: 2.0

extranegativeheight

For pseudospectra which contain some peaks with negative intensities, this is a fudge factor used to make room for annotations on those peaks underneath those peaks. This value has the same units as the original spectrum. Default: 0.1

outputformat

One of 'png', 'jpg' or 'gif'. Your local GD installation might only support a subset of these. Default: 'png'

x_label

The label which appears on the X axis. Default: 'm/z'

y_label

The label which appears on the Y axis. Default: 'Intensity'

title

The title of the graph. Default: ''

peakfontsize

Font size of peak labels; one of 'tiny','small','medium','large'. Default: 'medium'

SEE ALSO

Top

AUTHOR

Top

Jonathan Epstein, <Jonathan_Epstein@nih.gov>

COPYRIGHT AND LICENSE

Top


MassSpec-ViewSpectrum documentation  | view source Contained in the MassSpec-ViewSpectrum distribution.