nma.pdbs missing xyz if fit=FALSE

Issue #33 resolved
Xinqiu Yao created an issue
modes<-nma.pdbs(pdbs)
#Error: object 'xyz' not found

Comments (10)

  1. Xinqiu Yao reporter

    also problems with UNK residue type. Can some UNK residues be guessed or can we add a user supplied mass when calling the function?

    Error in aa2mass(pdb = c("ALA", "ARG", "THR", "VAL", "LYS", "LEU", "LEU",  : 
      Unknown residue type: UNK
    

    If trim.inds is given can we still exclude gaps within the function with a warning message?

    modes<-nma.pdbs(pdbs, fit=TRUE, full=T, trim.inds=3:319)
    Error in fit.xyz(fixed = pdbs$xyz[1, ], mobile = pdbs, fixed.inds = f.inds$pos,  : 
       NA elements selected for fitting (check indices)
    
  2. Lars Skjærven

    To the initial issue you reported: Fixed. Sorry for yet another silly mistake. Thanks for testing and reporting.

    UNK: easiest solution is to choose no mass weighting. use

    modes<-nma.pdbs(pdbs, mass=FALSE)
    

    Alternatively, you have to determine the mass of UNK and specify it. See function aa2mass():

    mass.custom <- list("UNK"=500.0, "HID"=137.141527)
    modes<-nma.pdbs(pdbs, mass.custom=mass.custom)
    

    Usage of trim.inds:

    gaps.res <- gap.inspect(pdbs$ali)
    all.modes <- nma.pdbs(pdbs, trim.inds=gaps.res$f.inds)
    

    Agree that we need a warning or a check to deal with these indices. I will look into it.

    Thanks !

  3. Barry Grant

    I would like to use the trim.inds for pruning the N cand C termini segments but there may still be gaps within the remaining segment and I would expect nma.pdbs() to exclude these gap positions without me having to worry beyond getting a warning...

    ids <- c("1bg2_A", "1n6m_B")
    raw.files <- get.pdb(ids, path = "raw_pdbs")
    files <- pdbsplit(raw.files, ids, path = "raw_pdbs/split_chain/")
    pdbs <- pdbaln(files)
    modes <- nma.pdbs(pdbs, fit=TRUE, trim.inds=63:382)
    ## Error in fit.xyz(fixed = pdbs$xyz[1, ], mobile = pdbs, fixed.inds = f.inds$pos,  :
    ##   NA elements selected for fitting (check indices)
    
  4. Lars Skjærven

    sure we need this trimming, or can we trim the raw ''pdbs'' object prior to calling this function? there were a bit many confusing things, so I removed it as an option in the new version

  5. Barry Grant

    Can we add mass.custom option to nma() function also (perhaps by passing to build.hessian() )??.

    pdb<-read.pdb("1xj0", het2atom=TRUE)
    nma(pdb)
    ## Error in aa2mass(pdb = c("MET", "THR", "GLU", "TYR", "LYS", "LEU", "VAL",  :
    ##  Unknown residue type: CSX
    
    cus<-list("CSX"=121.166)
    modes <- nma(pdb, aa.mass=cus) ## Need a vector
    
    modes <- nma(pdb, mass=cus) ## logical
    ## Error in mass && is.null(bh.args$aa.mass) : invalid 'x' type in 'x && y'
    
  6. Lars Skjærven

    Yes, you need to direct mass.custom to aa2mass(), i.e.

    > hmm <- nma(pdb, mass.custom=list(CSX=121))
     Building Hessian...            Done in 0.079 seconds.
     Diagonalizing Hessian...       Done in 0.196 seconds.
    

    This will be the same as

    masses <- aa2mass(pdb, mass.custom=list(CSX=121))
    hmm <- nma(pdb, aa.mass=masses)
    

    So that nma() works as a wrapper function for aa2mass and build.hessian.

    Confusing? I guess so.. three different mass arguments flying around. We could perhaps reduce it to two by making mass logical (true/false) or a vector of a aa masses (thus melt arguments mass and aa.mass).

    Nonetheless, I will add your example to the Rd file, since there is no example of how to deal with missing masses at the moment.

  7. Barry Grant

    This is the one option I did not try because I thought the /dots extra argumets were only going to build.hessian(). I now see from the docs that they also go to aa2mass().

    Simplifying is nearly always good. However, in this case it is much easier to use mass.custom, to add the specific mass of one missing residue, rather than specifying a vector of all residue masses.

    So perhaps the solution here is to just document this option, and other major options that /dots can have, in the Rd file for nma. Down side is that if these other functions change we need to update this nma.Rd file also. I will go ahead and edit nma.Rd as it makes sense to me. Let me know if I have broken anything.

  8. Log in to comment