Réimplémentation du programme DSSP en Python

structure.py 1.1KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. import math
  2. import numpy as np
  3. from geom import *
  4. class Structure:
  5. def __init__(self, res):
  6. self.res = res
  7. class Turn(Structure):
  8. def __init__(self, turn_type, res):
  9. self.turn_type = turn_type
  10. Structure.res = res
  11. class Bridge(Structure):
  12. def __init__(self, bridge_type, res_num, res_partner, indices,
  13. second_bridge_type=None, second_resnum=None,
  14. second_res_partner=None, second_indices=None):
  15. self.bridge_type = bridge_type
  16. self.res_num = res_num
  17. self.res_partner = res_partner
  18. Structure.res = res_num
  19. self.i = indices[0]
  20. self.j = indices[1]
  21. self.second_bridge_type = second_bridge_type
  22. self.second_resnum = second_resnum
  23. self.second_res_partner = second_res_partner
  24. self.second_indices = second_indices
  25. class Helix(Structure):
  26. def __init__(self, residues, res_num, helix_type):
  27. self.residues = residues
  28. self.res_num = res_num
  29. Structure.res = res_num
  30. self.helix_type = helix_type