This code is designed for visualizing and summarizing QC data from targeted amplicon sequencing of Plasmodium.
The QC report is available in both Quarto Markdown (.qmd) and Jupyter Notebook (.ipynb) formats. You can choose whichever format is more convenient for your workflow.
Using the Quarto Markdown File (QC_report.qmd)
- Open the .qmd file in an editor like RStudio or Visual Studio Code.
- Edit the paths to the required input files and any thresholds at the beginning of the document to match your data location.
- To render the document and generate an HTML report:
- In RStudio, click Render.
- In Visual Studio Code, use the Quarto extension to render the document.
- The rendered HTML report will summarize your QC data and display the visualizations.
Using the Jupyter Notebook (QC_report.ipynb)
- Open the .ipynb file in Jupyter Notebook.
- Edit the paths to the required input files and any thresholds at the beginning of the document to match your data location.
- Run through the code interactively.
- Select File > Save and Export Notebook As > HTML to save the rendered notebook as an HTML file.
To proceed, you must provide the results directory from the Mad4hatter pipeline, which should include the following files:
- sample_coverage.txt
- amplicon_coverage.txt
- allele_data.txt
Additionally, a sample manifest (CSV) is required. This file must contain the following fields:
- SampleID – Unique identifier for each sample.
- SampleType – Specifies whether the entry is a sample, positive control, or negative control.
- Batch – Identifies a group of samples processed simultaneously by the same individual.
- Column – The well column where the sample was placed in the plate.
- Row – The well row where the sample was placed in the plate.
- Parasitemia – The qPCR value for the sample.
If you'd like to make changes to the Jupyter Notebook, follow these steps:
- Edit the Notebook (QC_report.ipynb) as needed.
- Once finished, convert the notebook to a Quarto Markdown file:
quarto convert QC_report.ipynb- In the converted .qmd file, ensure the following YAML header is present at the top for proper rendering:
---
title: "QC Report"
author: ""
output:
html_document:
code-fold: true
strip-comments: true
toc: true
execute:
echo: false
---This will ensure that the report is formatted correctly when rendered as HTML.
To run the Shiny app, follow these steps:
- Clone the repository to your local machine:
git clone <repository_url>- Install dependencies by running the following command in R:
install.packages(c("shiny", "ggplot2", "dplyr", "quarto"))- Run the app with the following command:
Rscript app.RThis will launch the Shiny app on your local machine where you can interactively explore and visualize your QC data.
- Extract out the functions as a package
- Turn this into an R shiny app
- Make sure that it works with multiple plates etc and plots format correctly
- Add option for well instead of row, column
- manifest could be tsv, csv...
- Write a generate manifest function which populates sampleID with the columns from madhatter repo
This code is based on QC plots developed by
- Andrés Aranda-Diaz
- Jessica Briggs
- Will Louie