Example #1
0
 def append(self, file):
     """Read interaction parameters from a file"""
     self.__param_files.append(file)
     fh = modfile._get_filehandle(file, 'r')
     return _modeller.mod_group_restraints_read(self._modpt,
                                                self.env.libs.modpt,
                                                fh.file_pointer)
Example #2
0
 def write(self, file, model_format='PDB', no_ter=False, extra_data=""):
     """Write selection coordinates to a file"""
     (inds, mdl) = self.__require_indices()
     fh = modfile._get_filehandle(file, 'w')
     return _modeller.mod_model_write(mdl.modpt, mdl.env.libs.modpt, inds,
                                      fh.file_pointer, model_format, no_ter,
                                      False, extra_data)
Example #3
0
 def read(self, file, io=None):
     """Read coordinates from a PDB file"""
     if io is None:
         io = self.aln.env.io
     fh = modfile._get_filehandle(file, 'r')
     return _modeller.mod_alnstructure_read_pdb(
                   fh.file_pointer, self.aln.modpt, self.__num, io.modpt,
                   self.aln.env.libs.modpt)
Example #4
0
 def write(self, file, alignment_format='PIR',
           alignment_features='INDICES CONSERVATION', align_block=0,
           align_alignment=False):
     """Write the alignment to a file"""
     fh = modfile._get_filehandle(file, 'w')
     return _modeller.mod_alignment_write(self.modpt, self.env.libs.modpt,
                                          fh.file_pointer,
                                          alignment_format,
                                          alignment_features, align_block,
                                          align_alignment)
Example #5
0
 def read(self,
          file,
          model_format='PDB',
          model_segment=('FIRST:@', 'LAST:'),
          io=None,
          keep_disulfides=False):
     """Read coordinates from a file"""
     if io is None:
         io = self.env.io
     if isinstance(file, str):
         file = _modeller.mod_pdb_filename_get(file,
                                               io.atom_files_directory)
     fh = modfile._get_filehandle(file, 'r')
     return _modeller.mod_model_read2(self.modpt, io.modpt,
                                      self.env.libs.modpt, fh.file_pointer,
                                      model_format, model_segment,
                                      keep_disulfides)
Example #6
0
 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_one
     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]
     else:
         file = modfile._get_filehandle(file, 'r')
     return func(self.modpt, file.file_pointer, io.modpt,
                 self.env.libs.modpt, remove_gaps, alignment_format,
                 allow_alternates) == 0
Example #7
0
 def write(self, file):
     """Writes topology library to a file"""
     fh = modfile._get_filehandle(file, 'w')
     return _modeller.mod_topology_model_write(self._modpt,
                                               self.__libs.modpt,
                                               fh.file_pointer)
Example #8
0
 def append(self, file):
     """Appends information from a residue topology file"""
     fh = modfile._get_filehandle(file, 'r')
     return _modeller.mod_topology_read(self._modpt, self.__libs.modpt,
                                        fh.file_pointer)
Example #9
0
 def write(self, file):
     """Write currently selected restraints to a file"""
     fh = modfile._get_filehandle(file, 'w')
     return _modeller.mod_restraints_write(self.__mdl.modpt,
                                           fh.file_pointer)
Example #10
0
 def append(self, file):
     """Append restraints from a file, and select them"""
     fh = modfile._get_filehandle(file, 'r')
     return _modeller.mod_restraints_read(self.__mdl.modpt, fh.file_pointer)
Example #11
0
 def write(self, file):
     """Write current coordinates to a PDB file"""
     fh = modfile._get_filehandle(file, 'w')
     return _modeller.mod_alnstructure_write(self.cdpt, self.seqpt,
                                             fh.file_pointer,
                                             self.aln.env.libs.modpt)
Example #12
0
 def __read_libs(self):
     fh = modfile._get_filehandle(self.__restyp_lib_file, 'r')
     _modeller.mod_libraries_read_libs(self.modpt, fh.file_pointer)
Example #13
0
 def write(self, file, model_format='PDB', no_ter=False, extra_data=''):
     """Write coordinates to a file"""
     fh = modfile._get_filehandle(file, 'w')
     return _modeller.mod_model_write(self.modpt, self.env.libs.modpt, (),
                                      fh.file_pointer, model_format, no_ter,
                                      True, extra_data)
Example #14
0
 def append(self, file):
     """Append information from a CHARMM parameter file"""
     fh = modfile._get_filehandle(file, 'r')
     return _modeller.mod_parameters_read(self._modpt, self.__libs.modpt,
                                          fh.file_pointer)
Example #15
0
 def __read_classes(self, file):
     """Read atom classes from a file"""
     self.__class_file = file
     fh = modfile._get_filehandle(file, 'r')
     return _modeller.mod_atom_classes_read(self._modpt, fh.file_pointer)