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

Erratum in documentation #71

Closed reganbaucke closed 2 years ago

reganbaucke commented 2 years ago

I wanted to write a sequence to a file in FASTA format according to the example in the documentation

Current Behavior

ERROR: LoadError: MethodError: no method matching (::var"#7#8")(::FASTX.FASTA.Writer{TranscodingStreams.NoopStream{IOStream}})

Possible Solution / Implementation

The w after the do needs to added:

using BioSequences
x = dna"aaaaatttttcccccggggg"
rec = FASTA.Record("MySeq", x)
open(FASTA.Writer, "my-out.fasta") do w
    write(w, rec)
end

Steps to Reproduce (for bugs)

Run the snippet from the example

Context

Was trying to run the example from the docs

jakobnissen commented 2 years ago

I can't tell which example you are referring to, and which version of the documentation. Here is how the example looks in the latest documentation:

using BioSequences
x = dna"aaaaatttttcccccggggg"
rec = FASTA.Record("MySeq", x)
w = open(FASTA.Writer, "my-out.fasta")
write(w, rec)
close(w)

And it runs just fine.

Which example is it from which version of the documentation?

reganbaucke commented 2 years ago

Hi Jakob,

Sorry, I could have been a lot clearer earlier

docs/src/manual/fasta.md on master branch

jakobnissen commented 2 years ago

Whoops, you are completely right! Thanks for pointing it out. I made a PR to fix it which I will merge as soon as CI has run. Closing as solved :)