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

# HG changeset patch
# User boris (netbook)
# Date 1287999011 -14400
# Node ID f7dead02571908f072f497c7659546eeb54f13b1
# Parent 85fc264975a20a17fa0931db7883a9e80a518eba
documentation improvements

diff -r 85fc264975a2 -r f7dead025719 lib/block.py
--- a/lib/block.py Mon Oct 25 00:03:35 2010 +0400
+++ b/lib/block.py Mon Oct 25 13:30:11 2010 +0400
@@ -68,7 +68,7 @@
timeout=config.timeout, minsize=config.minsize,
ac_new_atoms=config.ac_new_atoms,
ac_count=config.ac_count):
- """ returns length-sorted list of blocks, representing GCs
+ """ Returns length-sorted list of blocks, representing GCs

max_delta -- threshold of distance spreading
timeout -- Bron-Kerbosh timeout (then fast O(n ln n) algorithm)
diff -r 85fc264975a2 -r f7dead025719 lib/graph.py
--- a/lib/graph.py Mon Oct 25 00:03:35 2010 +0400
+++ b/lib/graph.py Mon Oct 25 13:30:11 2010 +0400
@@ -51,9 +51,11 @@

@staticmethod
def line(k1, k2):
+ """ Construct object, representing line of graph """
return frozenset([k1, k2])

def bounded(self, k1, k2):
+ """ Return if these two nodes of the graph are bounded with line """
return k1 == k2 or Graph.line(k1, k2) in self.lines

def count_one(self, node):
@@ -94,6 +96,7 @@

def drop_nodes(self, nodes):
""" Run drop_node for each of given nodes
+
Returns if nodes was not empty (ugly beauty)
"""
for node in nodes:
diff -r 85fc264975a2 -r f7dead025719 lib/monomer.py
--- a/lib/monomer.py Mon Oct 25 00:03:35 2010 +0400
+++ b/lib/monomer.py Mon Oct 25 13:30:11 2010 +0400
@@ -73,6 +73,7 @@
def from_code1(code1):
return index_code1_protein[code1.upper()]
def instance(self):
+ """ Returns new AminoAcid object of this type """
return AminoAcid(self)


@@ -86,4 +87,7 @@
for code3, data in AAdict.items():
code1, m_type, is_modified, none, name = data
if m_type == 'p':
- aat = AminoAcidType(name, code1, code3, is_modified)
+ AminoAcidType(name, code1, code3, is_modified)
+
+del code3, data, code1, m_type, is_modified, none, name
+
diff -r 85fc264975a2 -r f7dead025719 lib/project.py
--- a/lib/project.py Mon Oct 25 00:03:35 2010 +0400
+++ b/lib/project.py Mon Oct 25 13:30:11 2010 +0400
@@ -52,6 +52,7 @@
self.sequences,self.alignment=Project.from_fasta(args[0])

def __len__(self):
+ """ Returns width, ie length of each sequence with gaps """
return max([len(line) for line in self.alignment.values()])

def thickness(self):
diff -r 85fc264975a2 -r f7dead025719 lib/sequence.py
--- a/lib/sequence.py Mon Oct 25 00:03:35 2010 +0400
+++ b/lib/sequence.py Mon Oct 25 13:30:11 2010 +0400
@@ -33,9 +33,14 @@
return len(self.monomers)

def __str__(self):
+ """ Returns sequence in one-letter code """
return ''.join([monomer.type.code1 for monomer in self.monomers])

def __eq__(self, other):
+ """ Returns if all corresponding monomers of this sequences are equal
+
+ If lengths of sequences are not equal, returns False
+ """
return len(self) == len(other) and \
all([a==b for a, b in zip(self.monomers, other.monomers)])

@@ -61,12 +66,16 @@

@staticmethod
def from_str(fasta_str, name='', description='', monomer_kind=AminoAcidType):
+ """ Import data from one-letter code
+
+ monomer_kind is class, inherited from MonomerType
+ """
monomers = [monomer_kind.from_code1(aa).instance() for aa in fasta_str]
return Sequence(monomers, name, description)

@staticmethod
def from_pdb_chain(chain):
- """ returns Sequence with Monomers with link to Bio.PDB.Residue
+ """ Returns Sequence with Monomers with link to Bio.PDB.Residue

chain is Bio.PDB.Chain
"""