Документ взят из кэша поисковой машины. Адрес оригинального документа : http://kodomo.fbb.msu.ru/hg/allpy/rev/a1be82967e81
Дата изменения: Unknown
Дата индексирования: Tue Oct 2 00:44:53 2012
Кодировка:
allpy: a1be82967e81

allpy

changeset 984:a1be82967e81

allpy/structure: add ``parts'' argument to blocks3d() You can provide pre-calculated pair core parts in this argument.
author Boris Nagaev <bnagaev@gmail.com>
date Wed, 29 Feb 2012 15:13:12 +0400
parents adae2d57dc6c
children ce4ccbd2a1c2
files allpy/structure.py
diffstat 1 files changed, 11 insertions(+), 7 deletions(-) [+]
line diff
     1.1 --- a/allpy/structure.py	Wed Feb 29 11:39:32 2012 +0400
     1.2 +++ b/allpy/structure.py	Wed Feb 29 15:13:12 2012 +0400
     1.3 @@ -641,17 +641,19 @@
     1.4  
     1.5      def blocks3d(self, max_delta=config.delta,
     1.6      timeout=config.timeout, timeout_2=config.timeout_2,
     1.7 -    min_width=config.min_width, ignore_one_ss=True, primary_cliques=False):
     1.8 +    min_width=config.min_width, ignore_one_ss=True, primary_cliques=False,
     1.9 +    parts=None):
    1.10          """ Return length-sorted list of reliable blocks
    1.11  
    1.12 -        * max_delta -- threshold of distance spreading
    1.13 -        * timeout -- Bron-Kerbosh timeout (couple cores)
    1.14 +        * max_delta -- threshold of distance spreading (ignored if parts)
    1.15 +        * timeout -- Bron-Kerbosh timeout (couple cores) (ignored if parts)
    1.16          * timeout_2 -- Bron-Kerbosh timeout (blocks)
    1.17 -        * min_width -- min width of each core
    1.18 +        * min_width -- min width of each core (ignored if parts)
    1.19          * ignore_one_ss -- ignore geometrical cores, owned by one secondary
    1.20 -            structure element in every sequence
    1.21 +            structure element in every sequence (ignored if parts)
    1.22          * primary_cliques -- if True, return cliques
    1.23              instead of not-self-intersected blocks
    1.24 +        * parts -- pre-calculated pair core parts (the method will change it)
    1.25          """
    1.26          result = []
    1.27          # for sorting
    1.28 @@ -666,8 +668,9 @@
    1.29              for sequence, monomer in column.items():
    1.30                  monomer2column[monomer] = column
    1.31                  monomer2sequence[monomer] = sequence
    1.32 -        parts = self.pair_core_parts(max_delta=max_delta,
    1.33 -            timeout=timeout, min_width=min_width, ignore_one_ss=ignore_one_ss)
    1.34 +        if parts is None:
    1.35 +            parts = self.pair_core_parts(max_delta=max_delta, timeout=timeout,
    1.36 +                    min_width=min_width, ignore_one_ss=ignore_one_ss)
    1.37          boundaries = set() # of Columns
    1.38          for part in parts:
    1.39              boundaries.add(part.columns[0])
    1.40 @@ -730,6 +733,7 @@
    1.41                      block = copy(self)
    1.42                      block.columns = filled_columns
    1.43                      block.sequences = sequences
    1.44 +                    # FIXME min_width is not needed
    1.45                      parts = block.continuous_blocks(min_width)
    1.46                      if parts:
    1.47                          for part in parts: