示例#1
0
def Interface_axis(
        pose, dist, resmuts, score
):  ## return the interface rotation/translation axis and the center

    ## Compute interface at "dist" of distance and store:
    ## The contact_list=[i := contact of ith residue ]
    ## The interface_list= [[interface_1],[interface_2]]
    copy_pose = Pose()
    copy_pose.assign(pose)

    score(copy_pose)
    interface = Interface(1)
    interface.distance(dist)
    interface.calculate(copy_pose)
    contact = interface.contact_list()
    interface_residue = interface.pair_list()

    centroid_interface = []
    for interface in interface_residue:  ## Compute the axis by taking the whole interfaces.
        centroid_interface.append(
            centroid([
                copy_pose.residue(res).xyz('CA') for res in interface
            ]))  ## store the centroids of the residue in the interfaces.
    interface_axis = map(sub, centroid_interface[0], centroid_interface[1])
    center = centroid_interface[0]
    return (interface_axis, center)
def Interface_axis(
        pose, dist, resmuts, score
):  ## return the interface rotation/translation axis and the center

    ## Compute interface at "dist" of distance and store:
    ## The contact_list=[i := contact of ith residue ]
    ## The interface_list= [[interface_1],[interface_2]]
    copy_pose = Pose()
    copy_pose.assign(pose)
    setup_foldtree(copy_pose, "A_B", Vector1([1]))
    score(copy_pose)
    interface = Interface(1)
    interface.distance(dist)
    interface.calculate(copy_pose)
    contact = interface.contact_list()
    interface_residue = interface.pair_list()

    centroid_interface = []
    for interface in interface_residue:  ## Compute the axis by taking the whole interfaces. (Only for the native)
        centroid_interface.append(
            centroid([
                copy_pose.residue(res).xyz('CA') for res in interface
            ]))  ## store the centroids of the residue in the interfaces.
    interface_axis = map(sub, centroid_interface[0], centroid_interface[1])
    center = centroid_interface[0]

    ## If there is mutation. The axis change by moving to the centroid of mutable residue.
    if (len(resmuts) != 0 and len(interface_residue[1]) != 0
            and len(interface_residue[2]) != 0):
        centroid_muts = []  ## array for the mutables centroids
        centroid_flexs = [
        ]  ## array for the flexibles centroids i.e centroid of flexible 1, flexible 2 etc...
        for res in resmuts:  ## Calculate the centroid of flexibles of (of res in resnames)
            centroid_flexs.append(
                centroid([
                    copy_pose.residue(i).xyz("CA")
                    for i in sorted(list(set(contact[int(res)])))
                ]))
            centroid_muts.append(copy_pose.residue(int(res)).xyz("CA"))
        centroid_flex = centroid(
            centroid_flexs)  ## calculate the centroid of flexibles centroids
        centroid_mut = centroid(
            centroid_muts)  ## calculate the centroid of mutables
        interface_axis = [
            centroid_flex[0] - centroid_mut[0],
            centroid_flex[1] - centroid_mut[1],
            centroid_flex[2] - centroid_mut[2]
        ]  ## Calculate the axis
        center = centroid_mut
    return (interface_axis, center)
示例#3
0
def Interface_axis(pose, dist, resmuts, score): ## return the interface rotation/translation axis and the center
    
    ## Compute interface at "dist" of distance and store: 
    ## The contact_list=[i := contact of ith residue ] 
    ## The interface_list= [[interface_1],[interface_2]]
    copy_pose=Pose()
    copy_pose.assign(pose)

    score(copy_pose)
    interface = Interface(1)
    interface.distance(dist)
    interface.calculate(copy_pose)
    contact = interface.contact_list()
    interface_residue = interface.pair_list()
    
    centroid_interface=[]
    for interface in interface_residue: ## Compute the axis by taking the whole interfaces.
      centroid_interface.append(centroid([copy_pose.residue(res).xyz('CA') for res in interface])) ## store the centroids of the residue in the interfaces.
    interface_axis= map(sub,centroid_interface[0],centroid_interface[1])
    center=centroid_interface[0]
    return (interface_axis, center)
示例#4
0
from toolbox import *
import StringIO

parser = optparse.OptionParser()
parser.add_option('--pdb',
                  dest='pdb_file',
                  default='',
                  help='Protein comple in PDB format')
parser.add_option('--dist',
                  dest='dist',
                  default=10.0,
                  help='Size of interface')

(options, args) = parser.parse_args()
pdb_file = options.pdb_file
dist = float(options.dist)

init()
pose = pose_from_pdb(pdb_file)
setup_foldtree(pose, "A_B", Vector1([1]))
score = create_score_function("talaris2014")
score(pose)
interface = Interface(1)
interface.distance(dist)
interface.calculate(pose)
contact = interface.contact_list()
interface_residue = interface.pair_list()

print pose.fold_tree()
print interface_residue
示例#5
0
from rosetta.core.scoring import *
from rosetta.core.graph import *
from rosetta.protocols.scoring import Interface 

from toolbox import *
import StringIO

parser=optparse.OptionParser()
parser.add_option('--pdb', dest = 'pdb_file', default = '', help = 'Protein comple in PDB format' )
parser.add_option( '--dist', dest='dist' ,
    default = 10.0,   
    help = 'Size of interface')

(options,args) = parser.parse_args()
pdb_file=options.pdb_file
dist=float(options.dist)

init()
pose=pose_from_pdb(pdb_file)
setup_foldtree(pose, "A_B", Vector1([1]))
score=create_score_function("talaris2014")
score(pose)
interface = Interface(1)
interface.distance(dist)
interface.calculate(pose)
contact = interface.contact_list()
interface_residue = interface.pair_list()

print pose.fold_tree()
print interface_residue