NAME

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

SYNOPSIS

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

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.

SEE ALSO

AUTHOR

Jonathan Epstein, <Jonathan_Epstein@nih.gov>

COPYRIGHT AND LICENSE

                   PUBLIC DOMAIN NOTICE

National Institute for Child Health and Human Development

This software/database is a "United States Government Work" under the terms of the United States Copyright Act. It was written as part of the author's official duties as a United States Government employee and thus cannot be copyrighted. This software/database is freely available to the public for use. The National Institutes of Health and the U.S. Government have not placed any restriction on its use or reproduction. * Although all reasonable efforts have been taken to ensure the accuracy and reliability of the software and data, the NIH and the U.S. Government do not and cannot warrant the performance or results that may be obtained by using this software or data. The NIH and the U.S. Government disclaim all warranties, express or implied, including warranties of performance, merchantability or fitness for any particular purpose.

Please cite the author in any work or product based on this material.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.5 or, at your option, any later version of Perl 5 you may have available.