[Bioperl-l] SeqIO unwilling to work

Michal Kurowski michal@orfeus.bioinfo.pl
Mon, 11 Feb 2002 17:04:27 +0100


Hi,
After spending some time with SeqIO interface I've got to say there
are a few things a bit mysterious to me.

Let's say I've got something like this:



$file1 = param("file1");
$file2 = param("file2");
$area1 = param("text1");
$area2 = param("text2");

$stream1 = "";
$stream2 = "";

if ($file1) {
    while (<$file1>) {
        $stream1 .= $_;
    }
} else {
    $stream1 = $area1;
}

if ($file2) {
    while (<$file2>) {
        $stream2 .= $_;
    }
} else {
    $stream2 = $area2;
}

$stream1 =~ s/\r//g;
$stream2 =~ s/\r//g;


tie *IN1, 'IO::Scalar', \$stream1;
tie *IN2, 'IO::Scalar', \$stream2;

my $first = Bio::SeqIO->new(-fh => \*IN1);
my $second = Bio::SeqIO->new(-fh => \*IN2);

...dealing with $first and $second ...


It doesn't work.
The point is "-fh" method (with a tied Symbol::gensym) does not work
for me giving lots of mysterious errors (see below). It does not
matter if I use object interface or "tied" objects.

Operation `ne': no method found,
left argument in overloaded package IO::Scalar,
right argument has no overloaded magic at
/usr/lib/perl5/site_perl/5.6.0/Bio/Root/IO.pm line 242.

And when I try to investigate thing using "Data::Dumper":

Use of uninitialized value in -d at /usr/lib/perl5/5.6.0/CGI.pm line
3355.
fasta.pl: Use of uninitialized value in
join at (eval 13) line 44.
fasta.pl: Use of uninitialized value in
join at (eval 13) line 44.
fasta.pl: Can't locate object method
"FETCH" via package "IO::Scalar" at
/usr/lib/perl5/5.6.0/i386-linux/Data/Dumper.pm line 150,
<fh00001duzy.fa> line 12.

I thought "FETCH" is not necessary when using tied handles...

(Bio)Perl wizards needed,

-- 
Michal Kurowski
<michal@orfeus.bioinfo.pl>