Creates copy methods for Feature and Location to address concerns raised by https://github.com/TimothyStiles/poly/issues/342. I don't think it's actually necessary to change Gff.AddFeature() as this would just unnecessarily slow down the parser, but these methods should support the pattern described by the issue raiser.
Improves error reporting via a new ParserError struct.
Why are you making these changes?
Explain why these changes are necessary. Link to GitHub issues here with the format fixes: #XXX to indicate this PR resolves the issue.
Addresses several minor issues related to genbank, which I believe to encompass a small yet cohesive featureset. Issues have been linked in the respective changes.
Are any changes breaking? (IMPORTANT)
Will merging this PR change poly's API in a non-backwards-compatible manner?
Yes
This changes the type of Features.Attributes from map[string]string to MultiMap[string, string], an alias for map[string]string defined in multimap.go. This can be seen via adjustments to unit tests.
In addition to expanding the set of Genbank files which can be validly parsed, the parser should be more vocal when it encounters unusual syntax in the "feature" section. This "fail fast" approach is better as the file in the new functional test triggered a codepath which would neither return a valid Genbank object or an error, and should hopefully lead to faster turnaround on parser fixes in the future.
Pre-merge checklist
All of these must be satisfied before this PR is considered
ready for merging. Mergeable PRs will be prioritized for review.
[X] New packages/exported functions have docstrings.
[ ] New/changed functionality is thoroughly tested.
[X] New/changed functionality has a function giving an example of its usage in the associated test file. See primers/primers_test.go for what this might look like.
[ ] Changes are documented in CHANGELOG.md in the [Unreleased] section.
Changes in this PR
Clearly and concisely summarize the changes you are making. Bullet points are completely okay. Please be specific, saying "improves X" is not enough!
Gff.AddFeature()
as this would just unnecessarily slow down the parser, but these methods should support the pattern described by the issue raiser.Feature.StoreSequence
to enable https://github.com/TimothyStiles/poly/issues/388.ParserError
struct.Why are you making these changes?
Explain why these changes are necessary. Link to GitHub issues here with the format
fixes: #XXX
to indicate this PR resolves the issue.Are any changes breaking? (IMPORTANT)
Will merging this PR change
poly
's API in a non-backwards-compatible manner?Yes
map[string]string
toMultiMap[string, string]
, an alias formap[string]string
defined inmultimap.go
. This can be seen via adjustments to unit tests.Pre-merge checklist
All of these must be satisfied before this PR is considered ready for merging. Mergeable PRs will be prioritized for review.
primers/primers_test.go
for what this might look like.CHANGELOG.md
in the[Unreleased]
section.