The thing is, if I use Bio::SeqIO then Bio::Tools::SeqStats produces an error (saying that it wants input provided by Bio::PrimarySeq). (btw in this line $seqobj = Bio::PrimarySeq->new( -file => "sekw2.fasta", - alphabet => 'dna',); there's a typo "sekw2" instead of "seq2" but this is correct in my original code).