Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Bioperl Graphics question

by wackattack (Acolyte)
on Jul 06, 2005 at 04:12 UTC ( #472679=perlquestion: print w/ replies, xml ) Need Help??
wackattack has asked for the wisdom of the Perl Monks concerning the following question:

I followed the tutorial here:

tutorial code

And ran this exact code:

my code

The image produced is shown here: my image


The image produced by this code does not have the names as shown here: correct image from tutorial that has the labels
Any clue as to what I'm doing wrong? Or am I doing anything wrong? My data file is located here

2nd question: Any clue as to how I can find the package where this is installed to look at it's source code?

Thanks for the help monks!

Comment on Bioperl Graphics question
Re: Bioperl Graphics question
by monarch (Priest) on Jul 06, 2005 at 04:28 UTC
    It would appear, for whatever reason, the -label argument isn't being interpreted as being true.

    Yet you seem to set it just as the tutorial example showed.

    I could not find the Bio::Graphics module in CPAN, so I couldn't look up the documentation (occasionally tutorial code examples are wrong and it helps to track down the documentation directly).

    You may be able to find the module in something like:

    /usr/lib/perl5/site_perl
    and running
    find . |grep Bio |grep Graphics

    Alternatively if you're on windows, open explorer, go to your Perl installation directory (C:\Perl\?) and then from the explorer window right-click on the directory name, select search, and type in Graphics.pm.

      Bio:::Graphics is a namespace for a set of modules used for drawing images common to Bioinformatics. On my machine it's located in the directory /usr/local/lib/perl5/site_perl/5.8.6/Bio/Graphics.

      You could poke around there (or somewhere similar) if you'd like a peek at the source code. Probably the most reasonable thing to do would be to e-mail the Bioperl mailing list (there's a link off the website) and tell them your problem. Also, you might try some of the later examples in the tutorial and see if those work for you.

      I ran the example using both sets of code and got the image with labels on it, so I don't know what the problem would be. What OS and Bioperl version are you using? Bioperl makes heavy use of the GD Perl package, what version of GD are you using?

Re: Bioperl Graphics question
by virtualsue (Vicar) on Jul 06, 2005 at 05:02 UTC
    2nd question: Any clue as to how I can find the package where this is installed to look at it's source code?

    You have a "use lib" directive in your code. Perhaps the Bio modules are somewhere under /home/lstein/projects/bioperl-live .

      That's actually from Lincoln Stein's code, he's the author of the tutorial and also the author of the CGI.pm module.
        No doubt, it's just that the line appeared in wackattack's code, not the code he said he used as a reference for using the Bio modules. I do know who Lincoln Stein is, but I wondered if in following some other example a little too closely, the Bio modules had been installed in an unconventional place on wackattack's system. That sort of thing occasionally happens.

        For the original poster, the special global array @INC contains the paths which perl uses to find scripts and libraries for "do filename;", use and require commands. This is just general information, and isn't nearly as useful as perldoc -l (per chromatic). :)

        perl -e 'print "$_\n" for @INC'

Re: Bioperl Graphics question
by jbrugger (Parson) on Jul 06, 2005 at 05:05 UTC
    Have you installed all needed modules?
    i just installed bioperl ( apt-get install bioperl ), copied exactly your code, created the 'data1.txt' file exactly as given in the tutorial (copy paste), ran perl test.pl data1.txt > test.png, and got the proper output, like the example png, including the text.
    There seems nothing wrong with your script, it has to be the installation.
    ps. i commented out the 'use lib' line.

    "We all agree on the necessity of compromise. We just can't agree on when it's necessary to compromise." - Larry Wall.
Re: Bioperl Graphics question
by chromatic (Archbishop) on Jul 06, 2005 at 05:10 UTC

    Assuming you have the modules installed correctly so that perldoc can find them, use perldoc -l to show the installed location and perldoc -m to view the module's code in your pager program.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://472679]
Approved by GrandFather
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (6)
As of 2014-08-30 16:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (293 votes), past polls