read in multiple dcd from NAMD

Issue #319 resolved
Nancy Deng created an issue

I am new to the bio3D in R, but played with the tutorial. And I really like it.

I have multiple .dcd trajectory files from NAMD output, and they are every 250 ps interval.

So just wonder how to read in the multiple files.

I saw a post a while ago, but seems different format, just wonder whether anyone can help me out of this.

thanks a lot!!

Nancy

Comments (5)

  1. Xinqiu Yao

    You can construct a loop to repeatedly read files and combine them afterwards. For example,

    # suppose your DCD files are all ended with '.dcd.' and placed under the directory 'trajs' 
    files <- list.file('trajs', pattern='.*\\.dcd$', full.names=TRUE)
    xyz <- lapply(files, read.dcd)
    
    # combine trajs into one matrix
    xyz <- do.call(rbind, xyz)
    class(xyz) <- c('xyz', 'matrix')
    
  2. Nancy Deng reporter

    Thanks a lot xin-qiu for your promt response.

    Just wonder whether I can call you for some brief discussion, such as how to interpret the PC analysis etc.

    Best regards,

    Nancy

    Nancy Deng, Ph.D. | Principal Scientist, Computational Chemistry & Molecular Modeling Zoetis Inc| Global Therapeutics Research | 333 Portage Street, Kalamazoo, MI 49007 Office: 2693599121 | jinxianancy.deng@zoetis.com

  3. Xinqiu Yao

    Hi Nancy,

    You are welcomed to ask questions! Create issues here or send Email directly to xinqyao@umich.edu.

  4. Log in to comment