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

# HG changeset patch
# User Daniil Alexeyevsky
# Date 1292437825 -10800
# Node ID 59320c160daee146dd4554dc4ab23513aa27ebbc
# Parent 1616830de2be90b97703ef9e49399d26634bc544
Fixed ReST warnings from docstrings in allpy.base

diff -r 1616830de2be -r 59320c160dae allpy/base.py
--- a/allpy/base.py Wed Dec 15 20:40:10 2010 +0300
+++ b/allpy/base.py Wed Dec 15 21:30:25 2010 +0300
@@ -99,8 +99,11 @@

- `type`: type of monomer (a MonomerType object)

- class attribute `monomer_type` is MonomerType or either of it's subclasses,
- it is used when creating new monomers. It MUST be redefined when subclassing Monomer.
+ class attributes:
+
+ - `monomer_type`: either MonomerType or one of it's subclasses, it is used
+ when creating new monomers. It SHOULD be redefined when subclassing
+ Monomer.
"""
monomer_type = MonomerType

@@ -137,6 +140,7 @@
Any of them may be empty (i.e. hold empty string)

Class attributes:
+
* monomer_type -- type of monomers in sequence, must be redefined when
subclassing
"""
@@ -170,13 +174,9 @@
return cls(monomers, name, description)

class Alignment(dict):
- """ Alignment
+ """Alignment.

- {:[,None,]}
-
- keys are the Sequence objects, values are the lists, which
- contain monomers of those sequences or None for gaps in the
- corresponding sequence of alignment
+ Behaves like a list of Columns.
"""
# _sequences -- list of Sequence objects. Sequences don't contain gaps
# - see sequence.py module
@@ -184,12 +184,14 @@
def __init__(self, *args):
"""overloaded constructor

- Alignment() -> new empty Alignment
- Alignment(sequences, body) -> new Alignment with sequences and
- body initialized from arguments
- Alignment(fasta_file) -> new Alignment, read body and sequences
- from fasta file
+ Alignment()
+ new empty Alignment

+ Alignment(sequences, body)
+ new Alignment with sequences and body initialized from arguments
+
+ Alignment(fasta_file)
+ new Alignment, read body and sequences from fasta file
"""
if len(args)>1:#overloaded constructor
self.sequences=args[0]
@@ -353,11 +355,12 @@
""" returns list of columns of alignment

sequence or sequences:
- if sequence is given, then column is (original_monomer, monomer)
- if sequences is given, then column is (original_monomer, {sequence: monomer})
- if both of them are given, it is an error
+ * if sequence is given, then column is (original_monomer, monomer)
+ * if sequences is given, then column is (original_monomer, {sequence: monomer})
+ * if both of them are given, it is an error
+
original (Sequence type):
- if given, this filters only columns represented by original sequence
+ * if given, this filters only columns represented by original sequence
"""
if sequence and sequences:
raise Exception("Wrong usage. read help")
@@ -393,6 +396,7 @@
Don't change self.sequences -- it may be a link to other block.sequences

How to create a new block:
+
>>> import alignment
>>> import block
>>> proj = alignment.Alignment(open("test.fasta"))
@@ -431,17 +435,19 @@
ac_count=config.ac_count):
""" 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)
- minsize -- min size of each core
- ac_new_atoms -- min part or new atoms in new alternative core
- current GC is compared with each of already selected GCs
- if difference is less then ac_new_atoms, current GC is skipped
+ * max_delta -- threshold of distance spreading
+ * timeout -- Bron-Kerbosh timeout (then fast O(n ln n) algorithm)
+ * minsize -- min size of each core
+ * ac_new_atoms -- min part or new atoms in new alternative core
+ current GC is compared with each of already selected GCs if
+ difference is less then ac_new_atoms, current GC is skipped
difference = part of new atoms in current core
- ac_count -- max number of cores (including main core)
+ * ac_count -- max number of cores (including main core)
-1 means infinity
+
If more than one pdb chain for some sequence provided, consider all of them
cost is calculated as 1 / (delta + 1)
+
delta in [0, +inf) => cost in (0, 1]
"""
nodes = self.positions