[Biopython-dev] [Biopython] Using SeqLocation to extract subsequence

Peter biopython at maubp.freeserve.co.uk
Tue Nov 3 12:09:37 EST 2009


On Tue, Nov 3, 2009 at 4:46 PM, Kyle Ellrott <kellrott at gmail.com> wrote:
> (Moving this thread to Biopython-dev)
>
> I've hacked together some code, and tested it against the bacterial genome
> library I had on hand (of course, eukariotic features will be more
> complicated, so will need to test against them next).  Examples of 'exotic'
> feature location would be helpful.
> I've posted the code below.  I'll be moving it into my git fork, and add
> some testing.  Any thoughts where it should go?  It seems like it would best
> work as a SeqRecord method.

i.e. Option (4) of this list of ideas?
http://lists.open-bio.org/pipermail/biopython-dev/2009-October/006922.html

Peter

P.S.

def FeatureDescGuess( feature ):
   desc = ""
   try:
       desc=feature.qualifiers['product'][0]
   except KeyError:
       pass
   return desc

Could be just:

def FeatureDescGuess( feature ):
   return feature.qualifiers.get('product', [""])[0]

and therefore doesn't really need an entire function.



More information about the Biopython-dev mailing list