Skip to content

Commit

Permalink
Deployed 350c889 with MkDocs version: 1.6.1
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Sep 16, 2024
0 parents commit a6b5bc7
Show file tree
Hide file tree
Showing 50 changed files with 11,805 additions and 0 deletions.
Empty file added .nojekyll
Empty file.
120 changes: 120 additions & 0 deletions 404.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="author" content="Shaojun Xie" />
<link rel="shortcut icon" href="/img/favicon.ico" />
<title>Lab note for UMD BIOI611</title>
<link rel="stylesheet" href="/css/theme.css" />
<link rel="stylesheet" href="/css/theme_extra.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/styles/github.min.css" />

<!--[if lt IE 9]>
<script src="/js/html5shiv.min.js"></script>
<![endif]-->
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/highlight.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/languages/yaml.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/languages/rust.min.js"></script>
<script>hljs.highlightAll();</script>
</head>

<body class="wy-body-for-nav" role="document">

<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side stickynav">
<div class="wy-side-scroll">
<div class="wy-side-nav-search">
<a href="/." class="icon icon-home"> Lab note for UMD BIOI611
</a><div role="search">
<form id ="rtd-search-form" class="wy-form" action="//search.html" method="get">
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" title="Type search term here" />
</form>
</div>
</div>

<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<p class="caption"><span class="caption-text">Get ready for the course</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="/basic_linux/">Basic Linux</a>
</li>
</ul>
<p class="caption"><span class="caption-text">Bulk RNA-seq</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="/bulkRNAseq_lab/">Prepare data</a>
</li>
<li class="toctree-l1"><a class="reference internal" href="/FASTQ_PHRED/">Phred score in FASTQ</a>
</li>
</ul>
</div>
</div>
</nav>

<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="Mobile navigation menu">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="/.">Lab note for UMD BIOI611</a>

</nav>
<div class="wy-nav-content">
<div class="rst-content"><div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="/." class="icon icon-home" aria-label="Docs"></a></li>
<li class="wy-breadcrumbs-aside">
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div class="section" itemprop="articleBody">


<h1 id="404-page-not-found">404</h1>

<p><strong>Page not found</strong></p>


</div>
</div><footer>

<hr/>

<div role="contentinfo">
<!-- Copyright etc -->
<p>Copyright &copy; 2024 Shaojun Xie</p>
</div>

Built with <a href="https://www.mkdocs.org/">MkDocs</a> using a <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>

</div>
</div>

</section>

</div>

<div class="rst-versions" role="note" aria-label="Versions">
<span class="rst-current-version" data-toggle="rst-current-version">

<span>
<a href="https://github.com/Bix4UMD/BIOI611_lab.git" class="fa fa-code-fork" style="color: #fcfcfc"> Bix4UMD/BIOI611_lab</a>
</span>



</span>
</div>
<script src="/js/jquery-3.6.0.min.js"></script>
<script>var base_url = "/";</script>
<script src="/js/theme_extra.js"></script>
<script src="/js/theme.js"></script>
<script src="/search/main.js"></script>
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>

</body>
</html>
127 changes: 127 additions & 0 deletions FASTQ_PHRED.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
{
"cells": [
{
"cell_type": "raw",
"metadata": {},
"source": [
"---\n",
"title: \"PRED Score in Bioinformatics\"\n",
"format: \n",
" pptx:\n",
" reference-doc: template_UMD.pptx\n",
"editor: visual\n",
"---"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## What is PHRED Scores\n",
"\n",
"A Phred score is a measure of the probability that a base call in a DNA sequencing read is incorrect. It is a logarithmic scale, meaning that a small change in the Phred score represents a large change in the probability of an error.\n",
"\n",
"$$Q = -10 \\cdot \\log_{10}(P)$$\n",
"\n",
"Where:\n",
"\n",
"- Q is the PHRED score.\n",
"\n",
"- P is the probability that the base was called incorrectly.\n",
"\n",
"For example:\n",
"\n",
"- **Q = 20**: This corresponds to a 1 in 100 probability of an incorrect base call, or an accuracy of 99%.\n",
"\n",
"- **Q = 30**: This corresponds to a 1 in 1000 probability of an incorrect base call, or an accuracy of 99.9%.\n",
"\n",
"- **Q = 40**: This corresponds to a 1 in 10,000 probability of an incorrect base call, or an accuracy of 99.99%.\n",
"\n",
"```{r}\n",
"# Print the header\n",
"cat(sprintf(\"%-5s\\t\\t%-10s\\n\", \"Phred\", \"Prob of\"))\n",
"cat(sprintf(\"%-5s\\t\\t%-10s\\n\", \"score\", \"Incorrect call\"))\n",
"\n",
"# Loop through Phred scores from 0 to 41\n",
"for (phred in 0:41) {\n",
" cat(sprintf(\"%-5d\\t\\t%0.5f\\n\", phred, 10^(phred / -10)))\n",
"}\n",
"```\n",
"\n",
"## What is ASCII \n",
"\n",
"ASCII (American Standard Code for Information Interchange) is used to represent characters in computers. We can represent Phred scores using ASCII characters. The advantage is that the quality information can be esisly stored in text based FASTQ file.\n",
"\n",
"Not all [ASCII characters](https://www.columbia.edu/kermit/ascii.html) are printable. The first printable ASCII character is `!` and the decimal code for the character for `!` is 33. \n",
"\n",
"\n",
"```{r}\n",
"# Store output in a vector to fit on a slide\n",
"output <- c(sprintf(\"%-8s %-8s\", \"Character\", \"ASCII #\"))\n",
"\n",
"# Loop through ASCII values from 33 to 89\n",
"for (i in 33:89) {\n",
" output <- c(output, sprintf(\"%-8s %-8d\", intToUtf8(i), i))\n",
"}\n",
"\n",
"# Print the output in a single block (e.g., to fit on a slide)\n",
"cat(paste(output, collapse = \"\\n\"))\n",
"```\n",
"## Phred scores in FASTQ file \n",
"\n",
"In a FASTQ file, Phred scores are represented as ASCII characters. These characters are converted back to numeric values (PHRED scores) based on the encoding scheme used:\n",
"\n",
"1. **PHRED+33 Encoding (Sanger/Illumina 1.8+)**:\n",
"\n",
" - The ASCII character for a quality score Q is calculated as:\n",
"\n",
" ASCII character=chr(Q+33)\n",
"\n",
" - For example:\n",
"\n",
" - A PHRED score of 30 is encoded as `chr(30 + 33) = chr(63)`, which corresponds to the ASCII character `?`.\n",
"\n",
"2. **PHRED+64 Encoding (Illumina 1.3-1.7)**:\n",
"\n",
" - The ASCII character for a quality score QQQ is calculated as: \n",
" \n",
" ASCII character=chr(Q+64)\n",
"\n",
" - For example:\n",
"\n",
" - A PHRED score of 30 is encoded as `chr(30 + 64) = chr(94)`, which corresponds to the ASCII character `^`.\n",
"\n",
"\n",
"```{r}\n",
"# Print the header\n",
"cat(sprintf(\"%-5s\\t\\t%-10s\\t%-6s\\t\\t%-10s\\n\", \"Phred\", \"Prob. of\", \"ASCII\", \"ASCII\"))\n",
"cat(sprintf(\"%-5s\\t\\t%-10s\\t%-6s\\t%-10s\\n\", \"score\", \"Error\", \"Phred+33\", \"Phred+64\"))\n",
"\n",
"# Loop through Phred scores from 0 to 41\n",
"for (phred in 0:41) {\n",
" # Calculate the probability of error\n",
" prob_error <- 10^(phred / -10)\n",
"\n",
" # Convert Phred scores to ASCII characters\n",
" ascii_phred33 <- intToUtf8(phred + 33)\n",
" ascii_phred64 <- intToUtf8(phred + 64)\n",
"\n",
" # Print the results in a formatted table\n",
" cat(sprintf(\"%-5d\\t\\t%0.5f\\t\\t%-6s\\t\\t%-10s\\n\", \n",
" phred, prob_error, \n",
" ascii_phred33, ascii_phred64))\n",
"}\n",
"```\n"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
}
},
"nbformat": 4,
"nbformat_minor": 4
}
Loading

0 comments on commit a6b5bc7

Please sign in to comment.