Changeset 5fef0d7 for protein.py


Ignore:
Timestamp:
09/02/10 10:25:36 (14 years ago)
Author:
Jan Meinke <j.meinke@…>
Branches:
master
Children:
225475c
Parents:
3fbbfbb
Message:

Changed module name from smmp to smmp_p.

Fixed conversion to residue and atom names.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protein.py

    r3fbbfbb r5fef0d7  
    66#
    77import sys
     8import numpy as np
    89import smmp_p as smmp
    910from math import *
     
    5253       
    5354    def name(self):
    54         return ''.join([smmp.atm_c.nmat[i][self.__id] for i in range(0,4)]).strip()
     55        return ''.join(smmp.atm_c.nmat[:,0].reshape([-1,4])[self.__id]).strip()
    5556       
    5657    def __str__(self):
     
    174175    def residues(self):
    175176        """Returns a list of the amino acids in this protein."""
    176         seq = [str(c[0]) for c in smmp.res_c.seq]
     177        seq = [''.join(l) for l in np.array([str(c[0]) for c in smmp.res_c.seq]).reshape([-1, 4])]
    177178        first = smmp.mol_i.irsml1[self.__id]- 1
    178179        last = smmp.mol_i.irsml2[self.__id] - 1
    179         return ''.join(seq).split()[first:last]
     180        return seq[first:last]
    180181       
    181182    def id(self):
Note: See TracChangeset for help on using the changeset viewer.