[Bioperl-l] Primer3.pm problems.
Rob Edwards
redwards at utmem.edu
Wed Apr 21 09:59:37 EDT 2004
On Apr 19, 2004, at 9:29 AM, john herbert wrote:
> Hello Bioperlers
> I have been trying to use the BioPerl-run Primer3.pm module to run
> primer3. In doing so I think I have found 2 bugs that prevent it from
> working properly (I hope this is the right place to ask this).
This is exactly the right place to ask this question
>
> The line
> my $executable = $self->{'program_dir'}.$self->{'program'};
> I think should be
> my $executable = $self->{'program_dir'}.$self->{'program_name'};
> otherwise the primer3 executable is never found using the -path option
> in a call to the constructor
> my $primer3 =
> Bio::Tools::Run::Primer3->new(-path=>'/usr/mbin/primer3_core',-
> seq=>$seq,
> -outfile=>"temp.out");
Looking at the code it appears that I have used either program or
program_name to mean the same things at various times. I will check
through the whole thing and correct all of them. Totally my mistake!
>
> The second is beyond my ability in BioPerl. basically the line
> my ($temphandle, $tempfile)=$self->io->tempfile;
>
> The temporary file never has any data in it. If you add the line
> `cat $tempfile`; following the line
> print $temphandle join "\n", @{$self->{'primer3_input'}}, "=\n";
> The tempfile is empty but the variable @{$self->{'primer3_input'}} does
> contain data.
>
> I proved this by putting a crude temporary fix in with the lines
> $tempfile = "/tmp/primer3_temp_file.$$";
> open(FH,">$tempfile") or die;
> print FH join "\n", @{$self->{'primer3_input'}}, "=\n";
> close FH;
Part of this is also because I lack a detailed knowledge of the bioperl
IO structure as witnessed by the next lines:
# I can't figure out how to use either of these to write the results
out.
# neither work, what am I doing wrong or missing in the docs?
# $self->{output}=$self->_initialize_io(-file=>$self->{'outfile'});
# $self->{output}=$self->io;
# OK, for now, I will just do it myself, because I need this to check
the parser :)
open (OUT, ">".$self->{'_outfilename'}) || $self->throw("Can't open
".$self->{'_outfilename'}." for writing");
I'll try and figure this out while I am looking through program and
program_name, but if anyone has a suggestion about the IO approach I'd
be glad to hear it.
Rob
> Then everything works fine.
>
> I hope it is ok to point these out and please correct me if I am
> missing something.
>
> Kind regards,
>
> John.
>
>
>
>
>
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at portal.open-bio.org
> http://portal.open-bio.org/mailman/listinfo/bioperl-l
More information about the Bioperl-l
mailing list