knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
While MotifBinner is designed to process Primer ID sequences, it is build on a more general architecture. It is a general computational pipeline that applies operations to input data. The main features are:
A cost of the detailed reporting and tracking is that large amounts of memory is consumed to keep all various inputs and outputs available for all steps. While some functionality has been added to remove unnecessary data from memory, many further optimazations are possible. During our development and usage of MotifBinner we did not run into the limitations of our hardware, but our datasets were not particularly large (less than 1GB).
The package is designed to be a computational pipeline. If applies operations to a large list called 'all_results' that accumulates all the results and metrics required to render the reports. Each operation adds another element into all_results. Each element in all_results should have the following sub-elements: (this is not enforced programmatically):
This package is designed to apply a series of steps: specified by a config to two input fastq files resulting from pair-end MiSeq sequencing producing a list of results called all results and a set of comprehensive reports.
Given two input fastq files resulting from pair-end MiSeq sequencing and a number of options, MotifBinner2 will apply a series of operations to the input data. The operations are highly structured. Each operation has an action function that performs the operation on the data given to it. This function packages the result and a large set of metrics describing the operation into a list and assigns a class to the list using R's S3 system. S3 is an extremely basic class system that allows methods to be overloaded for specific datatypes. In addition to the its action function which serves as a constructor, each operation also has a computeMetrics, saveToDisk and print method. Lastly, for each operation, an Rmarkdown template must be provided. Then the genReport function is calles on a result list, then it will extract the class of the result and use it to match the result list to a suitable template. The genReport function will then call knitr::knit to generate an html report for the result list.
The series of operations that must be performed is controlled by a config list.
Keep it for easy reference for now.
Vignettes are long form documentation commonly included in packages. Because they are part of the distribution of the package, they need to be as compact as possible. The html_vignette
output type provides a custom style sheet (and tweaks some options) to ensure that the resulting html is as small as possible. The html_vignette
format:
Note the various macros within the vignette
section of the metadata block above. These are required in order to instruct R how to build the vignette. Note that you should change the title
field and the \VignetteIndexEntry
to match the title of your vignette.
The html_vignette
template includes a basic CSS theme. To override this theme you can specify your own CSS in the document metadata as follows:
output: rmarkdown::html_vignette: css: mystyles.css
The figure sizes have been customised so that you can easily put two images side-by-side.
plot(1:10) plot(10:1)
You can enable figure captions by fig_caption: yes
in YAML:
output: rmarkdown::html_vignette: fig_caption: yes
Then you can use the chunk option fig.cap = "Your figure caption."
in knitr.
You can write math expressions, e.g. $Y = X\beta + \epsilon$, footnotes^[A footnote here.], and tables, e.g. using knitr::kable()
.
knitr::kable(head(mtcars, 10))
Also a quote using >
:
"He who gives up [code] safety for [code] speed deserves neither." (via)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.