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

Smithies, Russell Russell.Smithies at agresearch.co.nz
Sun Mar 10 20:30:36 UTC 2013


I'll get in first and say it's best to 'use strict', and 'use warnings'  ;-)

Perhaps some of the params to water have changed? It looks like it wants filenames, not objects.
I get the same errors with your code - which I think is coming from water.

If I do this it seems to work OK:
---------------------------------------
#!/usr/bin/perl

# get an EMBOSS factory
use Bio::Factory::EMBOSS;
use Bio::AlignIO;
use Bio::SeqIO;

use strict;
use warnings;

my $f = Bio::Factory::EMBOSS -> new();
# get an EMBOSS application  object from the factory
my $water = $f->program('water');
my $wateroutfile = 'out.water';
$water->run({  -verbose => 1,
               -asequence => 'krt1.fasta',
               -bsequence => 'krt2.fasta',
               -gapopen   => '10.0',
               -gapextend => '0.5',
               -outfile   => 'out.water'});
------------------------------------------------


illustrious$ cat out.water
########################################
# Program: water
# Rundate: Mon 11 Mar 2013 09:29:36
# Commandline: water
#    -gapopen 10.0
#    -gapextend 0.5
#    -outfile out.water
#    -asequence krt1.fasta
#    -verbose 1
#    -bsequence krt2.fasta
#    -auto
# Align_format: srspair
# Report_file: out.water
########################################

#=======================================
#
# Aligned_sequences: 2
# 1: K2C1_HUMAN
# 2: K22E_HUMAN
# Matrix: EBLOSUM62
# Gap_penalty: 10.0
# Extend_penalty: 0.5
#
# Length: 667
# Identity:     436/667 (65.4%)
# Similarity:   499/667 (74.8%)
# Gaps:          78/667 (11.7%)
# Score: 2023.5
#
#
#=======================================

K2C1_HUMAN         1 MSRQFSSRSGYRSGG-----GFSSGSAGIINYQRRTTSSSTRRSGGGGGR     45
                     ||.|.|.:|..|.||     |||||||.:....||:|||
K22E_HUMAN         1 MSCQISCKSRGRGGGGGGFRGFSSGSAVVSGGSRRSTSS-----------     39

K2C1_HUMAN        46 FSSC----GGGGGSFGAGGGFGSRSLVNLGGSKSISISVARGGGRGSGFG     91
                      .||    |||||.|| ||||||||||.|||:|||||||| |||.|.|..
K22E_HUMAN        40 -FSCLSRHGGGGGGFG-GGGFGSRSLVGLGGTKSISISVA-GGGGGFGAA     86

K2C1_HUMAN        92 GGYG--GGGFGGG-------GFGGGGFGGGGIGGGGFGGFGSGG--GGFG    130
                     ||:|  |||||||       ||.||||||||.|||.|||||..|  ||.|
K22E_HUMAN        87 GGFGGRGGGFGGGSSFGGGSGFSGGGFGGGGFGGGRFGGFGGPGGVGGLG    136

K2C1_HUMAN       131 G-GGFGGGGYGGGYGPVCPPGGIQEVTINQSLLQPLNVEIDPEIQKVKSR    179
                     | ||||.|||         ||||.||::||||||||||::|||||.||::
K22E_HUMAN       137 GPGGFGPGGY---------PGGIHEVSVNQSLLQPLNVKVDPEIQNVKAQ    177

K2C1_HUMAN       180 EREQIKSLNNQFASFIDKVRFLEQQNQVLQTKWELLQQVDTSTRTHNLEP    229
                     ||||||:|||:|||||||||||||||||||||||||||::..||..||||
K22E_HUMAN       178 EREQIKTLNNKFASFIDKVRFLEQQNQVLQTKWELLQQMNVGTRPINLEP    227

K2C1_HUMAN       230 YFESFINNLRRRVDQLKSDQSRLDSELKNMQDMVEDYRNKYEDEINKRTN    279
                     .|:.:|::|:|.:|.|.::::..:|||.||||:||||:.||||||||||.
K22E_HUMAN       228 IFQGYIDSLKRYLDGLTAERTSQNSELNNMQDLVEDYKKKYEDEINKRTA    277

K2C1_HUMAN       280 AENEFVTIKKDVDGAYMTKVDLQAKLDNLQQEIDFLTALYQAELSQMQTQ    329
                     |||:|||:|||||.|||.||:||:|:|.|.|||:||..||.||:||:...
K22E_HUMAN       278 AENDFVTLKKDVDNAYMIKVELQSKVDLLNQEIEFLKVLYDAEISQIHQS    327

K2C1_HUMAN       330 ISETNVILSMDNNRSLDLDSIIAEVKAQYEDIAQKSKAEAESLYQSKYEE    379
                     :::|||||||||:|:|||||||||||||||:|||:||.|||:||.|||||
K22E_HUMAN       328 VTDTNVILSMDNSRNLDLDSIIAEVKAQYEEIAQRSKEEAEALYHSKYEE    377

K2C1_HUMAN       380 LQITAGRHGDSVRNSKIEISELNRVIQRLRSEIDNVKKQISNLQQSISDA    429
                     ||:|.||||||::..||||||||||||||:.||.:||||..|:|.:|:||
K22E_HUMAN       378 LQVTVGRHGDSLKEIKIEISELNRVIQRLQGEIAHVKKQCKNVQDAIADA    427

K2C1_HUMAN       430 EQRGENALKDAKNKLNDLEDALQQAKEDLARLLRDYQELMNTKLALDLEI    479
                     |||||:|||||:|||||||:|||||||||||||||||||||.|||||:||
K22E_HUMAN       428 EQRGEHALKDARNKLNDLEEALQQAKEDLARLLRDYQELMNVKLALDVEI    477

K2C1_HUMAN       480 ATYRTLLEGEESRMSGECAPNVSVSVSTSHTTISG--------GGSRGGG    521
                     ||||.||||||.||||:.:.||:|||::|  |||.        |||.|.|
K22E_HUMAN       478 ATYRKLLEGEECRMSGDLSSNVTVSVTSS--TISSNVASKAAFGGSGGRG    525

K2C1_HUMAN       522 ---GGGYGSGGSSYGSGGGSYGSGGGGGGGRGSYGSGGSSYGSGGGSYGS    568
                        ||||.||.|||||||...||.||.||| ||.        |||| |||
K22E_HUMAN       526 SSSGGGYSSGSSSYGSGGRQSGSRGGSGGG-GSI--------SGGG-YGS    565

K2C1_HUMAN       569 GGGGGGHGSYGSGSSSGGYRGGS-GGGGGGSSGGR-GSGGGSSGGSIGGR    616
                     |||.||.  ||||   ||.:||| .|||.||.||: .|||||.|||..|.
K22E_HUMAN       566 GGGSGGR--YGSG---GGSKGGSISGGGYGSGGGKHSSGGGSRGGSSSGG    610

K2C1_HUMAN       617 GSSSGGVKSSGGSSSVK    633
                     |..|||    |||||||
K22E_HUMAN       611 GYGSGG----GGSSSVK    623


#---------------------------------------
#---------------------------------------



--Russell
-- 


-----Original Message-----
From: bioperl-l-bounces at lists.open-bio.org [mailto:bioperl-l-bounces at lists.open-bio.org] On Behalf Of Antony03
Sent: Monday, 11 March 2013 2:17 a.m.
To: Bioperl-l at lists.open-bio.org
Subject: Re: [Bioperl-l] sh: 1: Syntax error: "(" unexpected


Hi! Yes I'm sure, my script is exactly what I posted here. And I run it like
this:
anvin26 at anvin26:~/Bureau/emboss$ perl water.pl
sh: 1: Syntax error: "(" unexpected
So, I think there is no ambiguity (I run it like a perl script) and this why I don't understand why the script is run like a bash script!


Leon Timmermans-2 wrote:
> 
> On Sat, Mar 9, 2013 at 4:56 AM, Antony03 <antony.vincent.1 at ulaval.ca>
> wrote:
>> 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
> 
> The error suggests the script is interpreted by the shell instead of 
> perl. Are you sure the hashbang (#!) is the absolute first thing in 
> the file. No whitespace or BOM character in the front?
> 
> Leon
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioperl-l
> 
> 

--
View this message in context: http://old.nabble.com/sh%3A-1%3A-Syntax-error%3A-%22%28%22-unexpected-tp35154292p35155738.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

=======================================================================
Attention: The information contained in this message and/or attachments
from AgResearch Limited is intended only for the persons or entities
to which it is addressed and may contain confidential and/or privileged
material. Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by persons or
entities other than the intended recipients is prohibited by AgResearch
Limited. If you have received this message in error, please notify the
sender immediately.
=======================================================================




More information about the Bioperl-l mailing list