cna calculation - error message

Issue #487 resolved
Jeremy Bigness created an issue

Hello, I'm trying to follow along with the protein structure network analysis using my own data generated from MD simulations. The calculations were taking exceedingly long, and I believe the bottleneck is in the cna calculation. I tried implementing some of the suggestions mentioned in the previous issues from other users, and this is my code:

** ca.inds <- atom.select(pdb, elety="CA")

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

cij<-dccm(trj[,ca.inds$xyz]) net <- cna(cij,cutoff.cij=0.4) plot(net, pdb)**

The error message I receive is as follows: Error in cmdscale(dist(cent), k = k) : NA values not allowed in 'd' In addition: Warning message: In cna.dccm(cij, cutoff.cij = 0.4) : The number of communities is larger than the number of unique 'colors' provided as input. Colors will be recycled

I understand the warning message, and can play with adjusting the cutoff values, but I do not understand what the error message is saying. Please advise.

Thank you for your assistance!

Comments (7)

  1. Xinqiu Yao

    Hi,

    Could you provide more information about your OS, R and bio3d version, etc? It would be better if you could also provide an example that reproduces your errors (e.g. a 'cna' object along with a pdb).

  2. Jeremy Bigness reporter

    I have attached the .pdb and .dcd files (above) that I am trying to use to generate the network analysis.

    OS: Windows 10 x64

    R: v3.4.1

    R-studio: v1.0.143

    bio3d: v2.3

    My code is below. Thank you!

    ...

    library(bio3d)

    library(igraph)

    pdbName <- paste(directory1,'proStruct.pdb',sep='')

    pdb <- read.pdb(pdbName)

    dcdName <- paste(directory1,'proMD.dcd',sep='')

    dcd <- read.dcd(dcdName)

    inds <- atom.select(pdb, elety = "CA")

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

    cij <- dccm(trj[,inds$xyz])

    net <- cna(cij,cutoff.cij=0.4)

    plot(net, pdb)

    ...

  3. Xinqiu Yao

    Hi,

    I quickly checked your files and found the number of atoms in the pdb (3249) does not match that in the dcd (3248). Please check and make sure you use the proper topology file. Then try again and see if errors disappear.

  4. Jeremy Bigness reporter

    Apologies -- I must have uploaded the wrong files. I've re-attached two files that should be from the same structure.

    Also, if I use plot(net), a plot is produced without the error message, but it does not correspond to the structure of the protein (just a circular looking network). If I use plot(net,pdb), then the error message arises. Please advise.

    Thank you.

  5. Xinqiu Yao

    Hi,

    I found in the pdb some residues are renumbered beginning from 1 but the chain ID is not updated. Although for other software it may be okay (for example VMD), in bio3d it may cause some problems. Note that bio3d follows the official PDB format, i.e. a combination of chain ID and residue number (sometimes also includes insertion code) uniquely defines a residue. You can either renumber all residues consistently or add chain IDs, and then the problem should be resolved.

    Let me know if you have further questions.

  6. Log in to comment