HW8 - R Markdown Template of Course Project

4 minute read



Render R Markdown (Rmd) of your project

Students will choose for this assignment the Rmd template of the workflow they are expected to complete for their challenge project, meaning either the RNA-Seq or the ChIP-Seq workflow that were both covered in class.

To get started with the following homework tasks, log in to your HPCC account and create under the course project path /bigdata/gen242/<user_name> assigned to you the corresponding workflow template using the genWorkenvir function. Open with vim/nvim the Rmd file located in the root directory of the chosen workflow. Next make the following changes (1.-8.) to the R Markdown file, render it to HTML and PDF format, and then submit the rendered report along with the corresponding Rmd source file to GitHub Classroom as instructed below. The changes to include in the R Markdown are:

Tasks

Read the basics of Rmarkdown formatting.

  1. In the section relating to your challenge project, add a short paragraph describing the analysis steps you have chosen to perform as part of your challenge project.
  2. In the challenge project section, cite the reference(s) of the paper(s) you have chosen to present in class as part of your course project. For this add the reference in BibTeX format to the bibtex.tex file located in the root directory of the workflow, and then cite it in the text of the Rmd file so that the properly rendered citation shows up in the text and the corresponding reference is get automatically added to the reference list when running rmarkdown::render. Note, references in BibTeX format can be obtained from Google Scholar, Paperpile or most other reference management software. More detailed information about managing references in R Markdown files is here.
  3. Add a mathematical equation to the challenge project section.
  4. Evaluate an R expression in the text as inline R code (see here) of your challenge project, e.g. mathematical or number from an existing R oject such as mean value of the first column of the iris data.frame.
  5. Add a code chunk that auto-generates the barplot for HW3C. This barplot should be embedded in the rendered report without saving it intermediately to a file.
  6. Insert the targets file of your workflow (default toy data is sufficient) as an interactive table using the DT package. An example is given in the table section of the R Markdown manual here.
  7. Use the rmarkdown::render() function to render the report to both HTML and PDF formats (details are here). Important: for this assignment it is not relevant to evaluate the code chunks for the actual analysis steps of the analysis workflow. Only the chunks required for the above tasks need to be evaluated. Also, when embedding the targets file under step 6 into the report, the interactive table generated by the DT package can only be included in the HTML version of the report. To including this table in the PDF version of the report, use the static knitr::kable option instead as outlined here.
  8. Submit the Rmd, PDF and HTML file for the report to the corresponding repos on GitHub Classroom (see below).

Homework submission

Use your GitHub Classroom repository from the last time, the project repository. Create a directory /hw8 and upload your files in there.

  1. Your Rmarkdown file, name it hw8.Rmd.
  2. HTML rendered file, name it hw8.html.
  3. PDF rendered file, name it hw8.pdf.

bibtex file is not required.

Grading

  • Upload Rmd: 1
  • Upload HTML: 1
  • Upload PDF: 1
  • Step 1-6: 1 each

Total 9

Due date

This homework is due in one week on Thu, May 13th at 6:00 PM.

Homework Solutions

All solutions for HW08 can be looked up in the R Markdown tutorial of this class. The source code is available in the Rmd file and the rendered result in the corresponding HTML file. As in all tutorial pages of this site, the Rmd files can also be accessed via a link located in the header section of each tutorial page.

Last modified 2021-05-14: some edits (c7133a5ac)