[Biopython-dev] SeqIO and qual: Question about reading and writing qual files

Sebastian Bassi sbassi at clubdelarazon.org
Wed Mar 25 19:15:05 EDT 2009


On Wed, Mar 25, 2009 at 7:01 AM, Peter <biopython at maubp.freeserve.co.uk> wrote:
> Sebastian - could you have a quick play with this github code (using the new
> UnknownSeq class), and the current CVS code (using None), and make sure
> both support the slicing operations you were trying earlier?  Thanks.

First I tried the CVS code (with None in seq), it worked.
Then I tried the git code and it also worked. One thing I noticed is
that I got "?" instead of "N" the "sequence" of the UnknownSeq.
>From a practical point of view, both versions are the same, but the
concept of UnknownSeq looks solid than None, because if I don't know
about about biopython internals, I would never try to slice a None
seq. With "None":
len(s) returns:

Traceback (most recent call last):
  File "/home/sbassi/bioinfo/INTA/qualparser.py", line 21, in <module>
    print len(s)
  File "/home/sbassi/test/virtualenv-1.3.2/t6/lib/python2.5/site-packages/biopython-1.49-py2.5-linux-i686.egg/Bio/SeqRecord.py",
line 481, in __len__
    return len(self.seq)
TypeError: object of type 'NoneType' has no len()

So I would never try to do:
new_s = s[10:30]

But with the UnknownSeq object, len(s) returns an actual length, so it
is more intuitive that it can be sliced.

I liked the github interface, may I setup my own repository?

Best,

-- 
Sebastián Bassi. Diplomado en Ciencia y Tecnología.

Non standard disclaimer: READ CAREFULLY. By reading this email,
you agree, on behalf of your employer, to release me from all
obligations and waivers arising from any and all NON-NEGOTIATED
agreements, licenses, terms-of-service, shrinkwrap, clickwrap,
browsewrap, confidentiality, non-disclosure, non-compete and
acceptable use policies ("BOGUS AGREEMENTS") that I have
entered into with your employer, its partners, licensors, agents and
assigns, in perpetuity, without prejudice to my ongoing rights and
privileges. You further represent that you have the authority to release
me from any BOGUS AGREEMENTS on behalf of your employer.



More information about the Biopython-dev mailing list