Gff.AddFeature()
code is misleading and mutates Feature
state
#342
Labels
bug
Something isn't working
easy
A quick and easy fix!
good first issue
Good for newcomers
medium priority
The default priority for a new issue.
stale
Milestone
Gff.AddFeature()
seems to intend to create a copy of theFeature
it is provided. Dereferencing the pointer is not sufficient to do this, asFeature
structs contain mutable fields (e.g.Feature.Attribtues
is amap[string]string
, andFeature.Location
is a struct that has a slice field in it).https://github.com/TimothyStiles/poly/blob/ad662c741528bbb5bcaa7a3107991a86426c1e55/io/gff/gff.go#L78-L84
IMO, the
Feature.ParentSequence
field should be dropped entirely. Currently, it is only used bygetFeatureSequence
, which could easily be modified to be a method of theGff
struct. This makes more sense asFeature
s andLocation
s only exist in the context of aGff
anyway.This also means that the
Gff.AddFeature()
method can be entirely dropped in favor of directly appending it toGff.Features
.It's a small change, so I'm more than happy to do this once given the go-ahead!
Blocked by #339 .
The text was updated successfully, but these errors were encountered: