Is it possible to change the distance cutoff in construction of ENM?

Issue #278 resolved
Former user created an issue

Is it possible to set user-defined distance cutoff for any force field to select connected CA atoms in ENM?

Comments (3)

  1. Lars Skjærven

    Jepp. Note that all ENMs implemented in bio3d does not use a cutoff. e.g. the default calpha force field has no cutoff argument, but the ANM does:

    pdb <- read.pdb("1hel")
    m1 <- nma(pdb, ff="calpha")
    m2 <- nma(pdb, ff="anm", cutoff=15)
    m3 <- nma(pdb, ff="anm", cutoff=7)
    

    If you want calpha ff with cutoff, you can try to make your own pair force constant function:

    myff <- function (r, cutoff = 10, ...) 
    {   
    
       # first part is the default calpha force field
        a <- 128 * 10^4
        b <- 8.6 * 10^2
        c <- 2.39 * 10^3
    
        # force contstants by calpha ff
        k <- ifelse(r < 4, b * (r) - c, a * (r)^(-6))
    
        # assign zero values to pairs with distance > cutoff 
        inds <- r > cutoff
        k[inds] <- 0
        return(k)
    }
    
    m4 <- nma(pdb, pfc.fun=myff)
    

    Hope this helps.

  2. Log in to comment