SeqFeature cleanup
I am finding code to parse GenBank-style location strings into SeqFeature objects in multiple places in Biopython:
- In
Bio/SwissProt/__init__.py, in the_read_ftfunction; - In
Bio/SeqIO/SwissIO.py, in the_make_positionfunction; - In
Bio/GenBank/__init__.py, in the_posfunction.
Note that all three functions are private.
It would be better to replace these three functions by one public function, maybe SeqFeature.fromstring.
attn @peterjc
Looks like _make_pos in Bio/SeqIO/SwissIO.py is unused, probably an oversight from https://github.com/biopython/biopython/pull/2484 - it can probably be removed now.
As to SwissProt vs GenBank/EMBL, the formats are overlapping but not exactly the same. The SwissProt locations are far simpler (but can be just "?") as I recall.
I had previously thought about pulling the GenBenk/EMBL location parsing into a user-facing function as you are suggesting.