Skip to content

Commit c5697ac

Browse files
Refactor ORFI type documentation for clarity and consistency
1 parent f3ef788 commit c5697ac

File tree

1 file changed

+26
-7
lines changed

1 file changed

+26
-7
lines changed

docs/src/orftype.md

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1+
## The ORFI Type
12

2-
## The ORFI type
3-
4-
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:
3+
The `ORFI` type in `GeneFinder` is designed to enforce stricter validation, preventing the creation of incompatible instances. This ensures greater stability and consistency when working with open reading frames (ORFs). For example, attempting to create an `ORFI` with invalid parameters will result in an error:
54

65
```julia
76
ORFI{4,NaiveFinder}(1:10, '+', 4) # Or any F <: GeneFinderMethod
@@ -18,13 +17,33 @@ Stacktrace:
1817
[1] top-level scope
1918
@ REPL[21]:1
2019
```
21-
22-
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.
20+
21+
### Validation Rules
22+
23+
The `ORFI` type enforces the following rules:
24+
- The strand must be either `+` or `-`. Any other value will trigger an error.
25+
- Parameters must align with the expected structure of an open reading frame.
26+
27+
These safeguards help prevent the creation of invalid ORFs, making the system more robust and easier to extend.
28+
29+
### Example Usage
30+
31+
Here is an example of creating a valid `ORFI` instance:
2332

2433
```julia
25-
ORFI{4,NaiveFinder}("seq", 1, 33, STRAND_POS, 1, convert(LongSubSeq, dna"ATGATGCATGCATGCATGCTAGTAACTAGCTAG"), NamedTuple())
34+
ORFI{4,NaiveFinder}(
35+
"seq",
36+
1,
37+
33,
38+
STRAND_POS,
39+
1,
40+
convert(LongSubSeq, dna"ATGATGCATGCATGCATGCTAGTAACTAGCTAG"),
41+
NamedTuple()
42+
)
2643
```
2744

45+
This instance can then be used to iterate over a sequence of interest and verify whether the `ORFI` is contained within the sequence.
46+
2847
!!! warning
29-
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.
48+
While the `ORFI` type ensures stricter validation, it is still possible to create an `ORFI` that does not correspond to an actual open reading frame in the sequence. This limitation will be addressed in future versions of the package. However, the current implementation provides the benefit of retrieving the corresponding subsequence in a convenient 5' to 3' orientation, regardless of the strand.
3049

0 commit comments

Comments
 (0)