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


Python PDBModel.sequence方法代码示例

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


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

示例1: Test

# 需要导入模块: from Biskit import PDBModel [as 别名]
# 或者: from Biskit.PDBModel import sequence [as 别名]
class Test(BT.BiskitTest):
    """DSSP test"""

    TAGS = [BT.EXE]

    def prepare(self):
        self.f = T.testRoot()+"/com/1BGS.pdb"


    def test_DSSP( self ):
        """DSSP test"""

        from Biskit import PDBModel

        if self.local: print 'Loading PDB...'
        self.m = PDBModel(self.f)
        self.m = self.m.compress( self.m.maskProtein() )

        if self.local:  print 'Starting DSSP'
        self.dssp = Dssp( self.m )

        if self.local: print 'Running DSSP'

        self.result = self.dssp.run()

        if self.local:
            print "Sequence :", self.m.sequence()
            print "Secondary:", self.result            

        self.assertEquals( self.result, self.EXPECTED)


    EXPECTED =  '.....SHHHHHHHHHHHSS..TTEE.HHHHHHHT..GGGT.HHHHSTT.EEEEEEE..TT..S...TT..EEEEE.S..SSS..S.EEEEETT..EEEESSSSSS.EE...EEEEETTT..SHHHHHHHHHHHHT..TT..SSHHHHHHHHHHT..SSEEEEEE.HHHHHHHTTTTHHHHHHHHHHHHHHT..EEEEE.'
开发者ID:ostrokach,项目名称:biskit,代码行数:35,代码来源:DSSP.py

示例2: process_all

# 需要导入模块: from Biskit import PDBModel [as 别名]
# 或者: from Biskit.PDBModel import sequence [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

示例3: printSequence

# 需要导入模块: from Biskit import PDBModel [as 别名]
# 或者: from Biskit.PDBModel import sequence [as 别名]
    Syntax pdb2seq.py |pdb_file|
    """

def printSequence( header, s ):

    n_chunks = len( s ) / 80

    print ">%s" % header 

    for i in range(0, n_chunks+1):

        if i * 80 + 80 < len( s ):
            chunk = s[i * 80 : i * 80 + 80]
        else:
            chunk = s[i * 80 :]

        print chunk


if __name__ == '__main__':

    if len( sys.argv ) < 1:
        _use()

    m = PDBModel( sys.argv[1] )

    seq = m.sequence()

    printSequence( m.pdbCode, seq )
开发者ID:graik,项目名称:biskit,代码行数:31,代码来源:pdb2seq.py


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