Giter VIP home page Giter VIP logo

Comments (4)

peterjc avatar peterjc commented on June 13, 2024

According to https://docs.python.org/2/library/textwrap.html the TextWrapper class used from the Python library will by default break at hyphens.

Adding break_long_words=False might be helpful here? That gives:

FT                   /product="2-amino-4-hydroxy-6-hydroxymethyldihydropteridine
FT                   pyrophosphokinase"

This passes the ENA validation tool, although it isn't quite as strict as the Prokka Genbank wrapping. Pull request to follow...

from gff3toembl.

peterjc avatar peterjc commented on June 13, 2024

Could you reopen this issue as discussed on #68 please?

from gff3toembl.

peterjc avatar peterjc commented on June 13, 2024

It seems that break_long_words=False in Python's textwrap considers hyphenated terms as a single word, and thus will try to avoid breaking them.

That's generally fine, but we have a problem if the hyphenated term itself is about 60+ characters, meaning even when put on a line on its own once the 21 character FT indent is added it exceeds the 80 character limit.

The "about" is because things are much tighter if this is the first word as you also have the prefix /product=" to consider, while for the final word there is the extra " to include.

Sadly if we stick with the default of break_long_words=True, then Python does not seem to take advantage of hyphens when deciding where to line-break in this corner case - Python bug filed: http://bugs.python.org/issue28660

from gff3toembl.

andrewjpage avatar andrewjpage commented on June 13, 2024

Thanks for filing the python bug. This format is a royal pain in the modern age.

from gff3toembl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.