Add spliceinto! function.#338
Conversation
This function inserts a sequence into a biosequence, and optionally deletes part of the original sequence. The naming difference from `Base.splice!` reflects is slightly different API.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #338 +/- ##
==========================================
+ Coverage 90.87% 91.75% +0.88%
==========================================
Files 31 29 -2
Lines 2400 2827 +427
==========================================
+ Hits 2181 2594 +413
- Misses 219 233 +14
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Another option: Just have it be |
|
Thanks, I'll check this in <3hrs. I think having the insertion be a range is redundant, no? Can you see a use case of inserting a collection not at |
|
Nvm, I read the commit (currently on my phone) and see the optional deletion of destination |
|
Would it be fair to alias it as |
|
Yeah, that's also a cool name! Maybe even better. |
|
The |
|
Thank you! |
Fixes #336
@pdimens - I'm interested in feedback. Does this cover your use case, and what do you think of the API?
The reason for the deviation from
splice!is:4:3 == 5:4, and yet passing these equal arrays intosplice!causes different behavioursplice!returns the removed sequenceBy the way, if you need this function now and can't wait for the 3.5.0 release (which will happen once this PR is merged), or need compat with older versions of BioSequences, you can use the implmentation from this PR. It's efficient, and uses no internals.