[Bioperl-l] Filehandle interface in Bio::AlignIO: broken in 1.4?
Jason Stajich
jason at cgt.duhs.duke.edu
Sat Jan 31 10:07:56 EST 2004
Dave -
This is due to a change lincoln made to not default to the magic <>
operator when no filename is provided. It broke a lot of my scripts too.
[This is basically part of similar question that Peter was asking wrt
SeqIO]
I would like to see it come back somehow but I am not sure how as it
causes certain things to block during the tests.
it has nothing to do with the newFh method but with Bio::Root::IO in the
_readline method.
< my $fh = $self->_fh || \*ARGV;
---
> my $fh = $self->_fh or return;
If you want the old functionality just change that line back in your code
for the time being.
--jason
On Sat, 31 Jan 2004, Dave NO SPAM Ardell wrote:
> Hi,
>
> I searched for this in docs and the mailing list but didn't find
> anything. Also
> looked quickly in bugzilla and the Changelist with no result.
> So sorry if I am rehashing something known.
>
> Was surprised after installing 1.4 that filehandle functionality
> documented
> as part of the interface in AlignIO seems broken. That is to say,
>
> 1: $stream = Bio::AlignIO->newFh('-format' => "$opt_i"); # read from
> standard input
> 2: while ( my $aln = <$stream> ) {
>
> doesn't work anymore. It doesn't die, but the diamond operator returns
> null regardless of input. During debugging,
>
> gdb> x $stream
>
> after line 1 above, executing with sequence input on STDIN
> gives:
>
> ------ BEGIN DEBUGGER OUTPUT
> 0 GLOB(0xbbd178)
> -> *Symbol::GEN0
> Can't locate object method "FILENO" via package "Bio::AlignIO::fasta"
> at /System/Library/Perl/5.8.1/dumpvar.pl line 238.
> dumpvar::unwrap('GLOB(0xbbd178)',3,-2) called at
> /System/Library/Perl/5.8.1/dumpvar.pl line 118
> dumpvar::DumpElem('GLOB(0xbbd178)',3,-2) called at
> /System/Library/Perl/5.8.1/dumpvar.pl line 223
> dumpvar::unwrap('ARRAY(0xbbd0e8)',0,-1) called at
> /System/Library/Perl/5.8.1/dumpvar.pl line 33
> main::dumpValue('ARRAY(0xbbd0e8)',-1) called at
> /System/Library/Perl/5.8.1/perl5db.pl line 5270
> DB::dumpit('GLOB(0x143988)','ARRAY(0xbbd0e8)') called at
> /System/Library/Perl/5.8.1/perl5db.pl line 647
> DB::eval called at /System/Library/Perl/5.8.1/perl5db.pl line
> 3314
> DB::DB called at /Users/dave/Data/mybin/pi line 44
>
> ----- END DEBUGGER OUTPUT -----
>
> I see from recent scripts, for instance, bp_sreformat.pl, and from
> documentation
> that stdin/stdout functionality can be had through AlignIO::new
>
> But for my quickfix, I reinstalled bioperl 1.2.3
>
> Maybe the change is intentional.
> Although I guess I would miss the filehandle interface,
> I could get over it =)
> Maybe the change should be documented though.
>
> Apologies if it is and I missed it.
>
> Dave
>
>
> --+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--
> +--
> David Ardell, Asst. Professor. tel : 46 (0) 18 471 6694
> Linnaeus Centre for Bioinformatics fax : 46 (0) 18 471 6698
> Uppsala University Biomedical Center http://www.lcb.uu.se/~dave
> Husargatan 3, Box 598,
> SE 751 24 Uppsala SWEDEN.
>
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at portal.open-bio.org
> http://portal.open-bio.org/mailman/listinfo/bioperl-l
>
--
Jason Stajich
Duke University
jason at cgt.mc.duke.edu
More information about the Bioperl-l
mailing list