Exemple #1
0
 def delete_restraint(self):
     atom_names = self.vars['atom_ids']
     mdl = self.get_mdl(1)
     cd = _modeller.mod_model_cd_get(mdl)
     seq = _modeller.mod_model_seq_get(mdl)
     atom_ids = [_modeller.mod_coordinates_find_atom(cd, seq, a) \
                 for a in atom_names]
     if 0 in atom_ids:
         log.warning("delete_restraint",
                     "One or more atoms absent from MODEL:  " \
                     + " ".join(atom_names))
     else:
         AutoCommands.unpick_restraints(self, atom_ids=atom_ids)
Exemple #2
0
    def __set_atfil(self, val):
        if isinstance(val, tuple):
            self.__atom_files_directory = list(val)
        elif isinstance(val, list):
            self.__atom_files_directory = val
        elif isinstance(val, str):
            spl = val.split(':')
            log.warning("io_data",
"""Setting io.atom_files_directory to a colon-delimited string is
              deprecated, as it is not robust on Windows systems. Set it to
              a list of directories instead. For example:
              env.io.atom_files_directory = """ + str(spl))
            self.__atom_files_directory = spl
        else:
            raise TypeError("atom_files_directory should be a list")
 def read_one(self, file, remove_gaps=False, alignment_format='PIR',
              io=None, allow_alternates=False):
     """Read sequences from the file, one by one. Return False when no more
        can be read."""
     if io is None:
         io = self.env.io
     self.clear()
     func = _modeller.mod_alignment_read_one2
     if isinstance(file, str):
         # Cache one file handle per alignment:
         if self.__read_one_pair is None or self.__read_one_pair[0] != file:
             log.warning("read_one",
                         "Filename arguments to read_one() are " + \
                         "deprecated.\nPlease use a handle " + \
                         "(modfile.File object) instead.")
             self.__read_one_pair = (file, modfile.File(file, 'r'))
         file = self.__read_one_pair[1]
     return func(self.modpt, file.file_pointer, io.modpt,
                 self.env.libs.modpt, remove_gaps, alignment_format,
                 allow_alternates) == 0