[Bioperl-l] I can't access clustalw from my cgi perl program...

vdar at yorku.ca vdar at yorku.ca
Wed May 21 18:40:10 EDT 2008


Yes, I've seen in that directory, but it doesn't exist. Another wierd thing
which is being happening is that If I make this output file manually in that
directory, it is read by the following code and printed on screen


if ("out.aln.pfam"){
	open FH, "out.aln.pfam" || die "Alignment file doesn't exist</br>";
	while(<FH>){

	print $_,"</br>";
	}
	close FH;
}

only when this code is not followed by the original code. When its followed by
the original code i.e.

my  $in  = Bio::AlignIO->new(-file   => $file1 ,
				-format => 'fasta');
	my $out = Bio::AlignIO->new(-file   => ">out.aln.pfam" ,
				-format => 'pfam');



	while ( my $aln1 = $in->next_aln() ) {
		$out->write_aln($aln1);
	}



	if ("out.aln.pfam"){
	open FH, "out.aln.pfam" || die "Alignment file doesn't exist</br>";
	while(<FH>){

	print $_,"</br>";
	}
	close FH;
	}

Nothing is printed on screen, while it stays there in the directory. I have
changed the name of output file in this code but new file is not produced by
this program. Does anyone know what is going on?

thanks
nisa


Quoting Mauricio Herrera Cuadra <arareko at campus.iztacala.unam.mx>:

> You're using '>out.aln.pfam' as the full path for the output file. Most
> probably, the file is being produced but in the same location where the
> CGI script lives. Check inside the same directory where you installed
> your script.
>
>  Mauricio.
>
> vdar at yorku.ca wrote:
> > ok thanks, its not giving me any error now, but its not doing anything too,
> the
> > following code works from commandline but not from my cgi script. I have
> added
> > the path to bioperl and have tried everything else that I could find...
> >
> >         my  $in  = Bio::AlignIO->new(-file   => $inputfilename ,
> > 				-format => 'fasta');
> > 	my $out = Bio::AlignIO->new(-file   => ">out.aln.pfam" ,
> > 				-format => 'pfam');
> >
> >
> >
> > 	while ( my $aln1 = $in->next_aln() ) {
> > 		$out->write_aln($aln1);
> > 	}
> >
> >
> > output file is not produced. what should I do?
> >
> > thanks
> > nisa
> >
> >
> > Quoting Sendu Bala <bix at sendu.me.uk>:
> >
> >> vdar at yorku.ca wrote:
> >>> How can I find where bioperl is installed?
> >> You already know where it's installed. See below.
> >>
> >>
> >>> Quoting Mauricio Herrera Cuadra <arareko at campus.iztacala.unam.mx>:
> >>>
> >>>> Hi Nisa,
> >>>>
> >>>> CGI scripts are generally run by a different user than you, and which
> >>>> user (e.g. apache, nobody) will depend on the platform you're running
> >>>> the script on, thus the environment variables you currently have for
> >>>> your login shell are not being inherited to the web interface. The best
> >>>> workaround for this is to add a 'use lib' pragma at the top of your CGI
> >>>> script:
> >>>>
> >>>> use lib '/path/to/your/bioperl/installation/';
> >> [...]
> >>>> vdar at yorku.ca wrote:
> >>>>> export PERL5LIB="/opt/rocks/lib/perl5/site_perl/5.8.8"
> >
> >
>
> --
> MAURICIO HERRERA CUADRA
> arareko at campus.iztacala.unam.mx
> Laboratorio de Genética
> Unidad de Morfofisiología y Función
> Facultad de Estudios Superiores Iztacala, UNAM
>




More information about the Bioperl-l mailing list