Exemplo n.º 1
0
    def fetchPDB( self, id ):

        try:
            h = self.getLocalPDBHandle( id )
        except:
            h = self.getRemotePDBHandle( id )

        fname = tempfile.mktemp( '.pdb', 'ncbiparser_' )

        lines, infos = self.parsePdbFromHandle( h, first_model_only=1 )

        ## close if it is a handle
        try: h.close()
        except:
            pass

        f = open( fname, 'w', 1 )
        f.writelines( lines )
        f.close()

        m = B.PDBModel( fname )
        m.disconnect()
        m.pdbCode = id
        m.info.update( infos )

        T.tryRemove( fname )

        return m
Exemplo n.º 2
0
    def fetchPDB(self, id):

        try:
            h = self.getLocalPDBHandle(id)
        except:
            h = self.getRemotePDBHandle(id)

        fname = tempfile.mktemp('.pdb', 'ncbiparser_')

        lines, infos = self.parsePdbFromHandle(h, first_model_only=1)

        ## close if it is a handle
        try:
            h.close()
        except:
            pass

        f = open(fname, 'w', 1)
        f.writelines(lines)
        f.close()

        m = B.PDBModel(fname)
        m.disconnect()
        m.pdbCode = id
        m.info.update(infos)

        T.tryRemove(fname)

        return m
Exemplo n.º 3
0
    def load_locked(self, fname):
        """
        wait with unpickling until another Entropist has finished.

        :param fname: file name
        :type  fname: str

        :return: trajectroy
        :rtype: Trajectroy
        """
        flock = fname + '__locked'

        while os.path.exists(flock):
            if self.verbose: self.log.write('~')
            time.sleep(random.random() * 10)
        if self.verbose: self.log.add('')

        try:
            f = open(flock, 'w')
            f.write('1')
            f.close()

            r = t.load(fname)

        finally:
            t.tryRemove(flock)

        return r
Exemplo n.º 4
0
    def load_locked( self, fname ):
        """
        wait with unpickling until another Entropist has finished.

        :param fname: file name
        :type  fname: str

        :return: trajectroy
        :rtype: Trajectroy
        """
        flock = fname + '__locked'

        while os.path.exists( flock ):
            if self.verbose: self.log.write('~')
            time.sleep( random.random() * 10 )
        if self.verbose: self.log.add('')

        try:
            f = open( flock, 'w' )
            f.write('1')
            f.close()

            r = t.load(fname)

        finally:
            t.tryRemove( flock )

        return r
Exemplo n.º 5
0
    def cleanup( self ):
        """
        Tidy up the mess you created.
        """
        Executor.cleanup( self )

        if not self.debug:
            T.tryRemove( self.f_pdb )
Exemplo n.º 6
0
 def cleanup(self):
     """
     Tidy up the mess you created.
     Does nothing. No temporary files are created.
     """
     Executor.cleanup(self)
     if not self.debug:
         T.tryRemove(self.f_pdbin)
         T.tryRemove(self.f_out)
Exemplo n.º 7
0
    def deletePdbs(self):
        """
        Deletes the pdb-files in the list from disc
        """
        for key in self.dic.keys():

            for model in self.dic[ key ]:
                ## only remove files created by PymolInput!
                if model.temporary:
                    T.tryRemove(model.fname)
Exemplo n.º 8
0
def clean_alignment(path, cache):
    """
    Deletes the files generated by Mafft when called using build_alignment
    Args:
        path (str): The file path to the alignment file
        cache (Boolean): If true, the alignment file is kept. If false, the alignment
        file is also deleted
    """
    filename = os.path.basename(path)
    filename = str(filename.split('.')[0])

    if not cache:
        t.tryRemove(os.getcwd() + os.sep + '%s.aln' % (filename))
    t.tryRemove(os.getcwd() + os.sep + '%s.dnd' % (filename))
Exemplo n.º 9
0
    def cleanup(self):
        """
        Clean up after external program has finished (failed or not).
        
        Note: a temporary folder, if it has been created, is only deleted if
        it is empty.
        
        Override, but call in child method! Preferably, Executor.cleanup should
        be called at the end of the overriding method so that the now empty
        working directory can also be removed.
        """
        if not self.keep_out and not self.debug and self.f_out:
            t.tryRemove(self.f_out)

        if not self.keep_inp and not self.debug:
            t.tryRemove(self.f_in)

        if self.f_err and not self.debug:
            t.tryRemove(self.f_err)

        if not self.keep_tempdir and not self.debug:
            if self.verbose:
                if os.listdir(self.tempdir):
                    self.log.writeln('Removing non-empty temporary folder %s'\
                                     % self.tempdir )
                else:
                    self.log.writeln( 'Removing temporary folder %s'\
                                      % self.tempdir )
            t.tryRemove(self.tempdir, tree=True)
Exemplo n.º 10
0
    def cleanup( self ):
        """
        Clean up after external program has finished (failed or not).
        
        Note: a temporary folder, if it has been created, is only deleted if
        it is empty.
        
        Override, but call in child method! Preferably, Executor.cleanup should
        be called at the end of the overriding method so that the now empty
        working directory can also be removed.
        """
        if not self.keep_out and not self.debug and self.f_out:
            t.tryRemove( self.f_out )

        if not self.keep_inp and not self.debug:
            t.tryRemove( self.f_in )

        if self.f_err and not self.debug:
            t.tryRemove( self.f_err )
        
        if not self.keep_tempdir and not self.debug:
            if self.verbose:
                if os.listdir( self.tempdir ):  
                    self.log.writeln('Removing non-empty temporary folder %s'\
                                     % self.tempdir )
                else:
                    self.log.writeln( 'Removing temporary folder %s'\
                                      % self.tempdir )
            t.tryRemove( self.tempdir, tree=True )
Exemplo n.º 11
0
    def cleanup(self):
        """
        Tidy up the mess you created.
        """
        Executor.cleanup(self)

        if not self.debug:
            T.tryRemove(self.f_pdb, verbose=self.verbose)
            T.tryRemove(self.f_out_name, verbose=self.verbose)
            T.tryRemove(os.path.join(self.cwd, 'result.txt'),
                        verbose=self.verbose)
            T.tryRemove(self.f_pdb[:-4] + '_residue.txt', verbose=self.verbose)
Exemplo n.º 12
0
    def cleanup( self ):
        """
        Tidy up the mess you created.
        """
        Executor.cleanup( self )

        if not self.debug:
            T.tryRemove( self.f_pdb, verbose=self.verbose )
            T.tryRemove( self.f_out_name, verbose=self.verbose )
            T.tryRemove( os.path.join(self.cwd, 'result.txt'), 
                         verbose=self.verbose )
            T.tryRemove( self.f_pdb[:-4]+'_residue.txt', verbose=self.verbose)
Exemplo n.º 13
0
    def cleanup( self ):
        """
        Remove temporary files.
        """
        Xplorer.cleanup( self )

        if not self.debug:

            t.tryRemove( self.rec_in )
            t.tryRemove( self.lig_in )

            t.tryRemove( self.rec_out )
            t.tryRemove( self.lig_out )
Exemplo n.º 14
0
    def cleanup( self ):
        Executor.cleanup( self )

        if not self.debug:
            T.tryRemove( self.prosaPdbFile )
            T.tryRemove( self.f_in)
            T.tryRemove( self.prosaOutput + '.ana' )
Exemplo n.º 15
0
 def close(self):
     """
     Deletes the output files of rate4site- the alignment tree and the score
     sheet.
     """
     t.tryRemove(self.cwd + os.sep + 'TheTree.txt')
     t.tryRemove(self.cwd + os.sep + '%s.res' % (self.dir_name))
     t.tryRemove(self.tempdir, tree=True)
     self.has_run = False
Exemplo n.º 16
0
 def cleanup( self ):
     """
     Tidy up the mess you created.
     Does nothing. No temporary files are created.
     """        
     Executor.cleanup( self )
     if not self.debug:
         T.tryRemove( self.f_pdbin )
         T.tryRemove( self.f_pdbref)
         T.tryRemove( self.f_matrix )
Exemplo n.º 17
0
 def cleanup(self):
     """
     Overwrites Executor method. Cleans up files created during program execution.
     """
     t.tryRemove(self.cwd + os.sep + 'r4s.res')
     t.tryRemove(self.cwd + os.sep + 'r4sOrig.res')
     super().cleanup()
     if not self.cache:
         self.close()
         t.tryRemove(self.cwd + os.sep + self.dir_name, tree=True)
Exemplo n.º 18
0
    def cleanup(self):
        """
        Remove temporary files.
        """
        AmberCrdEntropist.cleanup(self)

        if not self.debug:
            t.tryRemove(self.parmcrd)

            if not self.keep_crd:
                t.tryRemove(self.f_crd)
            if not self.keep_parm:
                t.tryRemove(self.f_parm)
Exemplo n.º 19
0
    def cleanup( self ):
        """
        Remove temporary files.
        """
        AmberCrdEntropist.cleanup( self )

        if not self.debug:
            t.tryRemove( self.parmcrd )

            if not self.keep_crd:
                t.tryRemove( self.f_crd )
            if not self.keep_parm:
                t.tryRemove( self.f_parm )
Exemplo n.º 20
0
 def cleanUp(self):
     import biskit.tools as T
     T.tryRemove( self.fout )
Exemplo n.º 21
0
 def cleanUp(self):
     t.tryRemove(self.fout)
Exemplo n.º 22
0
Arquivo: PDB.py Projeto: graik/biskit
 def cleanUp(self):
     import biskit.tools as T
     T.tryRemove(self.f_pdbcopy)
Exemplo n.º 23
0
 def cleanUp(self):
     t.tryRemove( self.f_pfb )
     t.tryRemove( self.f_crd )
Exemplo n.º 24
0
 def cleanUp(self):
     import biskit.tools as T
     T.tryRemove(self.fout)
Exemplo n.º 25
0
 def cleanUp(self):
     t.tryRemove(self.out_folder, tree=1)
Exemplo n.º 26
0
 def cleanUp(self):
     T.tryRemove( self.dir_out, tree=1 )
Exemplo n.º 27
0
    def parmMirror( self, f_out, f_out_crd=None, fmod=['frcmod.ionsjc_tip3p'], 
                    fprep=[], **kw ):
        """
        Create a parm7 file whose atom content (and order) exactly mirrors
        the given PDBModel. This requires two leap runs. First we get a
        temporary topology, then we identify all atoms added by leap and
        build a final topology where these atoms are deleted.
        This parm is hence NOT suited for simulations but can be used to parse
        e.g. a trajectory or PDB into ptraj.

        :param f_out: target parm file
        :type  f_out: str
        :param f_out_crd: target crd file (default: f_out but ending .crd)
        :type  f_out_crd: str
        :param fmod : list of amber Mod files (loaded with loadAmberParams)
        :type  fmod : [str]
        :param fmod : list of amber Prep files (loaded with loadAmberPrep)
        :type  fmod : [str]
        """
        f_out = t.absfile( f_out )
        f_out_crd = t.absfile( f_out_crd ) or t.stripSuffix( f_out ) + '.crd'

        ## if there are hydrogens, recast them to standard amber names
        aatm = 'HA' in self.m.atomNames() ## 'HB2' in self.m.atomNames()

        ## First leap round ##
        m_ref = self.m.clone()
        m_ref.xplor2amber( aatm=aatm, parm10=True )
        tmp_in = tempfile.mktemp( 'leap_in0.pdb' )
        m_ref.writePdb( tmp_in, ter=3 )

        tmp_parm = tempfile.mktemp( '_parm0' )
        tmp_crd  = tempfile.mktemp( '_crd0' )

        leap_mod = self.__fLines( 'm = loadAmberParams %s\n', fmod )
        leap_prep= self.__fLines( 'loadAmberPrep %s\n', fprep )

        self.__runLeap( self.script_mirror_pdb,
                        leaprc=self.leaprc, fmod=leap_mod, fprep=leap_prep,
                        in_pdb=tmp_in, out_parm=tmp_parm, out_crd=tmp_crd,
                        delete_atoms='' )

        tmp_pdb = self.parm2pdb( tmp_parm, tmp_crd,
                                 tempfile.mktemp( 'leap_out.pdb' ), aatm=aatm )

        if not self.debug:
            t.tryRemove( tmp_parm )
            t.tryRemove( tmp_crd )
            t.tryRemove( tmp_in )

        ## load model with missing atoms added by leap
        m_leap = PDBModel( tmp_pdb  )

        ## compare atom content
        iLeap, iRef = m_leap.compareAtoms( m_ref )

        ## check that ref model doesn't need any change
        if iRef != list(range( len( m_ref ))):
            uLeap, uRef = m_leap.unequalAtoms( m_ref, iLeap, iRef )
            atms = m_ref.reportAtoms( uRef, n=6 )
            raise AmberError("Cannot create exact mirror of %s.\n" % tmp_in +\
                  "Leap has renamed/deleted original atoms in %s:\n"% tmp_pdb+\
                  atms)

        ## indices of atoms that were added by leap
        delStr = self.__deleteAtoms( m_leap,
                                     self.__inverseIndices( m_leap, iLeap ) )

        ## Second leap round ##
        self.__runLeap( self.script_mirror_pdb, leaprc=self.leaprc,
                        in_pdb=tmp_pdb, fmod=leap_mod, fprep=leap_prep,
                        out_parm=f_out, out_crd=f_out_crd,
                        delete_atoms=delStr )

        if not self.debug:
            t.tryRemove( tmp_pdb )
Exemplo n.º 28
0
    def parmSolvated( self, f_out, f_out_crd=None, f_out_pdb=None,
                      hetatm=0, norun=0,
                      cap=0, capN=[], capC=[],
                      fmod=['frcmod.ionsjc_tip3p'], fprep=[],
                      box=10.0, center=True, **kw ):
        """
        :param f_out: target file for parm (topology)
        :type  f_out: str
        :param f_out_crd: target file for crd (coordinates)
                          (default:|f_out_base|.crd)
        :type  f_out_crd: str
        :param f_out_pdb: target file for pdb (default:|f_out_base|.pdb)
        :type  f_out_pdb: str
        :param hetatm: keep hetero atoms (default: 0)
        :type  hetatm: 1|0
        :param cap: put ACE and NME capping residue on chain breaks 
                    (default: 0)
        :type  cap: 1|0
        :param capN: indices of chains that should get ACE cap (default: [])
        :type  capN: [int]
        :param capC: indices of chains that should get NME cap (default: [])
        :type  capC: [int]
        :param box: minimal distance of solute from box edge (default: 10.0)
        :type  box: float
        :param center: re-center coordinates (default: True)
        :type  center: bool
        :param fmod: list of files with amber parameter modifications
                     to be loaded into leap with loadAmberParams
                    (default:['frcmod.ionsjc_tip3p'] ... mod file needed for 
                    default Amber ff10 ions -- topology saving will fail if this 
                    one is missing)
        :type  fmod: [str]
        :param fprep: list of files with amber residue definitions
                    (to be loaded into leap with loadAmberPrep) (default: [])
        :type  fprep: [str]
        :param kw: additional key=value pairs for leap input template
        :type  kw: key=value

        :raise IOError:
        """
        f_out = t.absfile( f_out )
        f_out_crd = t.absfile( f_out_crd ) or t.stripSuffix( f_out ) + '.crd'
        f_out_pdb = t.absfile( f_out_pdb ) or t.stripSuffix( f_out ) +\
                    '_leap.pdb'

        ## removed: (bugfix 3434136)
        #fmod  = [ t.absfile( f ) for f in t.toList( fmod )  ]
        #fprep = [ t.absfile( f ) for f in t.toList( fprep ) ]

        try:
            if self.verbose: self.log.add( '\nCleaning PDB file for Amber:' )
            m = self.leapModel( hetatm=hetatm, center=center )

            if cap:
                end_broken = m.atom2chainIndices( m.chainBreaks() )
                capC = MU.union( capC, end_broken )
                capN = MU.union( capN, N0.array( end_broken ) + 1 )

            for i in capN:
                if self.verbose:
                    self.log.add( 'Adding ACE cap to chain %i' % i )
                m = self.capACE( m, i )

            for i in capC:
                if self.verbose:
                    self.log.add( 'Adding NME cap to chain %i' % i )
                m = self.capNME( m, i )

            m.renumberResidues( addChainId=1 )  ## again, to accomodate capping

            template = open( self.leap_template ).read()

            leap_mod = self.__fLines( 'm = loadAmberParams %s\n', fmod )
            leap_prep= self.__fLines( 'loadAmberPrep %s\n', fprep )

            ss = self.__ssBonds( m, cutoff=4. )
            self.__cys2cyx( m, ss )
            leap_ss  = self.__fLines( self.ss_bond, ss )
            if self.verbose:
                self.log.add('Found %i disulfide bonds: %s' % (len(ss),str(ss)))

            if self.verbose:
                self.log.add( 'writing cleaned PDB to %s'  % self.leap_pdb )
            m.writePdb( self.leap_pdb, ter=3 )

            self.__runLeap( template, in_pdb=self.leap_pdb,
                            out_parm=f_out, out_crd=f_out_crd,
                            ss_bonds=leap_ss, fmod=leap_mod,
                            fprep=leap_prep, norun=norun,
                            box=box, **kw )

            if not norun:
                parm_pdb = self.parm2pdb( f_out, f_out_crd, f_out_pdb )

            if not self.keep_leap_pdb and not self.debug:
                t.tryRemove( self.leap_pdb )

        except IOError as why:
            raise IOError(why)
Exemplo n.º 29
0
 def cleanUp(self):
     import biskit.tools as T
     T.tryRemove(self.f_pdbcopy)
Exemplo n.º 30
0
 def cleanup(self):
     if not self.debug:
         T.tryRemove( self.foutName )
         self.deletePdbs()
 
     Executor.cleanup( self )
Exemplo n.º 31
0
 def cleanUp(self):
     T.tryRemove( self.f_out )
Exemplo n.º 32
0
 def cleanUp(self):
     if T.tryRemove(self.f_out) and self.local:
         print('log file removed.')
Exemplo n.º 33
0
 def cleanUp(self):
     if not self.DEBUG:
         T.tryRemove(self.fcrg)
         T.tryRemove(self.fmap)
Exemplo n.º 34
0
    def parmMirror( self, f_out, f_out_crd=None, fmod=['frcmod.ionsjc_tip3p'], 
                    fprep=[], **kw ):
        """
        Create a parm7 file whose atom content (and order) exactly mirrors
        the given PDBModel. This requires two leap runs. First we get a
        temporary topology, then we identify all atoms added by leap and
        build a final topology where these atoms are deleted.
        This parm is hence NOT suited for simulations but can be used to parse
        e.g. a trajectory or PDB into ptraj.

        :param f_out: target parm file
        :type  f_out: str
        :param f_out_crd: target crd file (default: f_out but ending .crd)
        :type  f_out_crd: str
        :param fmod : list of amber Mod files (loaded with loadAmberParams)
        :type  fmod : [str]
        :param fmod : list of amber Prep files (loaded with loadAmberPrep)
        :type  fmod : [str]
        """
        f_out = t.absfile( f_out )
        f_out_crd = t.absfile( f_out_crd ) or t.stripSuffix( f_out ) + '.crd'

        ## if there are hydrogens, recast them to standard amber names
        aatm = 'HA' in self.m.atomNames() ## 'HB2' in self.m.atomNames()

        ## First leap round ##
        m_ref = self.m.clone()
        m_ref.xplor2amber( aatm=aatm, parm10=True )
        tmp_in = tempfile.mktemp( 'leap_in0.pdb' )
        m_ref.writePdb( tmp_in, ter=3 )

        tmp_parm = tempfile.mktemp( '_parm0' )
        tmp_crd  = tempfile.mktemp( '_crd0' )

        leap_mod = self.__fLines( 'm = loadAmberParams %s\n', fmod )
        leap_prep= self.__fLines( 'loadAmberPrep %s\n', fprep )

        self.__runLeap( self.script_mirror_pdb,
                        leaprc=self.leaprc, fmod=leap_mod, fprep=leap_prep,
                        in_pdb=tmp_in, out_parm=tmp_parm, out_crd=tmp_crd,
                        delete_atoms='' )

        tmp_pdb = self.parm2pdb( tmp_parm, tmp_crd,
                                 tempfile.mktemp( 'leap_out.pdb' ), aatm=aatm )

        if not self.debug:
            t.tryRemove( tmp_parm )
            t.tryRemove( tmp_crd )
            t.tryRemove( tmp_in )

        ## load model with missing atoms added by leap
        m_leap = PDBModel( tmp_pdb  )

        ## compare atom content
        iLeap, iRef = m_leap.compareAtoms( m_ref )

        ## check that ref model doesn't need any change
        if iRef != list(range( len( m_ref ))):
            uLeap, uRef = m_leap.unequalAtoms( m_ref, iLeap, iRef )
            atms = m_ref.reportAtoms( uRef, n=6 )
            raise AmberError("Cannot create exact mirror of %s.\n" % tmp_in +\
                  "Leap has renamed/deleted original atoms in %s:\n"% tmp_pdb+\
                  atms)

        ## indices of atoms that were added by leap
        delStr = self.__deleteAtoms( m_leap,
                                     self.__inverseIndices( m_leap, iLeap ) )

        ## Second leap round ##
        self.__runLeap( self.script_mirror_pdb, leaprc=self.leaprc,
                        in_pdb=tmp_pdb, fmod=leap_mod, fprep=leap_prep,
                        out_parm=f_out, out_crd=f_out_crd,
                        delete_atoms=delStr )

        if not self.debug:
            t.tryRemove( tmp_pdb )
Exemplo n.º 35
0
 def cleanUp(self):
     T.tryRemove(self.dir_out, tree=1)
Exemplo n.º 36
0
 def cleanUp(self):
     if not self.DEBUG:
         T.tryRemove( self.dryparm )
         T.tryRemove( self.drycrd )
         T.tryRemove( self.drypdb )
         T.tryRemove( self.wetparm )
         T.tryRemove( self.wetcrd )
         T.tryRemove( self.wetpdb )
         T.tryRemove( self.leapout )
Exemplo n.º 37
0
    def parmSolvated( self, f_out, f_out_crd=None, f_out_pdb=None,
                      hetatm=0, norun=0,
                      cap=0, capN=[], capC=[],
                      fmod=['frcmod.ionsjc_tip3p'], fprep=[],
                      box=10.0, center=True, **kw ):
        """
        :param f_out: target file for parm (topology)
        :type  f_out: str
        :param f_out_crd: target file for crd (coordinates)
                          (default:|f_out_base|.crd)
        :type  f_out_crd: str
        :param f_out_pdb: target file for pdb (default:|f_out_base|.pdb)
        :type  f_out_pdb: str
        :param hetatm: keep hetero atoms (default: 0)
        :type  hetatm: 1|0
        :param cap: put ACE and NME capping residue on chain breaks 
                    (default: 0)
        :type  cap: 1|0
        :param capN: indices of chains that should get ACE cap (default: [])
        :type  capN: [int]
        :param capC: indices of chains that should get NME cap (default: [])
        :type  capC: [int]
        :param box: minimal distance of solute from box edge (default: 10.0)
        :type  box: float
        :param center: re-center coordinates (default: True)
        :type  center: bool
        :param fmod: list of files with amber parameter modifications
                     to be loaded into leap with loadAmberParams
                    (default:['frcmod.ionsjc_tip3p'] ... mod file needed for 
                    default Amber ff10 ions -- topology saving will fail if this 
                    one is missing)
        :type  fmod: [str]
        :param fprep: list of files with amber residue definitions
                    (to be loaded into leap with loadAmberPrep) (default: [])
        :type  fprep: [str]
        :param kw: additional key=value pairs for leap input template
        :type  kw: key=value

        :raise IOError:
        """
        f_out = t.absfile( f_out )
        f_out_crd = t.absfile( f_out_crd ) or t.stripSuffix( f_out ) + '.crd'
        f_out_pdb = t.absfile( f_out_pdb ) or t.stripSuffix( f_out ) +\
                    '_leap.pdb'

        ## removed: (bugfix 3434136)
        #fmod  = [ t.absfile( f ) for f in t.toList( fmod )  ]
        #fprep = [ t.absfile( f ) for f in t.toList( fprep ) ]

        try:
            if self.verbose: self.log.add( '\nCleaning PDB file for Amber:' )
            m = self.leapModel( hetatm=hetatm, center=center )

            if cap:
                end_broken = m.atom2chainIndices( m.chainBreaks() )
                capC = MU.union( capC, end_broken )
                capN = MU.union( capN, N0.array( end_broken ) + 1 )

            for i in capN:
                if self.verbose:
                    self.log.add( 'Adding ACE cap to chain %i' % i )
                m = self.capACE( m, i )

            for i in capC:
                if self.verbose:
                    self.log.add( 'Adding NME cap to chain %i' % i )
                m = self.capNME( m, i )

            m.renumberResidues( addChainId=1 )  ## again, to accomodate capping

            template = open( self.leap_template ).read()

            leap_mod = self.__fLines( 'm = loadAmberParams %s\n', fmod )
            leap_prep= self.__fLines( 'loadAmberPrep %s\n', fprep )

            ss = self.__ssBonds( m, cutoff=4. )
            self.__cys2cyx( m, ss )
            leap_ss  = self.__fLines( self.ss_bond, ss )
            if self.verbose:
                self.log.add('Found %i disulfide bonds: %s' % (len(ss),str(ss)))

            if self.verbose:
                self.log.add( 'writing cleaned PDB to %s'  % self.leap_pdb )
            m.writePdb( self.leap_pdb, ter=3 )

            self.__runLeap( template, in_pdb=self.leap_pdb,
                            out_parm=f_out, out_crd=f_out_crd,
                            ss_bonds=leap_ss, fmod=leap_mod,
                            fprep=leap_prep, norun=norun,
                            box=box, **kw )

            if not norun:
                parm_pdb = self.parm2pdb( f_out, f_out_crd, f_out_pdb )

            if not self.keep_leap_pdb and not self.debug:
                t.tryRemove( self.leap_pdb )

        except IOError as why:
            raise IOError(why)
Exemplo n.º 38
0
    def cleanup(self):
        if not self.debug:
            T.tryRemove(P.join(self.cwd or '', 'leap.log'))

        super().cleanup()
Exemplo n.º 39
0
 def cleanUp(self):
     if not self.DEBUG:
         T.tryRemove( self.dryparm )
         T.tryRemove( self.drycrd )
         T.tryRemove( self.drypdb )
         T.tryRemove( self.wetparm )
         T.tryRemove( self.wetcrd )
         T.tryRemove( self.wetpdb )
         T.tryRemove( self.leapout )
Exemplo n.º 40
0
 def cleanUp(self):
     import os.path as osp
     T.tryRemove(self.fparm)
     T.tryRemove(self.flog)
Exemplo n.º 41
0
 def cleanup(self):
     """
     Delete temporary files
     """
     if not self.debug:
         T.tryRemove(self.tempdir, tree=True)
Exemplo n.º 42
0
 def cleanUp( self ):
     if not self.DEBUG:
         T.tryRemove( self.fcrg )
         T.tryRemove( self.fmap )
Exemplo n.º 43
0
 def cleanUp(self):
     t.tryRemove( self.out_folder, tree=1 )
Exemplo n.º 44
0
 def cleanUp(self):
     t.tryRemove(self.fout)