示例#1
0
 def import_contact_map_from_pdb (self           , 
                                  pdb    = None  , 
                                  cutoff = 6.0   ,
                                  log    = False):
     
     """ Gera o mapa de contato a patir de um PDB (estrutura de referencia) """
     
    
     system = Molecule() 
     system.load_PDB_to_system (filename = pdb   )   
     cmap = 0*np.random.rand(len(system.residues),len(system.residues))
     
     self.number_of_contacts =  0
     
     for index_i in range(0, len(system.residues)):
         for index_j in range(index_i+2, len(system.residues)):
             
             name_i = system.residues[index_i].name
             
             for atom in system.residues[index_i].atoms:
                 if atom.name == 'CA':
                     atom_i    = atom  
             name_j = system.residues[index_j].name
             
             for atom in system.residues[index_j].atoms:
                 if atom.name == 'CA':
                     atom_j = atom  
             R_ab = distance_ab (atom_i, atom_j)
             
             
             if R_ab <= cutoff:
                 cmap[index_i][index_j] = 1
                 self.number_of_contacts += 1
                 if log:
                     print index_i, name_i, index_j, name_j, R_ab, 'contact'
             else:
                 pass
     
     if log:
         print '\ncmap matrix:'
         print cmap
         
         print '\n---------------------------------------------'
         print 'total number of residues = ', len(system.residues)
         print 'Cutoff size              = ', cutoff
         print 'number of contacts       = ', self.number_of_contacts
         print '---------------------------------------------\n'
     
     self.cmap   = cmap
     self.cutoff = cutoff
minimize(molecule = system,
               imin  = 1          ,
               maxcyc= 1000       ,
               ncyc  = 100        ,
               cut   = 10         ,
               rgbmax= 999        ,
               igb   = 1          ,
               ntb   = 0          ,
               ntpr  = 100        ,
               ntr   = 0          )
               #restraintmask = ':1-50 & @CA,N,C,O=', 
               #restraint_wt  =  50.0               )
save_PDB_to_file(system,  os.path.join(PEPDICE_EXAMPLES , 'example02.1_fragments_extended_min.pdb'))


system.load_PDB_to_system       (filename = os.path.join( PEPDICE_EXAMPLES , 'LABIO_set/'+PDB+'/'+PDB+'_A_AMBER_minimized.pdb'     ))

minimize(molecule = system,
               imin  = 1          ,
               maxcyc= 1000       ,
               ncyc  = 100        ,
               cut   = 10         ,
               rgbmax= 999        ,
               igb   = 1          ,
               ntb   = 0          ,
               ntpr  = 100        ,
               ntr   = 0          )
               #restraintmask = ':1-50 & @CA,N,C,O=', 
               #restraint_wt  =  50.0               )
save_PDB_to_file(system,  os.path.join(PEPDICE_EXAMPLES , 'example02.1_fragments_template_min.pdb'))
示例#3
0
cmap = CMAP(pdb = os.path.join(PEPDICE_EXAMPLES , 'LABIO_set/1I6C/1I6C_A_AMBER_minimized.pdb'), cutoff = 6.5, log = True)
#-------------------------------------------------------------------------------





# creating a new system 
system = Molecule()
system.name = '1I6C - LABIO dataset' 

# - setup energy model
system.set_energy_model('amber')

# importing coordinates and amber parameters
system.load_PDB_to_system      (filename = os.path.join(PEPDICE_EXAMPLES , 'LABIO_set/1I6C/1I6C_A_AMBER_minimized.pdb'   )   )   
system.import_AMBER_parameters (top      = os.path.join(PEPDICE_EXAMPLES , 'LABIO_set/1I6C/1I6C_A_AMBER.top')   ,   
                                torsions = os.path.join(PEPDICE_PARAMETER, 'amber/AMBER_rotamers.dat') )   



print system.compute_R_gy_Calpha()
print system.compute_SS_energy(log = True)
#cmap = CMAP(pdb = os.path.join(PEPDICE_EXAMPLES ,  'Itasser_set/IT1af7__/native_A_AMBER_minimized.pdb'), cutoff = 6.5, log = True)
#system.load_PDB_to_system      (filename = os.path.join(PEPDICE_EXAMPLES , 'Itasser_set/IT1af7__/native_A_AMBER_minimized.pdb') )
#system.import_AMBER_parameters (top      = os.path.join(PEPDICE_EXAMPLES , 'Itasser_set/IT1af7__/native_A_AMBER.top') , 
#                                torsions = os.path.join(PEPDICE_PARAMETER, 'amber/AMBER_rotamers.dat') )   
#



    PDB        = pdb
    sequence   = get_sequence_from_segFile(seqFile = os.path.join(PEPDICE_EXAMPLES , '') )
    TRAJECTORY = PDB+'trajectory'
    # creating a new system 
    system = Molecule()
    system.name = PDB+'-from_sequence' 
    system.build_peptide_from_sequence (
                                         sequence    = sequence,
                                         _type       = 'amber'       ,
                                         force_field = 'ff03ua.labio',
                                         overwrite   = True          ,
                                         )
    system.set_energy_model('RAW')
    system.load_PDB_to_system       (filename =  os.path.join(PEPDICE_EXAMPLES , 'new_method_example02.1_fragments_extended_min.pdb'))



    '''
    minimize(molecule = system,
                   imin  = 1          ,
                   maxcyc= 1000       ,
                   ncyc  = 100        ,
                   cut   = 10         ,
                   rgbmax= 999        ,
                   igb   = 1          ,
                   ntb   = 0          ,
                   ntpr  = 100        ,
                   ntr   = 0          )
                   #restraintmask = ':1-50 & @CA,N,C,O=', 
    system.set_energy_model('FULL')
    system.import_AMBER_parameters (top      = folder+'_A_AMBER.top'                ,   
                                    torsions = os.path.join(PEPDICE_PARAMETER, 'amber/AMBER_rotamers.dat') )       
    
    
    
    
    
    
    for pdb in RMSD_list:
        if pdb == 'NAME':
            pass
        
        else:
            filename =  pdb.replace('.', '_A_AMBER_minimized.')
            system.load_PDB_to_system      (filename = filename)   
            #print pdb , filename

            #pprint(RMSD_list)
            

            
            try:    
                cutoff   = 6.0
                contacts = []
                
                
                #saltcon = 0.00
                #EGBs = []
                #
                #for i in range(0, 6):
示例#6
0
            logtext.append(code + ' wget_pdb......Ok\n')
        except Exception as error:
            print 'failed wget pdb'
            print error
            logtext.append(code + ' wget_pdb......failed\n')

        try:
            # ------------------------------------------------------------------
            build_AMBER_system_from_PDB(
                pdbin=code+'_A.pdb',
                basename=code+'_A_AMBER',
                force_field='ff03ua.labio',
                overwrite=True
            )
            system = Molecule()
            system.load_PDB_to_system(filename=code + '_A_AMBER.pdb')
            system.import_AMBER_parameters(
                top=code + '_A_AMBER.top',
                torsions=os.path.join(
                    PEPDICE_PARAMETER, 'amber/AMBER_rotamers.dat'),
            )
            save_PDB_to_file(system, code+'_A.pdb')
            logtext.append(code + ' tleap......Ok\n')

        except:
            print 'failed wget pdb'
            logtext.append(code + ' tleap......failed\n')

        try:
            minimize(
                molecule=system,