[BioPython] Bio.Medline parser
Michiel de Hoon
mjldehoon at yahoo.com
Thu Aug 7 10:56:37 EDT 2008
If there are no further suggestions, I'll implement the .find() method as described below.
--Michiel.
--- On Sat, 8/2/08, Michiel de Hoon <mjldehoon at yahoo.com> wrote:
> From: Michiel de Hoon <mjldehoon at yahoo.com>
> Subject: Re: [BioPython] Bio.Medline parser
> To: "Peter" <biopython at maubp.freeserve.co.uk>
> Cc: biopython at biopython.org
> Date: Saturday, August 2, 2008, 9:57 PM
> > The alias idea is nice but does mean there is more than
> one
> > way to access the data (not encouraged in python). A
> related
> > suggestion is to support the properties
> record.entry_date,
> > record.author etc (what ever the current parser does)
> as
> > alternatives to record["DA"],
> record["AU"], ... ? This would
> > then be backwards compatible. This could probably be
> done with
> > a private dictionary mapping keys ("DA") to
> property names
> > ("entry_date"). When ever we add a new
> entry to the
> > dictionary, also see if it has a named property to
> define
> > too.
> >
> Thinking it over, I think that having a key and an
> attribute mapping to the same value is not so clean.
> Alternatively we could add a .find(term) method to the
> Bio.Medline.Record class, which takes a term and returns the
> appropriate value. So record.find("author")
> returns record["AU"]. This gives a clear
> separation between the raw keys in the Medline file and the
> more descriptive names. Also, such a .find method can accept
> a wider variety of terms than an attribute name (e.g.,
> "Full Author", "full_author", etc. all
> return record["FAU"]).
>
> --Michiel
>
>
>
> _______________________________________________
> BioPython mailing list - BioPython at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/biopython
More information about the BioPython
mailing list