B
Bryan
Hi, I'm reading in a file in fasta format:
I have been doing this:
open (INFILE, "< $filename") or die "Cannot open $filename] for read\n\n";
undef $/;
my @chunks = split(/>/, <INFILE>);
$/ = "\n";
close INFILE;
This works, but this split loses the '>' from the header part of the
file, which I would rather keep for identifying header info later. So
first, why do I lose the '>' on this particular split, is there
something I can do to keep it? Second, is there a better way to split
this file into chunks than I am doing?
Thanks,
Bryan
DATAheader DATADATADATA
DATADATA
header
I have been doing this:
open (INFILE, "< $filename") or die "Cannot open $filename] for read\n\n";
undef $/;
my @chunks = split(/>/, <INFILE>);
$/ = "\n";
close INFILE;
This works, but this split loses the '>' from the header part of the
file, which I would rather keep for identifying header info later. So
first, why do I lose the '>' on this particular split, is there
something I can do to keep it? Second, is there a better way to split
this file into chunks than I am doing?
Thanks,
Bryan