def __getitem__(self, indx):
     ret = modutil.handle_seq_indx(self, indx, self.mdl._indxatm,
                                   (self.offset, self.length, self.suffix))
     if isinstance(ret, int):
         return self.mdl._atom_class(self.mdl, ret + self.offset)
     else:
         return [self[ind] for ind in ret]
Beispiel #2
0
 def __getitem__(self, indx):
     ret = modutil.handle_seq_indx(self, indx,
                                   _modeller.mod_alignment_find_code,
                                   (self.modpt,))
     if isinstance(ret, int):
         if _modeller.mod_alnsequence_has_structure(self.modpt, ret):
             return alnstructure.Structure(self, ret)
         else:
             return alnsequence.Sequence(self, ret)
     else:
         return [self[ind] for ind in ret]
Beispiel #3
0
 def __getitem__(self, indx):
     ret = modutil.handle_seq_indx(self, indx)
     if isinstance(ret, int):
         return Residue(self.seq, ret)
     else:
         return [self[ind] for ind in ret]
Beispiel #4
0
 def __delitem__(self, indx):
     ret = modutil.handle_seq_indx(self, indx,
                                   _modeller.mod_alignment_find_code,
                                   (self.modpt,))
     _modeller.mod_alnsequence_del(self.modpt, ret)
Beispiel #5
0
 def __getitem__(self, indx):
     ret = modutil.handle_seq_indx(self, indx, self.seq._indxseg, (0, None))
     if isinstance(ret, int):
         return self.seq._chain_class(self.seq, ret)
     else:
         return [self[ind] for ind in ret]
Beispiel #6
0
 def __getitem__(self, indx):
     ret = modutil.handle_seq_indx(self, indx)
     if isinstance(ret, int):
         return self.seq._residue_class(self.seq, ret + self.offset)
     else:
         return [self[ind] for ind in ret]
Beispiel #7
0
 def _lookup_index(self, indx, require_inrange=True):
     return modutil.handle_seq_indx(self,
                                    indx,
                                    require_inrange=require_inrange)
Beispiel #8
0
 def _lookup_index(self, indx, require_inrange=True):
     return handle_seq_indx(self,
                            indx,
                            self.__lookup_atom,
                            require_inrange=require_inrange)