How do i resolve this error message Please! I need help

A

Adebiyi Marion

the error message is;
Can't modify concatenation (.) or string in scalar assignment at theScript.pl line 67, near ");"

theScript is as below;

use strict;

my $file = shift @ARGV;
open(FILE, "$file") or die "Cannot open file: $!";

while(<FILE>)
{
chomp;
my $gene = $_;
system("wget -O " . $gene . ".fasta
\"http://www.uniprot.org/uniprot/?query=gene:" . $gene .
"&format=fasta\"");

open(FASTA, $gene . ".fasta") or die "Cannot open FASTA file
$gene: $!";
my $sequence;

while(<FASTA>)
{
chomp;
$sequence .= $_ unless /^>/;
}
close FASTA;

system("wget -O " . $gene . ".out
\"http://web.expasy.org/cgi-bin/blast/blast.pl?sequence=\"" . $sequence
.. "\"&action=PlainText&protdb_section=HUMAN&showsc=3&showal=0\"");

open(BLAST, $gene . ".out") or die "Cannot open BLAST file
$gene: $!";
my $idMapping;

while(<BLAST>)
{
if (/^(sp|tr)\!([A-Z\d]+)/)
{
$idMapping .= $2 . " ";
}
}
close BLAST;

if ($idMapping)
{
open(OUT, ">$gene.up2ensembl") or die "Cannot open OUT
for writing: $!";
print OUT &getIdMappingResult($idMapping);
}
}
close FILE;

sub getIdMappingResult
{
my ($list) = (@_);

my $base = 'http://www.uniprot.org';
my $tool = 'mapping';

my $params = {
from => 'ACC',
to => 'ENSEMBL_ID',
format => 'tab',
query => $list
};

my $contact = '(e-mail address removed)'; # Please set your email address here to help
us debug in case of problems.
my $agent = LWP::UserAgent->new(agent => "libwww-perl $contact");
push @{$agent->requests_redirectable}, 'POST';

my $response = $agent->post("$base/$tool/", $params);

while (my $wait = $response->header('Retry-After')) {
print STDERR "Waiting ($wait) ; Query: $base/$tool/ ;
Parameters: ...\n";
sleep $wait;
$response = $agent->get($response->base);
}

$response->is_success ?
return $response->content :
die 'Failed, got ' . $response->status_line . ' for ' .
$response->request->uri . "\n";
}


My list can be attached asap if need be.

Marion
 
R

Rainer Weikusat

Adebiyi Marion said:
the error message is;
Can't modify concatenation (.) or string in scalar assignment at theScript.pl line 67, near ");"

theScript is as below;

Consider using a less bizarre way of distributing 'long sequences of
somethings' over several lines of file ...

[...]
my $contact = '(e-mail address removed)'; # Please set your email address here to help
us debug in case of problems.

.... the problem that you split this comment incorrectly, causing the perl
compiler to try to compile

us debug in case of problems.

which - in turn - caused the initially quoted error message to be
printed hadn't occured then ...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top