Make empty sequences invalid
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- rust
- Domain
- bioinformatics
Research direction
Start by tracing IupacDnaSequence::new and the SmallMutation checks mentioned in the issue. Review how alternative sequences are represented, then update construction and deletion handling so empty sequences are rejected while deletions remain representable with Option; done means the affected APIs and downstream checks consistently follow those invariants.
Written by the indexing model from the issue text.
Description
Currently this is a valid construction of a sequence:
let seq = IupacDnaSequence::new("");
But ... rust has the option type for representing the idea of 'None' vs 'Some'. If downstream code needs to express the idea of 'No sequence' or 'empty sequence' currently there are two options. Using Option<Seq> or Returning a sequence with no bases as above.
To simplify APIs and make life easier for downstream sequence processing functions I think we should enforce sequences to be non-empty at construction. This pairs well with our interval types which also cannot represent 0-length intervals.
Example of where this makes life easier:
Any sequence -> length normalised quantititive metrics will no longer have to worry about divide by zero's when dividing by sequence length.
When we implement this, we can now remove the manual checks in SmallMutation for whether reference base is at least length = 1
HOWEVER we will need to make the Alternative sequence and option type (Option) so that we can still represent deletions. E.g. reference = dna!("A") and alternative = None
- Dominant language
- Rust
- Stars
- 0
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from selkamand/seqlib
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
All issues in selkamand/seqlib
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
kwakseongjae/auto-hwp#319 ·
-
area:cli bug filter-quality good first issue priority:medium
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
bevyengine/bevy#25861 ·
-
comp-datalake
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
ClickHouse/ClickHouse#121222 ·
-
enhancement remote
Difficulty 2/5 1-3 hours Newbie friendliness 68/100