[Bioperl-l] Fw: not able to use Bio::Root::IO method
Mark A. Jensen
maj at fortinbras.us
Thu Jan 14 00:38:00 EST 2010
up to list
----- Original Message -----
From: "Mark A. Jensen" <maj at fortinbras.us>
To: "Dan Kortschak" <dan.kortschak at adelaide.edu.au>
Sent: Thursday, January 14, 2010 12:36 AM
Subject: Re: [Bioperl-l] not able to use Bio::Root::IO method
> Aha-- check out the pod for Bio::Root::IO:
> "This module provides methods that will usually be needed for any sort
> of file- or stream-related input/output, e.g., keeping track of a file
> handle, transient printing and reading from the file handle, a close
> method, automatically closing the handle on garbage collection, etc.
> To use this for your own code you will either want to inherit from
> this module, or instantiate an object for every file or stream you are
> dealing with. In the first case this module will most likely not be
> the first class off which your class inherits; therefore you need to
> call _initialize_io() with the named parameters in order to set file
> handle, open file, etc automatically."
> I think you're wanting a call to $self->_initialize_io(). (There is no io()
> method explicitly defined in any of the base classes.)
> ----- Original Message -----
> From: "Dan Kortschak" <dan.kortschak at adelaide.edu.au>
> To: <bioperl-l at lists.open-bio.org>
> Sent: Wednesday, January 13, 2010 11:26 PM
> Subject: [Bioperl-l] not able to use Bio::Root::IO method
>> Hi All,
>> I'm having a stupid problem that for some reason I just can't figure
>> out. I'm putting together a B:A:IO:bowtie module to wrap around the
>> B:A:IO:sam module so bowtie output can be used as an assembly start
>> For some reason that is escaping me I can't create tempfiles!
>> What should be the relevant code in the module:
>> package Bio::Assembly::IO::bowtie;
>> use strict;
>> use warnings;
>> # Object preamble - inherits from Bio::Root::Root
>> use Bio::SeqIO;
>> use Bio::Tools::Run::Samtools;
>> use Bio::Assembly::IO;
>> use Carp;
>> use Bio::Root::Root;
>> use Bio::Root::IO;
>> use base qw( Bio::Root::Root Bio::Root::IO Bio::Assembly::IO );
>> and the line (there are a couple of others that are like to fail in the
>> same way, but I've not got that far)
>> my ($sam_tmp_h, $sam_tmp_f) = $self->io->tempfile( -dir =>
>> $self->tempdir(), -suffix => '.sam' );
>> Which dies with:
>> Can't locate object method "io" via package "Bio::Assembly::IO::bowtie"
>> at /usr/local/share/perl/5.10.0/Bio/Assembly/IO/bowtie.pm line 175.
>> Relevant environment vars:
>> DB<10> x @ISA
>> 0 'Bio::Root::Root'
>> 1 'Bio::Root::IO'
>> 2 'Bio::Assembly::IO'
>> DB<11> x $self
>> 0 Bio::Assembly::IO::bowtie=HASH(0x2d226d8)
>> '_no_head' => undef
>> '_no_sq' => undef
>> '_root_verbose' => 0
>> Can someone suggest what I'm missing?
>> Bioperl-l mailing list
>> Bioperl-l at lists.open-bio.org
More information about the Bioperl-l