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

allpy

changeset 700:bf97a2bc9d08

In homology 'residue' changed to 'monomer' everywhere
author Andrei <aba@belozersky.msu.ru>
date Wed, 06 Jul 2011 18:05:51 +0400
parents 29eccc26343c
children 8ca932b9e951 1ce3b0e42ba5 b71f9c1d1509
files allpy/homology.py
diffstat 1 files changed, 17 insertions(+), 17 deletions(-) [+]
line diff
     1.1 --- a/allpy/homology.py	Wed Jul 06 18:04:58 2011 +0400
     1.2 +++ b/allpy/homology.py	Wed Jul 06 18:05:51 2011 +0400
     1.3 @@ -1,11 +1,11 @@
     1.4 -class  ResidueHomology(object):
     1.5 -    """ Essentially, alignment is a set of residue homology classes
     1.6 -    Object of type ResidueHomology desribes an alignment  in terms of residue homology 
     1.7 -    Currently, identifies of monomers and residue homology classes are used 
     1.8 +class  MonomerHomology(object):
     1.9 +    """ Essentially, alignment is a set of monomer homology classes
    1.10 +    Object of type MonomerHomology desribes an alignment  in terms of monomer homology 
    1.11 +    Currently, identifies of monomers and monomer homology classes are used 
    1.12  
    1.13      Each monomer of any sequence from an alignment must be contained in a homology class
    1.14  
    1.15 -    Homology of nonequal residues of the same sequence is allowed (formally), 
    1.16 +    Homology of nonequal monomers of the same sequence is allowed (formally), 
    1.17          but there is no implemented methods to deal with 
    1.18  
    1.19      DATA:
    1.20 @@ -19,8 +19,8 @@
    1.21  
    1.22      METHODS:
    1.23         + .read(file_name) 
    1.24 -       + .wright_monomer(file,monomer_id,residue_homology_class_id)
    1.25 -       + .write_class(file,list_of_monomer_ids,residue_homology_class_id)
    1.26 +       + .wright_monomer(file,monomer_id,monomer_homology_class_id)
    1.27 +       + .write_class(file,list_of_monomer_ids,monomer_homology_class_id)
    1.28         + .write_block(file, block)
    1.29         + .compare_with(class)
    1.30      """
    1.31 @@ -34,7 +34,7 @@
    1.32  
    1.33      def read(self, file_name, columns = False):
    1.34          """
    1.35 -        Residue_homology file format is as follows
    1.36 +        Monomer_homology file format is as follows
    1.37             One line corresponds to one monomer. 
    1.38                 Thus, number of lines with information is equal to the sum of all sequences lengths
    1.39             Three obligatory fields are in each line:
    1.40 @@ -137,21 +137,21 @@
    1.41  
    1.42      
    1.43      def compare_with(self,other): 
    1.44 -        """Compares two residue homology classes made on the same set of sequences: self and other 
    1.45 +        """Compares two monomer homology classes made on the same set of sequences: self and other 
    1.46          Both sets of classes MUST contain isomorfic sets of monomer_ids 
    1.47         
    1.48          RETURN two weighted averege number of mistakes: other vs self and self vs other
    1.49              Number of mistakes other vs self in a homology class of self is
    1.50                  number of classes of other intersecting with the class of self minus one
    1.51                  In other words, one mistake of other is splitting a class of self 
    1.52 -                    (believed to be true residue homology class) into two classes
    1.53 +                    (believed to be true monomer homology class) into two classes
    1.54             Wieght of a class of self is size of the class divided by total number of monomeres.
    1.55         
    1.56          Different mesures and outputs may be implemented later.
    1.57          """
    1.58  
    1.59 -        mistakes_two_vs_one = ResidueHomology.two_vs_one(self, other) # mistakes are splitting self by intersections with other
    1.60 -        mistakes_one_vs_two = ResidueHomology.two_vs_one(other, self) # mistakes are splitting other by intersections with self
    1.61 +        mistakes_two_vs_one = MonomerHomology.two_vs_one(self, other) # mistakes are splitting self by intersections with other
    1.62 +        mistakes_one_vs_two = MonomerHomology.two_vs_one(other, self) # mistakes are splitting other by intersections with self
    1.63  
    1.64          return (mistakes_two_vs_one, mistakes_one_vs_two)
    1.65  
    1.66 @@ -160,7 +160,7 @@
    1.67          """ Write a line "class_id sequence_id  monome number \n"  into file
    1.68          """
    1.69          if len(monomer_id) != 2:
    1.70 -            raise Exception("wrong parameters given for Residue_homology.write_monomer: len(monomer_id) is not 2!") 
    1.71 +            raise Exception("wrong parameters given for Monomer_homology.write_monomer: len(monomer_id) is not 2!") 
    1.72              exit()
    1.73          try:
    1.74              if column_number:
    1.75 @@ -178,13 +178,13 @@
    1.76          """ Writes list of monomer_ids forming one homology_class
    1.77          """
    1.78          for monomer_id in monomer_ids:
    1.79 -            ResidueHomology.write_monomer(file,monomer_id,class_id, column_number = column_number)
    1.80 +            MonomerHomology.write_monomer(file,monomer_id,class_id, column_number = column_number)
    1.81       
    1.82      #######################3#
    1.83      def write_block(self,file,block,markedup = False):    
    1.84          """ Writes each block column into as one homology class
    1.85          WARRNINGS: 
    1.86 -            (1) method works in object of class ResidueHomology
    1.87 +            (1) method works in object of class MonomerHomology
    1.88              (2) all sequences MUST BE MARKED UP with resudue NUMBERS!
    1.89              (3) automatic class ids (actually, numbers) are assigned to homology classes
    1.90              (4) if markedup, then block MUST be marked up by column numbers 
    1.91 @@ -210,7 +210,7 @@
    1.92                      except:
    1.93                          raise Exception("Monomer has no number! Sequences must be marked up by numbers before .writ_block") 
    1.94                          exit()
    1.95 -                    ResidueHomology.write_monomer(file,monomer_id,self.next_class_id, column_number = column_number)
    1.96 +                    MonomerHomology.write_monomer(file,monomer_id,self.next_class_id, column_number = column_number)
    1.97  
    1.98              self.next_class_id +=1
    1.99  
   1.100 @@ -231,7 +231,7 @@
   1.101  
   1.102  
   1.103      def highest_blocks(self):
   1.104 -        """ Makes blocks of maximal possible heights from residue homology classes
   1.105 +        """ Makes blocks of maximal possible heights from monomer homology classes
   1.106          block = set of homology classes with the same set of sequences
   1.107          block MUST BE marked up by column numbers
   1.108