From 8e2d6add4bfb1c087143e8716b29c1b5665701bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Thal=C3=A9n?= Date: Tue, 23 Apr 2024 14:43:28 +0200 Subject: [PATCH] added query nucleotide- and file count --- src/fasta.jl | 5 +++-- src/fastq.jl | 6 ++++-- 2 files changed, 7 insertions(+), 4 deletions(-) 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