Vignette updates

Issue #109 resolved
Lars Skjærven created an issue

Both the Trajectory and PCA vignettes are in two versions in the vignettes_devel/ directory. i.e.:

  • Bio3D_pca.Rnw
  • Bio3D_pca.Rmd

the Rmd version seems to be the most up-to-date, but in the ver_devel/bio3d/ directory, the PDFs seem to originate from the .Rnw version. Should we keep two versions? the Rnw makes the nicest PDFs, but I think we need the Rmd for the web-site. hmmm

Comments (15)

  1. Lars Skjærven reporter

    In Bio3D_pca.Rmd: if a user wants to follow the tutorial (without attaching the transducin package) the annotation[, "color"] has not been created - thus leaving the user with an error when attempting to plot the dendrogram with colors. We could instead color by cutree(hc.rd, k=3) (?). labels for the dendrogram should moreover be substr(basename(pdbs$id), 1, 6). Rownames of the pdbs$xyz ($resno and $ali) object is not the PDB code, so a.xyz <- pdbs$xyz["1TAG_A",] wont work. suggesting rownames(pdbs$ali) <- substr(basename(pdbs$id), 1,6) or use indices. sorry to be picky :) I can change this, but wanted to check with your guys first..?

  2. Xinqiu Yao

    I guess cutree(hc.rd, k=3) will probably give an incorrect answer, since RMSD clustering does not separate states well (that is actually how we show that PCA clustering gives better results in the vignette). I think we have pointed it out in section 2.3 that to go through the example you need attach(transducin). Maybe it is better to keep, isn't it?

    About the rownames of pdbs$xyz, yes it is good to have PDB code as rownames. Thanks for pointing it out and help to change!

    We have discussed about using Rnw and/or Rmd for future vignettes writing and updating. The best way is we update one and convert it to another, since Rnw gives better PDF file whereas Rmd gives better HTML. Up to now I haven't found any command to nicely do such conversion. I will keep tracking this issue, but currently I think we should focus on Rmd files and make sure they are the most updated. I will try to synchronize Rnw files as possible as I can. What do you think?

  3. Lars Skjærven reporter

    Ok- I've updated the vignette slightly. hopefully you agree to these changes. Changes are only done in the Rmd file though.

    Rnw / Rmd: Jepp, I agree. The PDFs generated from Rnw are very nice.

  4. Xinqiu Yao

    The changes are nice, thanks! I am just wondering: Does it make sense that we keep all vignettes in a R script with Roxygen comments? Knitr supports conversion from R to both "Rmd" and "Rnw" now. I am trying to make an example for Bio3d_PCA and see how it works.

  5. Xinqiu Yao

    Hi guys,

    I am now looking at the R Markdown Version2, which could be potential solution for keeping two versions of the same vignette in one file. In the new Rmd format, metadata is supported, in which we can specify title, authors, bibliography, output formats, and various other options for formatting. (See this website for more details: http://rmarkdown.rstudio.com/).

    I've given a try for the PCA vignette and it seems works, although there are still some need to be tidied up (See this commit). To get it work, just run following command in a R session:

    rmarkdown::render("Bio3D_pca.Rmd", "all")
    

    And it will generate all PDF, MD and HTML files. Let me know what you think. Does it worth going further?

  6. Lars Skjærven reporter

    That would be great. How would the PDF look like? Similar to the old PDFs from Rnw?

    I get this error when trying to generate the PDF:

    ! LaTeX Error: File `titling.sty' not found.
    

    HTML works fine though.

  7. Xinqiu Yao

    Thanks Lars! I didn't encounter the error of missing .sty file...

    I've updated the file a little bit. Now it can generate a PDF file very close to Rnw-generated one. Some points still need to note:

    • Syntax highlighting is a little bit different
    • Size of external figures cannot be adjusted within the Rmd file
    • Somehow affiliation doesn't work
    • Hopefully the generated MD file works properly with Joomla

    I may start updating other vignettes soon. Let me know if you find any problem!

  8. Lars Skjærven reporter

    I'm gussing it should be fine with joomla. It's still plain MD (right?)

    I can do the NMA one if you like.

  9. Log in to comment