A
Amy Lee
Hello,
I use Perl to make a script to format EST sequences, and I meet a problem
that I can't solve.
When the script has formated the sequences, I hope the results can be
saved in files, not output to screen. For example, the sequence called
soybean_60.fasta, and I hope when it has been formated, the formation
result soybean_60.fasta_format can be created.
It's my codes:
foreach $EST (@ARGV)
{
if (! -e $EST)
{
print "Error: Couldn't find the $EST sequence.\n";
print "Error: Pass ......\n";
next;
}
open EST, "$EST";
while (<EST>)
{
s/ .*//g;
s/\./ /g;
s/ .*/>/g;
s/gi\|//g;
s/\|gb\|/>/g;
s/^\n$//g;
if ($. == 1)
{
s/^>//;
}
chomp;
}
print "$EST sequence formated okay.\n";
close EST;
}
Which part should I modify? How to accomplish this function by filehandle?
Thank you very much~
Regards,
Amy Lee
I use Perl to make a script to format EST sequences, and I meet a problem
that I can't solve.
When the script has formated the sequences, I hope the results can be
saved in files, not output to screen. For example, the sequence called
soybean_60.fasta, and I hope when it has been formated, the formation
result soybean_60.fasta_format can be created.
It's my codes:
foreach $EST (@ARGV)
{
if (! -e $EST)
{
print "Error: Couldn't find the $EST sequence.\n";
print "Error: Pass ......\n";
next;
}
open EST, "$EST";
while (<EST>)
{
s/ .*//g;
s/\./ /g;
s/ .*/>/g;
s/gi\|//g;
s/\|gb\|/>/g;
s/^\n$//g;
if ($. == 1)
{
s/^>//;
}
chomp;
}
print "$EST sequence formated okay.\n";
close EST;
}
Which part should I modify? How to accomplish this function by filehandle?
Thank you very much~
Regards,
Amy Lee