Документ взят из кэша поисковой машины. Адрес оригинального документа : http://kodomo.fbb.msu.ru/hg/allpy/diff/62e38970ffa2/lib/project.py
Дата изменения: Unknown
Дата индексирования: Sun Feb 3 23:55:49 2013
Кодировка:
allpy: lib/project.py diff

allpy

diff lib/project.py @ 111:62e38970ffa2

broken: lib::project::column -- new returning value sequence::pdb_chain_chain_add completed
author boris <bnagaev@gmail.com>
date Sat, 23 Oct 2010 12:57:07 +0400
parents b43daeb9d767
children b7b963287d31
line diff
     1.1 --- a/lib/project.py	Sat Oct 23 12:07:21 2010 +0400
     1.2 +++ b/lib/project.py	Sat Oct 23 12:57:07 2010 +0400
     1.3 @@ -12,7 +12,6 @@
     1.4  import allpy_data
     1.5  import os
     1.6  from tempfile import mkstemp
     1.7 -import sys
     1.8  
     1.9  class Project(object):
    1.10      """
    1.11 @@ -198,8 +197,8 @@
    1.12          """
    1.13          returns list of columns of alignment
    1.14          sequence or sequences:
    1.15 -            if sequence is given, then column is monomer
    1.16 -            if sequences is given, then column is dict {sequence: monomer}
    1.17 +            if sequence is given, then column is (original_monomer, monomer)
    1.18 +            if sequences is given, then column is dict (original_monomer, {sequence: monomer}) 
    1.19              if both of them are given, it is an error
    1.20          original (Sequence type):
    1.21              if given, this filters only columns represented by original sequence
    1.22 @@ -210,11 +209,11 @@
    1.23          alignment = self.alignment.items()
    1.24          alignment.sort(key=lambda i: indexes[i[0]])
    1.25          alignment = [monomers for seq, monomers in alignment]
    1.26 -        for column in zip(alignment):
    1.27 -            if not original or column[index[original]]:
    1.28 +        for column in zip(*alignment):
    1.29 +            if not original or column[indexes[original]]:
    1.30                  if sequence:
    1.31 -                    yield column[index[sequence]]
    1.32 +                    yield (column[indexes[original]], column[indexes[sequence]])
    1.33                  else:
    1.34 -                    yield dict([(s, column[index[s]]) for s in sequences])
    1.35 +                    yield (column[indexes[original]], dict([(s, column[indexes[s]]) for s in sequences]))
    1.36          
    1.37