Center, to the coordinate origin, and orient, by principal axes, the coordinates of a given PDB structure or xyz vector.

orient.pdb(pdb, atom.subset = NULL, verbose = TRUE)

Arguments

pdb

a pdb data structure obtained from read.pdb or a vector of ‘xyz’ coordinates.

atom.subset

a subset of atom positions to base orientation on.

verbose

print dimension details.

Value

Returns a numeric vector of re-oriented coordinates.

References

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

Author

Barry Grant

Note

Centering and orientation can be restricted to a atom.subset of atoms.

See also

read.pdb, write.pdb, fit.xyz, rot.lsq , atom.select

Examples

# \donttest{ # PDB server connection required - testing excluded pdb <- read.pdb( "1bg2" )
#> Note: Accessing on-line PDB file
#> Warning: /var/folders/xf/qznxnpf91vb1wm4xwgnbt0xr0000gn/T//Rtmp4WslmZ/1bg2.pdb exists. Skipping download
xyz <- orient.pdb(pdb)
#> Dimensions: #> x min= -33.358 max= 37.308 range= 70.666 #> y min= -23.392 max= 27.583 range= 50.975 #> z min= -19.521 max= 28.128 range= 47.65
#write.pdb(pdb, xyz = xyz, file = "mov1.pdb") # Based on C-alphas inds <- atom.select(pdb, "calpha") xyz <- orient.pdb(pdb, atom.subset=inds$atom)
#> Dimensions: #> x min= -33.708 max= 37.75 range= 71.458 #> y min= -23.485 max= 27.479 range= 50.965 #> z min= -21.046 max= 27.17 range= 48.216
#write.pdb(pdb, xyz = xyz, file = "mov2.pdb") # Based on a central Beta-strand inds <- atom.select(pdb, resno=c(224:232), elety='CA') xyz <- orient.pdb(pdb, atom.subset=inds$atom)
#> Dimensions: #> x min= -42.58 max= 30.521 range= 73.101 #> y min= -24.436 max= 21.585 range= 46.022 #> z min= -27.759 max= 22.305 range= 50.064
#write.pdb(pdb, xyz = xyz, file = "mov3.pdb") # }