Changeset 5fef0d7 for protein.py
- Timestamp:
- 09/02/10 10:25:36 (14 years ago)
- Branches:
- master
- Children:
- 225475c
- Parents:
- 3fbbfbb
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protein.py
r3fbbfbb r5fef0d7 6 6 # 7 7 import sys 8 import numpy as np 8 9 import smmp_p as smmp 9 10 from math import * … … 52 53 53 54 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() 55 56 56 57 def __str__(self): … … 174 175 def residues(self): 175 176 """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])] 177 178 first = smmp.mol_i.irsml1[self.__id]- 1 178 179 last = smmp.mol_i.irsml2[self.__id] - 1 179 return ''.join(seq).split()[first:last]180 return seq[first:last] 180 181 181 182 def id(self):
Note:
See TracChangeset
for help on using the changeset viewer.