BioJulia / FASTX.jl

Parse and process FASTA and FASTQ formatted files of biological sequences.
https://biojulia.dev
MIT License
61 stars 20 forks source link

Return header, identifier and desc as string views #62

Closed jakobnissen closed 2 years ago

jakobnissen commented 2 years ago

Currently, header, identifier and description returns String, which forces needless allocations. This PR adds the dependency StringViews, which allows the creation of an AbstractString from any AbstractVector{UInt8}.

The aforementioned functions now return these string views backed by a view into the data buffer.

This change is breaking.

codecov[bot] commented 2 years ago

Codecov Report

Merging #62 (3fa9d5a) into release-2 (28d0b87) will not change coverage. The diff coverage is 80.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           release-2      #62   +/-   ##
==========================================
  Coverage      80.63%   80.63%           
==========================================
  Files             12       12           
  Lines            661      661           
==========================================
  Hits             533      533           
  Misses           128      128           
Flag Coverage Δ
unittests 80.63% <80.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/FASTX.jl 100.00% <ø> (ø)
src/fasta/record.jl 65.24% <62.50%> (ø)
src/fastq/record.jl 82.39% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 28d0b87...3fa9d5a. Read the comment docs.

jakobnissen commented 2 years ago

Also backport some of the recent changes on master to this branch. I know, this is not good git-foo, I'll do better next time.