How to assign certain residues for alignment and get analysis results for all residues?

Issue #747 new
guoqin feng created an issue

ca.inds <- atom.select(pdb, resno=20:200, elety="CA")

xyz <- fit.xyz(fixed=pdb$xyz, mobile=trj, fixed.inds=ca.inds$xyz, mobile.inds=ca.inds$xyz)

The N-terminus of my protein is a loop with large flexibility, so I specified residues of 20-200 for structural alignment. However, in subsequent analysis, such as RMSF, RMSD, PCA, etc., bio3d only produced the analysis results of the specified residue range, and there was no data for residues of N-terminus loop. Therefore, I want to know how to align the specified residues to produce the analysis results for all residues of the protein. Thanks!

Comments (5)

  1. Xinqiu Yao

    Hi,

    Can you give an example how you did subsequent calculations? (E.g., RMSF)

    fit.xyz() will return full structures of whatever “mobile” is given. For example, if your ‘trj’ contains the N-terminus, ‘xyz’ should have it, too, no matter which subset you choose to do the fitting.

  2. guoqin feng reporter

    The following is my analysis code, almost all from the tutorial.😅

    setwd("E:/bio3D-test/apo")

    library(bio3d)

    pdb <- read.pdb("E:/bio3D-test/apo/protein_full.pdb")

    print(pdb)

    trj <- read.ncdf("E:/bio3D-test/apo/apo.nc", first=1, last=5000, stride=1)

    print(pdb$xyz)

    print(trj)

    ca.inds <- atom.select(pdb,resno=20:170, elety="CA")

    xyz <- fit.xyz(fixed=pdb$xyz, mobile=trj, fixed.inds=ca.inds$xyz, mobile.inds=ca.inds$xyz)

    dim(xyz) == dim(trj)

    rd <- rmsd(xyz[1,ca.inds$xyz], xyz[,ca.inds$xyz])
    plot(rd, typ="l", ylab="RMSD", xlab="Frame No.")
    points(lowess(rd), typ="l", col="red", lty=2, lwd=2)

    hist(rd, breaks=40, freq=FALSE, main="RMSD Histogram", xlab="RMSD")
    lines(density(rd), col="gray", lwd=3)

    summary(rd)

    rf <- rmsf(xyz[,ca.inds$xyz])
    plot(rf, ylab="RMSF", xlab="Residue Position", typ="l")

    pc <- pca.xyz(xyz[,ca.inds$xyz])
    plot(pc, col=bwr.colors(nrow(xyz)) )

    hc <- hclust(dist(pc$z[,1:2]))
    grps <- cutree(hc, k=2)
    plot(pc, col=grps)

    plot.bio3d(pc$au[,1], ylab="PC1 (A)", xlab="Residue Position", typ="l")
    points(pc$au[,2], typ="l", col="blue")

    p1 <- mktrj.pca(pc, pc=1, b=pc$au[,1], file="pc1.pdb")
    p2 <- mktrj.pca(pc, pc=2,b=pc$au[,2], file="pc2.pdb")

    write.ncdf(p1, "trj_pc1.nc")

    cij<-dccm(xyz[,ca.inds$xyz])
    plot(cij)

    pymol.dccm(cij, pdb, type="launch")

    However, the bio3d only gives the analysis results for residues 20-170(That is 1-150 in the figure below)

  3. Xinqiu Yao

    rf <- rmsf(xyz[,ca.inds$xyz])

    In above line, you used the index ca.inds to subset ‘xyz’. ca.inds only contains residues 20-170 and so does the result.

    You can create another index, e.g., ca.inds2 ← atom.select(pdb, “calpha”)

    Then, use ca.inds to do the fitting and ca.inds2 for analysis.

  4. Log in to comment