[Bioperl-l] sh: 1: Syntax error: "(" unexpected

Liam Elbourne liamelbourne at me.com
Sat Mar 9 04:18:34 EST 2013


Hi Antony,

How are you trying to run this? Are you by any change trying to run it as a shell script? I get no syntax or runtime errors when I run it from the command line, ie saved as a file called say "run_emboss.pl", then typing "./run_emboss.pl" at the prompt.

Regards,
Liam.



On 09/03/2013, at 2:56 PM, Antony03 <antony.vincent.1 at ulaval.ca> wrote:

> 
> Hi!
> 
> I'm trying to use emboss program (water or needle) with a bioperl script. I
> got this error when I try the script: sh: 1: Syntax error: "(" unexpected
> 
> Here is the script:
> 
> #!/usr/bin/perl 
> 
> # get an EMBOSS factory
>  use Bio::Factory::EMBOSS;
>  use Bio::AlignIO;
>  use Bio::SeqIO;
>  $f = Bio::Factory::EMBOSS -> new();
>  # get an EMBOSS application  object from the factory
>  $water = $f->program('water');
>    $inputfilename = "krt1.fasta";
>    $seq_to_test  = Bio::SeqIO->new(-file => $inputfilename ,
>                             '-format' => 'fasta');
> 
>    $inputfilename2 = "krt2.fasta";
>    @seqs_to_check  = Bio::SeqIO->new(-file => $inputfilename2 ,
>                             '-format' => 'fasta');
>  # here is an example of running the application -
>  # water can compare 1 sequence against 1 or more sequences
>  # in a database using Smith-Waterman
>  #this would be a list of seqs to compare 
>                       # (could be just 1)
>  my $wateroutfile = 'out.water';
>  $water->run({-sequences => $seq_to_test,
>               -seqall    => \@seqs_to_check,
>               -gapopen   => '10.0',
>               -gapextend => '0.5',
>               -outfile   => $wateroutfile});
>  # now you might want to get the alignment
> 
>  my $alnin = Bio::AlignIO->new(-format => 'emboss',
>                                       -file   => $wateroutfile);
> 
>  while ( my $aln = $alnin->next_aln ) {
>      # process the alignment -- these will be Bio::SimpleAlign objects
>  }
> 
> Have you an idea of what can do this error?
> 
> Thanks!
> -- 
> View this message in context: http://old.nabble.com/sh%3A-1%3A-Syntax-error%3A-%22%28%22-unexpected-tp35154292p35154292.html
> Sent from the Perl - Bioperl-L mailing list archive at Nabble.com.
> 
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioperl-l




More information about the Bioperl-l mailing list