Use partial structre to superpose entire structure

Issue #647 closed
exchhattu created an issue

Hi,

The protein I am studying is complex. I did use fit.xyz function to fit the entire simulation with reference. However, I want to carry out this process slightly different way. During the fitting, I want to compute rotation matrix and translation vector using partial structure and subsequently to use these parameters to superpose (fit) the entire structure. Is it possible to do using Bio3D provided functions? If yes, could you please tell the name of function?

Comments (5)

  1. Xinqiu Yao

    Hi,

    Of course. This is exactly how fit.xyz() is designed. Check the help document with help(fit.xyz) or the tutorial http://thegrantlab.org/bio3d/tutorials/structure-analysis for detail. Briefly, you need the atom.select() function to generate a list of atom indices of the partial structure and use it in fit.xyz().

    a.ind <- atom.select(a, chain="A", resno=87:103, elety="CA")
    b.ind <- atom.select(b, chain="A", resno=93:109, elety="CA")
    
    # perform superposition
    xyz <- fit.xyz(fixed=a$xyz, mobile=b$xyz,
                   fixed.inds=a.ind$xyz,
                   mobile.inds=b.ind$xyz)
    
  2. exchhattu reporter

    Hi,

    Although I suppose I understand functionality of each method I used by reading the documentation, I would like to further confirm.

    The following code is for fitting the dcd trajectory to reference using residue position 299 to 400 although the system contains residues from 299 to 514.

    oj_whole_dcd <- read.dcd(st_hc_dcd)
    oj_whole_pdb <- read.pdb(st_hc_ref)
    
    oj_ref_atoms_cc.ind  <- atom.select(oj_whole_pdb, "calpha", resno=299:400)
    oj_ref_atoms_hc.ind  <- atom.select(oj_whole_pdb, "calpha", resno=299:514)
    
    oj_xyz_hc <- fit.xyz(fixed=oj_whole_pdb$xyz, mobile=oj_whole_dcd,
                                      fixed.inds=oj_ref_atoms_cc.ind$xyz, mobile.inds=oj_ref_atoms_cc.ind$xyz)
    dim(oj_xyz_hc) == dim(oj_whole_dcd)
    

    Here is another trajectory and their corresponding fitting.

    oj_whole_dcd_r1 <- read.dcd(st_hc_dcd_r1)
    oj_whole_pdb_r1 <- read.pdb(st_hc_ref_r1)
    
    oj_ref_atoms_cc_r1.ind  <- atom.select(oj_whole_pdb_r1, "calpha", resno=299:400)
    oj_ref_atoms_hc_r1.ind  <- atom.select(oj_whole_pdb_r1, "calpha", resno=299:514)
    
    oj_xyz_hc_r1 <- fit.xyz(fixed=oj_whole_pdb_r1$xyz, mobile=oj_whole_dcd_r1,
                                      fixed.inds=oj_ref_atoms_cc_r1.ind$xyz, mobile.inds=oj_ref_atoms_cc_r1.ind$xyz)
    dim(oj_xyz_hc_r1) == dim(oj_whole_dcd_r1)
    

    Now, I computed PCA from first trajectory and projected second trajectory on PC subspace defined by first one using following code.

    pc_hc  <- pca.xyz(oj_xyz_hc[,oj_ref_atoms_hc.ind$xyz])
    pc_proj_hc_r1 <- project.pca(oj_xyz_hc_r1[, oj_ref_atoms_hc_r1.ind$xyz], pc_hc)
    

    I plotted the first two PCs from each of them.

    Could you please let me know the steps I used are correct to get a projection of two trajectories in same PC spaces (defined by first trajectory to make same reference)?

  3. Log in to comment