当前位置: 首页>>代码示例>>Python>>正文


Python PDBModel.writePdb方法代码示例

本文整理汇总了Python中Biskit.PDBModel.writePdb方法的典型用法代码示例。如果您正苦于以下问题:Python PDBModel.writePdb方法的具体用法?Python PDBModel.writePdb怎么用?Python PDBModel.writePdb使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Biskit.PDBModel的用法示例。


在下文中一共展示了PDBModel.writePdb方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: parseReference

# 需要导入模块: from Biskit import PDBModel [as 别名]
# 或者: from Biskit.PDBModel import writePdb [as 别名]
    def parseReference(self, fpdb, dry_out=None ):
        flushPrint("parsing "+fpdb+"...")
        m = PDBModel( fpdb )
        
        solute_res = m.atom2resMask( logical_not( m.maskSolvent() )  )
        self.lenres = self.lenres or sum( solute_res )
        self.lenatoms = len( m ) - sum( m.maskH2O() )

        if dry_out:
            m.remove( m.maskH2O() )
            m.writePdb( dry_out )
        flushPrint('done.\n')
开发者ID:ostrokach,项目名称:biskit,代码行数:14,代码来源:amber_ensembleMD.py

示例2: cmdDict

# 需要导入模块: from Biskit import PDBModel [as 别名]
# 或者: from Biskit.PDBModel import writePdb [as 别名]
if __name__ == '__main__':

    options = cmdDict( {'ter':1} )

    if len( options ) < 2:
        _use( options )

    skip = None
    if options.has_key('wat'):
        skip = ['TIP3', 'WAT', 'HOH', 'H2O', 'Na+', 'Cl-']

    fin = [ absfile(f) for f in toList( options['i'] ) ]
    ter = int( options['ter'] )
    codeprefix = options.has_key( 'codeprefix' )

    for f in fin:

        fout= options.get('o', None) or stripSuffix( f ) + '.pdb'

        m = PDBModel( f )

        if codeprefix:
            code = m.pdbCode or ''
            fpath, fname = osp.split( fout )
            fout = osp.join( fpath, code + fname )

        m.writePdb( fout, ter=ter )

        errWriteln('dumped ' + fout )

开发者ID:graik,项目名称:biskit,代码行数:31,代码来源:model2pdb.py

示例3: process_all

# 需要导入模块: from Biskit import PDBModel [as 别名]
# 或者: from Biskit.PDBModel import writePdb [as 别名]
    def process_all( self, file_dic, keep_hetatoms=0 ):
        """
        Process PDB files in file_dic.
        The PDB is read from:
          - L{TemplateSearcher.F_NR}

        and cleaned files are written to:
          - L{F_CLEANED}
          - L{F_COFFEE}
          - L{F_MODELLER}

        If the file L{F_CLEANED} already exists, this file is
        used to write modeller and t-coffee pdbs.

        @param file_dic: dictionary mapping filenames of pdb files to
                         the chains of interest, e.g. { fname : chain_id, }
        @type  file_dic: {str:str}
        @param keep_hetatoms: keep hetatoms (default: 0)
        @type  keep_hetatoms: 0|1
        """
        fasta = ""
        c = None

        for f, id in file_dic.items():

            self.logWrite( '\nCLEANING ' + f + '...')

            try:
                code = string.split(f, '/')[-1][:4]

                ## clean to standard PDB
                c = PDBCleaner( f, self.log )

                ## if /templates/nr_cleaned/pfb-file exists
                if os.path.exists(
                    self.outFolder+self.F_CLEANED + code + '.pdb' ):

                    model = PDBModel( self.outFolder+self.F_CLEANED \
                                      + code + '.pdb' )

                ## read pdb from /templates/nr
                else:
                    model = c.process( keep_hetatoms=keep_hetatoms )

                    ## write complete cleaned PDB
                    model.writePdb( self.outFolder+self.F_CLEANED \
                                    + code + '.pdb')

                code = model.pdbCode
                title = code + '_' + id

                ## extract needed chain
                if len( id ) > 0:
                    model = self.__chain_by_id( model, id )

                fname =  "%s%s.pdb" % (self.outFolder + self.F_MODELLER, title)
                self.write_modeller_pdb( model, fname )

                ## write T_coffee CA trace with res sequence
                fname = "%s%s.alpha"%(self.outFolder + self.F_COFFEE, title)
                self.write_tcoffee_pdb( model, fname )

                ## append fasta
                fasta += self.fasta_sequence( title, model.sequence() )

            except:
                self.logWrite( 'Error cleaning ' + f)
                self.logWrite( T.lastError() )
                self.err_cleaner = c
                self.err_file = f

        fasta_out = open( self.outFolder + self.F_FASTA, 'w' )
        fasta_out.write( fasta )
        fasta_out.close()
开发者ID:graik,项目名称:biskit,代码行数:76,代码来源:TemplateCleaner.py

示例4: errWriteln

# 需要导入模块: from Biskit import PDBModel [as 别名]
# 或者: from Biskit.PDBModel import writePdb [as 别名]
    errWriteln("loading pdbs...")
    
    m1 = PDBModel( f1 )
    m2 = PDBModel( f2 )

    if options.has_key('c1'):
        m1 = m1.takeChains( toIntList( options['c1'] ) )

    if options.has_key('c2'):
        m2 = m2.takeChains( toIntList( options['c2'] ) )

    m1.removeRes( 'TIP3' )
    m2.removeRes( 'TIP3' )

    m1.sort()
    m2.sort()

    errWriteln("compare atoms of pdbs...")
    mask1, mask2 = m1.equalAtoms( m2 )

    errWriteln("removing %i atoms from %s" % (sum( logical_not( mask1 ) ), f1))
    m1.remove( logical_not( mask1 ) )
    
    errWriteln("removing %i atoms from %s" % (sum( logical_not( mask2 ) ), f2))
    m2.remove( logical_not( mask2 ) )

    errWriteln("writing new pdbs..." )
    m1.writePdb( o1 )
    m2.writePdb( o2 )
开发者ID:ostrokach,项目名称:biskit,代码行数:31,代码来源:castPdbs.py


注:本文中的Biskit.PDBModel.writePdb方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。