Документ взят из кэша поисковой машины. Адрес оригинального документа : http://kodomo.fbb.msu.ru/hg/allpy/diff/4d610c277281/allpy/base.py
Дата изменения: Unknown
Дата индексирования: Sun Feb 3 20:16:20 2013
Кодировка:
allpy: allpy/base.py diff

allpy

diff allpy/base.py @ 308:4d610c277281

Moved PDB-related stuff from base Block to allpy.pdb.Block
author Daniil Alexeyevsky <me.dendik@gmail.com>
date Thu, 16 Dec 2010 20:45:57 +0300
parents 237deca17963
children 0c3c1856113a
line diff
     1.1 --- a/allpy/base.py	Thu Dec 16 20:42:42 2010 +0300
     1.2 +++ b/allpy/base.py	Thu Dec 16 20:45:57 2010 +0300
     1.3 @@ -1,13 +1,8 @@
     1.4  import sys
     1.5 -import os
     1.6 -import os.path
     1.7 -from tempfile import NamedTemporaryFile
     1.8 -import urllib2
     1.9  
    1.10  import config
    1.11  import fasta
    1.12  from graph import Graph
    1.13 -from Bio.PDB.DSSP import make_dssp_dict
    1.14  import data.codes
    1.15  
    1.16  default_gaps = set((".", "-", "~"))
    1.17 @@ -459,45 +454,4 @@
    1.18          alignment_sequence = self.alignment.body[sequence]
    1.19          return (alignment_sequence[i] for i in self.positions)
    1.20  
    1.21 -    def ca_atoms(self, sequence, pdb_chain):
    1.22 -        """ Iterates Ca-atom of monomers of this sequence from this block  """
    1.23 -        return (sequence.pdb_residues[pdb_chain][monomer] for monomer in self.monomers())
    1.24 -
    1.25 -    def sequences_chains(self):
    1.26 -        """ Iterates pairs (sequence, chain) """
    1.27 -        for sequence in self.alignment.sequences:
    1.28 -            if sequence in self.sequences:
    1.29 -                for chain in sequence.pdb_chains:
    1.30 -                    yield (sequence, chain)
    1.31 -
    1.32 -    def superimpose(self):
    1.33 -        """ Superimpose all pdb_chains in this block """
    1.34 -        sequences_chains = list(self.sequences_chains())
    1.35 -        if len(sequences_chains) >= 1:
    1.36 -            sup = Superimposer()
    1.37 -            fixed_sequence, fixed_chain = sequences_chains.pop()
    1.38 -            fixed_atoms = self.ca_atoms(fixed_sequence, fixed_chain)
    1.39 -            for sequence, chain in sequences_chains:
    1.40 -                moving_atoms =  self.ca_atoms(sequence, chain)
    1.41 -                sup.set_atoms(fixed_atoms, moving_atoms)
    1.42 -                # Apply rotation/translation to the moving atoms
    1.43 -                sup.apply(moving_atoms)
    1.44 -
    1.45 -    def pdb_save(self, out_file):
    1.46 -        """ Save all sequences
    1.47 -
    1.48 -        Returns {(sequence, chain): CHAIN}
    1.49 -        CHAIN is chain letter in new file
    1.50 -        """
    1.51 -        tmp_file = NamedTemporaryFile(delete=False)
    1.52 -        tmp_file.close()
    1.53 -
    1.54 -        for sequence, chain in self.sequences_chains():
    1.55 -            sequence.pdb_save(tmp_file.name, chain)
    1.56 -            # TODO: read from tmp_file.name
    1.57 -            # change CHAIN
    1.58 -            # add to out_file
    1.59 -
    1.60 -        os.unlink(NamedTemporaryFile)
    1.61 -
    1.62  # vim: set ts=4 sts=4 sw=4 et: