Skip to content

Commit

Permalink
added query nucleotide- and file count
Browse files Browse the repository at this point in the history
  • Loading branch information
fethalen committed Apr 23, 2024
1 parent 207f037 commit 8e2d6ad
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/fasta.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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


6 changes: 4 additions & 2 deletions src/fastq.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 8e2d6ad

Please sign in to comment.