Skip to content

Commit

Permalink
Rename 'Finding ORFs' section to 'The ORF type' and move related cont…
Browse files Browse the repository at this point in the history
…ent from naivefinder.md to orftype.md for improved documentation clarity.
  • Loading branch information
camilogarciabotero committed Oct 30, 2024
1 parent 47bcc0e commit cfda522
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 109 deletions.
2 changes: 1 addition & 1 deletion docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pgs = [
"Home" => "index.md",
"Get Started" => "getstarted.md",
"Usage" => [
"Finding ORFs" => "naivefinder.md",
"The ORF type" => "orftype.md",
"Scoring ORFs" => "features.md",
"A Simple Coding Rule" => "simplecodingrule.md",
"Writing ORFs In Files" => "iodocs.md",
Expand Down
99 changes: 0 additions & 99 deletions docs/src/naivefinder.md

This file was deleted.

30 changes: 30 additions & 0 deletions docs/src/orftype.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@

## The ORFI type

For convenience, the `ORFI` type is more stringent in preventing the creation of incompatible instances. As a result, attempting to create an instance with incompatible parameters will result in an error. For instance, the following code snippet will trigger an error:

```julia
ORFI{4,NaiveFinder}(1:10, '+', 4) # Or any F <: GeneFinderMethod

ERROR: MethodError: no method matching OpenReadingFrameInterval{4, NaiveFinder}(::UnitRange{Int64}, ::Char, ::Int64)

Closest candidates are:
(::Type{OpenReadingFrameInterval{N, F}} where {N, F})(::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any)
@ GeneFinder ~/.julia/dev/GeneFinder/src/types.jl:49
OpenReadingFrameInterval{N, F}(::Type{F}, ::String, ::Int64, ::Int64, ::Strand, ::Int8, ::LongSubSeq{DNAAlphabet{N}}, ::NamedTuple) where {N, F<:GeneFinder.GeneFinderMethod}
@ GeneFinder ~/.julia/dev/GeneFinder/src/types.jl:58

Stacktrace:
[1] top-level scope
@ REPL[21]:1
```

Similar behavior will be encountered when the strand is neither `+` nor `-`. This precautionary measure helps prevent the creation of invalid ORFs, ensuring greater stability and enabling the extension of its interface. For example, after creating a specific `ORFI`, users can seamlessly iterate over a sequence of interest and verify whether the ORFI is contained within the sequence.

```julia
ORFI{4,NaiveFinder}("seq", 1, 33, STRAND_POS, 1, convert(LongSubSeq, dna"ATGATGCATGCATGCATGCTAGTAACTAGCTAG"), NamedTuple())
```

!!! warning
It is still possible to create an `ORFI` and pass it to a sequence that does not necessarily contain an actual open reading frame. This will be addressed in future versions of the package. But the benefit of having it is that it will retrieve the corresponding subsequence of the sequence in a convinient way (5' to 3') regardless of the strand.

Loading

0 comments on commit cfda522

Please sign in to comment.