[Biopython-dev] Consumer of "KW" in embl format

Peter Cock p.j.a.cock at googlemail.com
Tue Mar 12 14:40:16 UTC 2013


On Tue, Mar 12, 2013 at 11:35 AM, Xabier Bello <xbello at gmail.com> wrote:
> Lets try it:
>
> Line 997:
> def _write_keywords(self, record):
>     #Put the keywords right after DE line.
>     self._write_multi_line("KW", "%s." % "; ".join(
>         record.annotations["keywords"]))
>     self.handle.write("XX\n")

Looks good - although there is a potential problem here with long keywords
where this does not avoid splitting a single keyword over multiple KW lines
(as specified in the EMBL specification). This is a corner case though...

> Line 1070:
> if "keywords" in record.annotations:
>     self._write_keywords(record)
>
> Note to self: learn to make diff patches and forks on github.

Good plan :)

Meanwhile, I committed that change:
https://github.com/biopython/biopython/commit/41470eac55a665d1cb1c7e73ebfd3c1df98af5ad

I added a little more testing, from which I think we may need to
do some work with some of the other EMBL fields like dbxrefs:
https://github.com/biopython/biopython/commit/07639dde32083f4f024616292a5c736e85770a4e

Thanks,

Peter



More information about the Biopython-dev mailing list