in reply to Re: Extracting DNA sequences from FASTA files
in thread Extracting DNA sequences from FASTA files
As for the OP's question, FASTA is a pretty simple format other than the various stuff people put in the sequence labels. So your code will probably look something like this:sub reverse_complement { local $_ = shift; y/ACGT/TGCA/; reverse; }
while (<FASTA>) { chomp; if (/^>\s*(.*)/) { # it's a sequence label $name = $1; } else { # it's sequence data } }
|
|---|