@@ -567,11 +567,11 @@ def tofmtstr(self, fmt, **kw):
567567 """
568568 return self .write (None , fmt )
569569
570- def tolists (self , vals = 'type start stop strand' ):
570+ def tolists (self , keys = 'type start stop strand' ):
571571 """
572572 Return a generator yielding a list for each feature
573573
574- :param vals : Parameters from the metadata or location to return,
574+ :param keys : Parameters from the metadata or location to return,
575575 ``'len'`` is also allowed,
576576 might be a string or tuple, defaults to ``'type start stop strand'``
577577
@@ -586,24 +586,24 @@ def tolists(self, vals='type start stop strand'):
586586 cDNA_match 103944892 - 7136
587587 cDNA_match 107859806 - 2392
588588 """
589- if isinstance (vals , str ):
590- vals = vals .split ()
589+ if isinstance (keys , str ):
590+ keys = keys .split ()
591591 for ft in self :
592592 yield [
593- ft .loc .strand if v == 'strand' else
594- ft .loc .defect if v == 'defect' else
595- ft .locs .range [0 ] if v == 'start' else
596- ft .locs .range [1 ] if v == 'stop' else
597- len (ft ) if v == 'len' else
598- ft .meta .get (v )
599- for v in vals
593+ ft .loc .strand if k == 'strand' else
594+ ft .loc .defect if k == 'defect' else
595+ ft .locs .range [0 ] if k == 'start' else
596+ ft .locs .range [1 ] if k == 'stop' else
597+ len (ft ) if k == 'len' else
598+ ft .meta .get (k )
599+ for k in keys
600600 ]
601601
602- def topandas (self , vals = 'type start stop strand' , ** kw ):
602+ def topandas (self , keys = 'type start stop strand' , ** kw ):
603603 """
604604 Return a `pandas.DataFrame` of the features
605605
606- :param vals : Parameters from the metadata or location to return,
606+ :param keys : Parameters from the metadata or location to return,
607607 ``'len'`` is also allowed,
608608 might be a string or tuple, defaults to ``'type start stop strand'``
609609
@@ -620,10 +620,10 @@ def topandas(self, vals='type start stop strand', **kw):
620620 3 cDNA_match 107859806 107862198 -
621621 """
622622 import pandas
623- if isinstance (vals , str ):
624- vals = vals .split ()
625- kw .setdefault ('columns' , vals )
626- return pandas .DataFrame (self .tolists (vals = vals ), ** kw )
623+ if isinstance (keys , str ):
624+ keys = keys .split ()
625+ kw .setdefault ('columns' , keys )
626+ return pandas .DataFrame (self .tolists (keys = keys ), ** kw )
627627
628628
629629 def get (self , type ):
0 commit comments