Hi,
I am looking for a solution to read a file with records that do not have end of each
record delimiter. Here is an example,
File:
>1a1.f1b bases 100 to 234 (SL to QR)
TAAATAGAGAGGTTCGACTCTGCATTTCCCAAATACGTAATGCTTACGGTACACGACCCA
AGCTCTCTGCTTGAATCCCAAATCTGAGCGGACAGATGAGGGGGCGCAGAGGAAAAACAG
GTTTTGGACCCTACA
>1a1.f1c bases 100 to 115 (SL to QR)
TAAANAGAGAGGTTCG
>1a1.f1d bases 101 to 150 (QL to QR)
TAAATAGAGAGGTTCGACTCTGCATTTCCCAAATACGTAATGCTTACGGT
>1a1.f1mp bases 96 to 168 (SL to QR)
TAAATAGAGAGGTTCGACTCTGCATTTCCCAAATACGTAATGCTTACGGTACACGACCCA
AGCTCTCTGCTTG
This is what I did.
%hash = ();
open(FH, "< $file") or die "unable to read $file file: $!\n";
while (my $line = <FH>) {
if ($line =~ /^>/) {
($Acc) = ($line =~ /^>(\S+)/); # save accession
while (my $line1 = <FH>) {
if($line1 =~ /^>/) {
last;
} else {
push(@{$hash{$Acc}}, $line);
}
}
}
}
close(FH) || die "Can't close $file file: $!\n";
The problem I'm having is that it is skipping the next record since inner loop read
the next start line. I'm sure there must be a better way. I will appreciate anyone
suggesting a solution.
Thanks,
perdeep
Perdeep K. Mehta, PhD
Hartwell Center for Bioinformatics & Biotechnology
St. Jude Children's Research Hospital
Memphis, TN 38105-2794
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of
Ron Goral
Sent: Tuesday, August 03, 2004 5:50 AM
To: mario sanchez; [EMAIL PROTECTED]
Subject: RE: [Perl-unix-users] CGI
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] Behalf Of
> mario sanchez
> Sent: Monday, August 02, 2004 1:07 PM
> To: [EMAIL PROTECTED]
> Cc: [EMAIL PROTECTED]
> Subject: [Perl-unix-users] CGI
>
>
> i would like to call http://www.whatever.com/xyz.html where AUTOMATICALLY
> xyz.html runs a perl script.
>
> i have asked this question in the past and the best answer
> afforded was to
> call xyz.cgi where the script first reads and "displays" xyz.html then
> goes off and does whatever else i needed. i cant use this option.
>
> does anyone have an idea of how this can be done - again where the script
> is invoked automatically?
>
> thanks a bunch!!
> mario
Use a server side include something like:
<!--#include virtual="/cgi-bin/xyz.cgi"-->
Embed this in the html for xyz.html at the place where you want the content
for xyz.cgi output to appear.
Peace in Christ -
Ron Goral
_______________________________________________
Perl-Unix-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
_______________________________________________
Perl-Unix-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs