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

Avoid copying data when extracting sequence #36

Closed jakobnissen closed 4 years ago

jakobnissen commented 4 years ago

Uses a view instead of slicing into the data vector when creating the sequence, hence saving a copy of the data.

codecov[bot] commented 4 years ago

Codecov Report

Merging #36 into master will increase coverage by 1.95%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #36      +/-   ##
==========================================
+ Coverage   83.29%   85.25%   +1.95%     
==========================================
  Files          13       13              
  Lines         497      563      +66     
==========================================
+ Hits          414      480      +66     
  Misses         83       83              
Flag Coverage Δ
#unittests 85.25% <100.00%> (+1.95%) :arrow_up:

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

Impacted Files Coverage Δ
src/fasta/record.jl 77.95% <100.00%> (+3.87%) :arrow_up:
src/fastq/record.jl 81.81% <100.00%> (+4.49%) :arrow_up:
src/fasta/writer.jl 100.00% <0.00%> (ø)
src/fastq/writer.jl 100.00% <0.00%> (ø)
src/fasta/readrecord.jl 88.88% <0.00%> (+0.42%) :arrow_up:
src/fastq/readrecord.jl 87.50% <0.00%> (+0.61%) :arrow_up:
src/fasta/index.jl 85.00% <0.00%> (+0.78%) :arrow_up:
src/fastq/quality.jl 95.65% <0.00%> (+0.91%) :arrow_up:
src/fasta/reader.jl 85.71% <0.00%> (+1.50%) :arrow_up:
src/fastq/reader.jl 85.71% <0.00%> (+1.50%) :arrow_up:
... and 2 more

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 db4caae...4d71f69. Read the comment docs.

jakobnissen commented 4 years ago

Whoops, I must have brainfarted. The original implementation did not allocate either