diff --git a/src/fasta.jl b/src/fasta.jl index 44df0bc..543dd21 100644 --- a/src/fasta.jl +++ b/src/fasta.jl @@ -248,13 +248,14 @@ function fasta_countrecords(file::AbstractString) end recordcount = 0 - for _ in reader + for record in reader recordcount += 1 + nucleotides += length(FASTX.sequence(record)) end close(reader) - return recordcount + return recordcount, nucleotides end diff --git a/src/fastq.jl b/src/fastq.jl index 90baef8..9104ae9 100644 --- a/src/fastq.jl +++ b/src/fastq.jl @@ -145,11 +145,13 @@ function fastq_countrecords(file::AbstractString) end recordcount = 0 - for _ in reader + nucleotides = 0 + for record in reader recordcount += 1 + nucleotides += length(FASTX.sequence(record)) end close(reader) - return recordcount + return recordcount, nucleotides end