[Biopython] instances

Peter Cock p.j.a.cock at googlemail.com
Tue Jun 30 07:42:24 UTC 2009


On Tue, Jun 30, 2009 at 8:28 AM, Liam Thompson<dejmail at gmail.com> wrote:
> Hi Peter
>
> I changed my sequence parser script to use the SeqIO module

OK - as I said before, you should get the exact same SeqRecord
objects back. But using Bio.SeqIO it should be easy to switch
your file format (e.g. to read an EMBL format file instead).

> and tried your suggestion again but this time looking like
>
> coreend = corecur_seq[0]._end.position instead of corestart =
> corecur_seq[0].position
>
> and it works, many thanks for the suggestion

It works, but in Python things starting with a single underscore
are private variables - you are not supposed to be using them.
You should be doing:

corestart =corecur_seq[0].start.position
coreend = corecur_seq[0].end.position

or probably better:

corestart = corecur_seq[0].nofuzzy_start
coreend = corecur_seq[0].nofuzzy_end

For simple non-fuzzy locations, the above methods will give the
same thing.

I agree this was not so discoverable without reading the
documentation (or the built in object's docstring), but as I
said in my last email the start, end, nofuzzy_start and the
nofuzzy_end properties do now show up properly (on the
latest version of Biopython) in dir(), allowing autocompletion

Have you looked at the new chapter about the SeqRecord
and SeqFeature etc in the latest tutorial? Any comments
would be welcome:
http://biopython.org/DIST/docs/tutorial/Tutorial.html
http://biopython.org/DIST/docs/tutorial/Tutorial.pdf

Thanks,

Peter



More information about the Biopython mailing list