Edinburgh-Genome-Foundry / DnaFeaturesViewer

:eye: Python library to plot DNA sequence features (e.g. from Genbank files)
https://edinburgh-genome-foundry.github.io/DnaFeaturesViewer/
MIT License
584 stars 90 forks source link

Add locus_tag to GraphicRecord by default #46

Closed MrTomRod closed 3 years ago

MrTomRod commented 3 years ago

I found locus_tag to be a useful property of GraphicFeature objects because it tends to be unique.

coveralls commented 3 years ago

Coverage Status

Coverage decreased (-0.2%) to 91.508% when pulling cbe2b96d980af7e8463bb2053a7c0e3d9e74f01d on MrTomRod:master into 6ace5cdff96bf995aa26167868b0dbb47f5f5952 on Edinburgh-Genome-Foundry:master.

Zulko commented 3 years ago

My two cents: the GraphicFeature's primary parameters all refer to graphic properties ("what you will see") and the locus_tag parameter, if it is not used for graphical display, would be an outlier. If you simply don't add the locus_tag as a parameter in the definition GraphicFeature (the rest of your code remaining unchanged) the locus_tag would then be interpreted as a **data component and be accessible via my_feature.data['locus_tag'].

MrTomRod commented 3 years ago

That makes sense, I didn't study the API closely enough. Thanks!

Zulko commented 3 years ago

To clarify, I wasn't suggesting to close the MR, as parts of it like compute_locus_tag may still be a valid approach. You can re-open this MR if you believe a core change to DFV is best way to solve your problem.