A
Amy Lee
Hello,
Here's my codes:
foreach $file (@ARGV)
{
while (<>)
{
chomp;
if (/(\d+)\s+dG = (-?[\d.]+)\s+(.*)/)
{
$total = $1;
$name = $3;
s/.*//;
}
$g += tr/C//;
$c += tr/G//;
}
$gc = $g+$c;
$GC = $gc/$total;
print "$name\t$GC\n";
}
Then I hope I can get a list of the result because I use "foreach" to
process many files I gave at the same time. However, It just output one
file and the output variable $CG is wrong. If I run this to process one
file, it could work well.
I don't know what's errors in there.
Could you tell me what's going on?
Thanks.
Amy
Here's my codes:
foreach $file (@ARGV)
{
while (<>)
{
chomp;
if (/(\d+)\s+dG = (-?[\d.]+)\s+(.*)/)
{
$total = $1;
$name = $3;
s/.*//;
}
$g += tr/C//;
$c += tr/G//;
}
$gc = $g+$c;
$GC = $gc/$total;
print "$name\t$GC\n";
}
Then I hope I can get a list of the result because I use "foreach" to
process many files I gave at the same time. However, It just output one
file and the output variable $CG is wrong. If I run this to process one
file, it could work well.
I don't know what's errors in there.
Could you tell me what's going on?
Thanks.
Amy