Esempio n. 1
0
 def get_next_strand (self, sheet_id, strand_id, pdb_labels,
     next_ladder=None) :
   from iotbx.pdb import secondary_structure
   start_i_res = end_i_res = None
   next_ladder_i_start = sys.maxint
   next_ladder_i_end = - sys.maxint
   if (next_ladder is not None) :
     next_ladder_i_start = min(next_ladder.bridges[0].i_res,
                               next_ladder.bridges[-1].i_res)
     next_ladder_i_end = max(next_ladder.bridges[-1].i_res,
                             next_ladder.bridges[0].i_res)
   j_res_start = min(self.bridges[0].j_res, self.bridges[-1].j_res)
   j_res_end = max(self.bridges[-1].j_res, self.bridges[0].j_res)
   start_i_res = min(j_res_start, next_ladder_i_start)
   end_i_res = max(j_res_end, next_ladder_i_end)
   if (start_i_res > end_i_res) :
     out = cStringIO.StringIO()
     self.show(out=out)
     raise RuntimeError("start_i_res(%d) > end_i_res(%d):\n%s" %
       (start_i_res, end_i_res, out.getvalue()))
   start = pdb_labels[start_i_res]
   end = pdb_labels[end_i_res]
   strand = secondary_structure.pdb_strand(
     sheet_id=sheet_id,
     strand_id=strand_id,
     start_resname=start.resname,
     start_chain_id=start.chain_id,
     start_resseq=start.resseq,
     start_icode=start.icode,
     end_resname=end.resname,
     end_chain_id=end.chain_id,
     end_resseq=end.resseq,
     end_icode=end.icode,
     sense=self.direction)
   return strand
Esempio n. 2
0
 def get_next_strand(self, sheet_id, strand_id, pdb_labels,
     next_ladder=None):
   from iotbx.pdb import secondary_structure
   start_i_res = end_i_res = None
   next_ladder_i_start = sys.maxsize
   next_ladder_i_end = - sys.maxsize
   if (next_ladder is not None):
     next_ladder_i_start = min(next_ladder.bridges[0].i_res,
                               next_ladder.bridges[-1].i_res)
     next_ladder_i_end = max(next_ladder.bridges[-1].i_res,
                             next_ladder.bridges[0].i_res)
   j_res_start = min(self.bridges[0].j_res, self.bridges[-1].j_res)
   j_res_end = max(self.bridges[-1].j_res, self.bridges[0].j_res)
   start_i_res = min(j_res_start, next_ladder_i_start)
   end_i_res = max(j_res_end, next_ladder_i_end)
   if (start_i_res > end_i_res):
     out = StringIO()
     self.show(out=out)
     raise RuntimeError("start_i_res(%d) > end_i_res(%d):\n%s" %
       (start_i_res, end_i_res, out.getvalue()))
   start = pdb_labels[start_i_res]
   end = pdb_labels[end_i_res]
   strand = secondary_structure.pdb_strand(
     sheet_id=sheet_id,
     strand_id=strand_id,
     start_resname=start.resname,
     start_chain_id=start.chain_id,
     start_resseq=start.resseq,
     start_icode=start.icode,
     end_resname=end.resname,
     end_chain_id=end.chain_id,
     end_resseq=end.resseq,
     end_icode=end.icode,
     sense=self.direction)
   return strand
Esempio n. 3
0
 def get_initial_strand(self, sheet_id, pdb_labels):
     from iotbx.pdb import secondary_structure
     start_i_res = min(self.bridges[0].i_res, self.bridges[-1].i_res)
     end_i_res = max(self.bridges[0].i_res, self.bridges[-1].i_res)
     start = pdb_labels[start_i_res]
     end = pdb_labels[end_i_res]
     first_strand = secondary_structure.pdb_strand(
         sheet_id=sheet_id,
         strand_id=1,
         start_resname=start.resname,
         start_chain_id=start.chain_id,
         start_resseq=start.resseq,
         start_icode=start.icode,
         end_resname=end.resname,
         end_chain_id=end.chain_id,
         end_resseq=end.resseq,
         end_icode=end.icode,
         sense=0)
     return first_strand
Esempio n. 4
0
 def get_initial_strand (self, sheet_id, pdb_labels) :
   from iotbx.pdb import secondary_structure
   start_i_res = min(self.bridges[0].i_res, self.bridges[-1].i_res)
   end_i_res = max(self.bridges[0].i_res, self.bridges[-1].i_res)
   start = pdb_labels[start_i_res]
   end = pdb_labels[end_i_res]
   first_strand = secondary_structure.pdb_strand(
     sheet_id=sheet_id,
     strand_id=1,
     start_resname=start.resname,
     start_chain_id=start.chain_id,
     start_resseq=start.resseq,
     start_icode=start.icode,
     end_resname=end.resname,
     end_chain_id=end.chain_id,
     end_resseq=end.resseq,
     end_icode=end.icode,
     sense=0)
   return first_strand