rmsd                  package:bio3d                  R Documentation

_R_o_o_t _M_e_a_n _S_q_u_a_r_e _D_e_v_i_a_t_i_o_n

_D_e_s_c_r_i_p_t_i_o_n:

     Calculate the RMSD between coordinate sets.

_U_s_a_g_e:

     rmsd(a, b=NULL, a.inds=NULL, b.inds=NULL, fit=FALSE)

_A_r_g_u_m_e_n_t_s:

       a: a numeric vector containing the reference coordinate set for
          comparison with the coordinates in 'b'.  Alternatively, if
          'b=NULL' then 'a' can be a matrix or list object containing
          multiple coordinates for pairwise comparison. 

       b: a numeric vector, matrix or list object with an 'xyz'
          component, containing one or more coordinate sets to be
          compared with 'a'. 

 a.inds : a vector of indices that selects the elements of 'a' upon
          which the calculation should be based. 

 b.inds : a vector of indices that selects the elements of 'b' upon
          which the calculation should be based. 

    fit : logical, if TRUE coordinate superposition is performed prior
          to RMSD calculation. 

_D_e_t_a_i_l_s:

     RMSD is a standard measure of structural distance between
     coordinate sets.

     Structure 'a[a.inds]' and 'b[b.inds]' should have the same length.

     A least-squares fit is performed prior to RMSD calculation by
     setting 'fit=TRUE'.  See the function 'fit.xyz' for more details
     of the fitting process.

_V_a_l_u_e:

     Returns a numeric vector of RMSD value(s).

_A_u_t_h_o_r(_s):

     Barry Grant

_R_e_f_e_r_e_n_c_e_s:

     Grant, B.J. et al. (2006) _Bioinformatics_ *22*, 2695-2696.

_S_e_e _A_l_s_o:

     'fit.xyz', 'rot.lsq', 'read.pdb', 'read.fasta.pdb'

_E_x_a_m_p_l_e_s:

     # -- Calculate RMSD between two or more structures
     aln <- read.fasta(system.file("examples/kif1a.fa",package="bio3d"))
     pdb.path = system.file("examples",package="bio3d")
     pdbs <- read.fasta.pdb(aln, pdb.path = pdb.path, pdbext = ".ent")

     # Indices 
     gaps <- unique( which(is.na(pdbs$xyz),arr.ind=TRUE)[,2] )
     inds <- c(1:ncol(pdbs$xyz))[-gaps]

     # RMSD between structure 1 and structure 2
     rmsd(a=pdbs$xyz[1,], b=pdbs$xyz[2,], a.inds=inds, b.inds=inds)
     rmsd(a=pdbs$xyz[1,], b=pdbs$xyz[2,], a.inds=inds, b.inds=inds, fit=TRUE)

     ## Not run: 
     # RMSD between structure 1 and structures 2 and 3
     rmsd(a=pdbs$xyz[1,], b=pdbs$xyz[2:3,], a.inds=inds, b.inds=inds)

     # RMSD between structure 1 and all structures in alignment
     rmsd(a=pdbs$xyz[1,], b=pdbs, a.inds=inds, b.inds=inds, fit=TRUE)

     # pairwise RMSD
     rmsd(pdbs$xyz[,inds])
     ## End(Not run)

