Error in cmdscale(dist(cent), k = k) : NA values not allowed in 'd'

Issue #613 resolved
Former user created an issue

Hello, I get the error Error in cmdscale(dist(cent), k = k) : NA values not allowed in 'd' here is my command line

> 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,ncore=6)
> net <- cna(cij, cutoff.cij=0.3)
Warning messages:
1: In (function (graph, weights = E(graph)$weight, directed = TRUE,  :
  At community.c:460 :Membership vector will be selected based on the lowest modularity score.
2: In (function (graph, weights = E(graph)$weight, directed = TRUE,  :
  At community.c:467 :Modularity calculation with weighted edge betweenness community detection might not make sense -- modularity treats edge weights as similarities while edge betwenness treats them as distances
 > plot(net, pdb)
Obtaining layout from PDB structure
Error in cmdscale(dist(cent), k = k) : NA values not allowed in 'd'

I get this only when i try to use the Backbone or Main chain of a protein (Ca seem to work fine)

Thank you in advance

Comments (5)

  1. Xinqiu Yao

    Hi,

    Currently cna() only supports C-alpha based network analysis. One way to temporarily make it work is changing all backbone or main chain atom names in the pdb to 'CA'. For example,

    inds2 <- atom.select(pdb, 'backbone')
    pdb2 <- pdb
    pdb2$atom$elety[inds2$atom] <- 'CA'
    plot(net, pdb2)
    

    Let me know if it works.

  2. nastaziales

    Thank you very much, so the problem is the name of the atom and not the residue number that is repeating or should i change them both ?

  3. Log in to comment