mirror of
https://github.com/metabarcoding/obitools4.git
synced 2025-06-29 16:20:46 +00:00
633 lines
35 KiB
HTML
633 lines
35 KiB
HTML
<!DOCTYPE html>
|
||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head>
|
||
|
||
<meta charset="utf-8">
|
||
<meta name="generator" content="quarto-1.2.256">
|
||
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
||
|
||
|
||
<title>OBITools V4 - 2 File formats usable with OBITools</title>
|
||
<style>
|
||
code{white-space: pre-wrap;}
|
||
span.smallcaps{font-variant: small-caps;}
|
||
div.columns{display: flex; gap: min(4vw, 1.5em);}
|
||
div.column{flex: auto; overflow-x: auto;}
|
||
div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
|
||
ul.task-list{list-style: none;}
|
||
ul.task-list li input[type="checkbox"] {
|
||
width: 0.8em;
|
||
margin: 0 0.8em 0.2em -1.6em;
|
||
vertical-align: middle;
|
||
}
|
||
div.csl-bib-body { }
|
||
div.csl-entry {
|
||
clear: both;
|
||
}
|
||
.hanging div.csl-entry {
|
||
margin-left:2em;
|
||
text-indent:-2em;
|
||
}
|
||
div.csl-left-margin {
|
||
min-width:2em;
|
||
float:left;
|
||
}
|
||
div.csl-right-inline {
|
||
margin-left:2em;
|
||
padding-left:1em;
|
||
}
|
||
div.csl-indent {
|
||
margin-left: 2em;
|
||
}
|
||
</style>
|
||
|
||
|
||
<script src="site_libs/quarto-nav/quarto-nav.js"></script>
|
||
<script src="site_libs/quarto-nav/headroom.min.js"></script>
|
||
<script src="site_libs/clipboard/clipboard.min.js"></script>
|
||
<script src="site_libs/quarto-search/autocomplete.umd.js"></script>
|
||
<script src="site_libs/quarto-search/fuse.min.js"></script>
|
||
<script src="site_libs/quarto-search/quarto-search.js"></script>
|
||
<meta name="quarto:offset" content="./">
|
||
<link href="./tutorial.html" rel="next">
|
||
<link href="./installation.html" rel="prev">
|
||
<script src="site_libs/quarto-html/quarto.js"></script>
|
||
<script src="site_libs/quarto-html/popper.min.js"></script>
|
||
<script src="site_libs/quarto-html/tippy.umd.min.js"></script>
|
||
<script src="site_libs/quarto-html/anchor.min.js"></script>
|
||
<link href="site_libs/quarto-html/tippy.css" rel="stylesheet">
|
||
<link href="site_libs/quarto-html/quarto-syntax-highlighting.css" rel="stylesheet" id="quarto-text-highlighting-styles">
|
||
<script src="site_libs/bootstrap/bootstrap.min.js"></script>
|
||
<link href="site_libs/bootstrap/bootstrap-icons.css" rel="stylesheet">
|
||
<link href="site_libs/bootstrap/bootstrap.min.css" rel="stylesheet" id="quarto-bootstrap" data-mode="light">
|
||
<script id="quarto-search-options" type="application/json">{
|
||
"location": "sidebar",
|
||
"copy-button": false,
|
||
"collapse-after": 3,
|
||
"panel-placement": "start",
|
||
"type": "textbox",
|
||
"limit": 20,
|
||
"language": {
|
||
"search-no-results-text": "No results",
|
||
"search-matching-documents-text": "matching documents",
|
||
"search-copy-link-title": "Copy link to search",
|
||
"search-hide-matches-text": "Hide additional matches",
|
||
"search-more-match-text": "more match in this document",
|
||
"search-more-matches-text": "more matches in this document",
|
||
"search-clear-button-title": "Clear",
|
||
"search-detached-cancel-button-title": "Cancel",
|
||
"search-submit-button-title": "Submit"
|
||
}
|
||
}</script>
|
||
|
||
|
||
</head>
|
||
|
||
<body class="nav-sidebar floating">
|
||
|
||
<div id="quarto-search-results"></div>
|
||
<header id="quarto-header" class="headroom fixed-top">
|
||
<nav class="quarto-secondary-nav" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar" aria-controls="quarto-sidebar" aria-expanded="false" aria-label="Toggle sidebar navigation" onclick="if (window.quartoToggleHeadroom) { window.quartoToggleHeadroom(); }">
|
||
<div class="container-fluid d-flex justify-content-between">
|
||
<h1 class="quarto-secondary-nav-title"><span class="chapter-number">2</span> <span class="chapter-title">File formats usable with <em>OBITools</em></span></h1>
|
||
<button type="button" class="quarto-btn-toggle btn" aria-label="Show secondary navigation">
|
||
<i class="bi bi-chevron-right"></i>
|
||
</button>
|
||
</div>
|
||
</nav>
|
||
</header>
|
||
<!-- content -->
|
||
<div id="quarto-content" class="quarto-container page-columns page-rows-contents page-layout-article">
|
||
<!-- sidebar -->
|
||
<nav id="quarto-sidebar" class="sidebar collapse sidebar-navigation floating overflow-auto">
|
||
<div class="pt-lg-2 mt-2 text-left sidebar-header">
|
||
<div class="sidebar-title mb-0 py-0">
|
||
<a href="./">OBITools V4</a>
|
||
</div>
|
||
</div>
|
||
<div class="mt-2 flex-shrink-0 align-items-center">
|
||
<div class="sidebar-search">
|
||
<div id="quarto-search" class="" title="Search"></div>
|
||
</div>
|
||
</div>
|
||
<div class="sidebar-menu-container">
|
||
<ul class="list-unstyled mt-1">
|
||
<li class="sidebar-item">
|
||
<div class="sidebar-item-container">
|
||
<a href="./index.html" class="sidebar-item-text sidebar-link">Preface</a>
|
||
</div>
|
||
</li>
|
||
<li class="sidebar-item sidebar-item-section">
|
||
<div class="sidebar-item-container">
|
||
<a href="./intro.html" class="sidebar-item-text sidebar-link">The OBITools</a>
|
||
<a class="sidebar-item-toggle text-start" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-1" aria-expanded="true">
|
||
<i class="bi bi-chevron-right ms-2"></i>
|
||
</a>
|
||
</div>
|
||
<ul id="quarto-sidebar-section-1" class="collapse list-unstyled sidebar-section depth1 show">
|
||
<li class="sidebar-item">
|
||
<div class="sidebar-item-container">
|
||
<a href="./installation.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">1</span> <span class="chapter-title">Installation of the <em>OBITools</em></span></a>
|
||
</div>
|
||
</li>
|
||
<li class="sidebar-item">
|
||
<div class="sidebar-item-container">
|
||
<a href="./formats.html" class="sidebar-item-text sidebar-link active"><span class="chapter-number">2</span> <span class="chapter-title">File formats usable with <em>OBITools</em></span></a>
|
||
</div>
|
||
</li>
|
||
<li class="sidebar-item">
|
||
<div class="sidebar-item-container">
|
||
<a href="./tutorial.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">3</span> <span class="chapter-title">OBITools V4 Tutorial</span></a>
|
||
</div>
|
||
</li>
|
||
</ul>
|
||
</li>
|
||
<li class="sidebar-item sidebar-item-section">
|
||
<div class="sidebar-item-container">
|
||
<a href="./commands.html" class="sidebar-item-text sidebar-link">The *OBITools V4* commands</a>
|
||
<a class="sidebar-item-toggle text-start" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-2" aria-expanded="true">
|
||
<i class="bi bi-chevron-right ms-2"></i>
|
||
</a>
|
||
</div>
|
||
<ul id="quarto-sidebar-section-2" class="collapse list-unstyled sidebar-section depth1 show">
|
||
<li class="sidebar-item">
|
||
<div class="sidebar-item-container">
|
||
<a href="./inupt.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">4</span> <span class="chapter-title">Specifying the data input to <em>OBITools</em> commands</span></a>
|
||
</div>
|
||
</li>
|
||
<li class="sidebar-item">
|
||
<div class="sidebar-item-container">
|
||
<a href="./output.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">5</span> <span class="chapter-title">Controling OBITools outputs</span></a>
|
||
</div>
|
||
</li>
|
||
<li class="sidebar-item">
|
||
<div class="sidebar-item-container">
|
||
<a href="./common_options.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">6</span> <span class="chapter-title">Options common to most of the <em>OBITools</em> commands</span></a>
|
||
</div>
|
||
</li>
|
||
<li class="sidebar-item">
|
||
<div class="sidebar-item-container">
|
||
<a href="./expressions.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">7</span> <span class="chapter-title">OBITools expression language</span></a>
|
||
</div>
|
||
</li>
|
||
<li class="sidebar-item">
|
||
<div class="sidebar-item-container">
|
||
<a href="./comm_metabarcode_design.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">8</span> <span class="chapter-title">Metabarcode design and quality assessment</span></a>
|
||
</div>
|
||
</li>
|
||
<li class="sidebar-item">
|
||
<div class="sidebar-item-container">
|
||
<a href="./comm_reformat.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">9</span> <span class="chapter-title">File format conversions</span></a>
|
||
</div>
|
||
</li>
|
||
<li class="sidebar-item">
|
||
<div class="sidebar-item-container">
|
||
<a href="./comm_annotation.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">10</span> <span class="chapter-title">Sequence annotations</span></a>
|
||
</div>
|
||
</li>
|
||
<li class="sidebar-item">
|
||
<div class="sidebar-item-container">
|
||
<a href="./comm_computation.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">11</span> <span class="chapter-title">Computations on sequences</span></a>
|
||
</div>
|
||
</li>
|
||
<li class="sidebar-item">
|
||
<div class="sidebar-item-container">
|
||
<a href="./comm_sampling.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">12</span> <span class="chapter-title">Sequence sampling and filtering</span></a>
|
||
</div>
|
||
</li>
|
||
<li class="sidebar-item">
|
||
<div class="sidebar-item-container">
|
||
<a href="./comm_utilities.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">13</span> <span class="chapter-title">Utilities</span></a>
|
||
</div>
|
||
</li>
|
||
</ul>
|
||
</li>
|
||
<li class="sidebar-item sidebar-item-section">
|
||
<span class="sidebar-item-text sidebar-link text-start">The GO *OBITools* library</span>
|
||
</li>
|
||
<li class="sidebar-item sidebar-item-section">
|
||
<div class="sidebar-item-container">
|
||
<a class="sidebar-item-text sidebar-link text-start" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-4" aria-expanded="true">Appendices</a>
|
||
<a class="sidebar-item-toggle text-start" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-4" aria-expanded="true">
|
||
<i class="bi bi-chevron-right ms-2"></i>
|
||
</a>
|
||
</div>
|
||
<ul id="quarto-sidebar-section-4" class="collapse list-unstyled sidebar-section depth1 show">
|
||
<li class="sidebar-item">
|
||
<div class="sidebar-item-container">
|
||
<a href="./annexes.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">A</span> <span class="chapter-title">Annexes</span></a>
|
||
</div>
|
||
</li>
|
||
<li class="sidebar-item">
|
||
<div class="sidebar-item-container">
|
||
<a href="./references.html" class="sidebar-item-text sidebar-link">References</a>
|
||
</div>
|
||
</li>
|
||
</ul>
|
||
</li>
|
||
</ul>
|
||
</div>
|
||
</nav>
|
||
<!-- margin-sidebar -->
|
||
<div id="quarto-margin-sidebar" class="sidebar margin-sidebar">
|
||
<nav id="TOC" role="doc-toc" class="toc-active">
|
||
<h2 id="toc-title">Table of contents</h2>
|
||
|
||
<ul>
|
||
<li><a href="#the-dna-sequence-data" id="toc-the-dna-sequence-data" class="nav-link active" data-scroll-target="#the-dna-sequence-data"><span class="toc-section-number">2.1</span> The DNA sequence data</a>
|
||
<ul class="collapse">
|
||
<li><a href="#sec-iupac" id="toc-sec-iupac" class="nav-link" data-scroll-target="#sec-iupac"><span class="toc-section-number">2.1.1</span> The IUPAC Code</a></li>
|
||
<li><a href="#sec-fasta" id="toc-sec-fasta" class="nav-link" data-scroll-target="#sec-fasta"><span class="toc-section-number">2.1.2</span> The <em>FASTA</em> sequence format</a></li>
|
||
<li><a href="#sec-fastq" id="toc-sec-fastq" class="nav-link" data-scroll-target="#sec-fastq"><span class="toc-section-number">2.1.3</span> The <em>FASTQ</em> sequence format</a></li>
|
||
</ul></li>
|
||
<li><a href="#the-taxonomy-files" id="toc-the-taxonomy-files" class="nav-link" data-scroll-target="#the-taxonomy-files"><span class="toc-section-number">2.2</span> The taxonomy files</a></li>
|
||
<li><a href="#the-sample-description-file" id="toc-the-sample-description-file" class="nav-link" data-scroll-target="#the-sample-description-file"><span class="toc-section-number">2.3</span> The sample description file</a></li>
|
||
</ul>
|
||
</nav>
|
||
</div>
|
||
<!-- main -->
|
||
<main class="content" id="quarto-document-content">
|
||
|
||
<header id="title-block-header" class="quarto-title-block default">
|
||
<div class="quarto-title">
|
||
<h1 class="title d-none d-lg-block"><span class="chapter-number">2</span> <span class="chapter-title">File formats usable with <em>OBITools</em></span></h1>
|
||
</div>
|
||
|
||
|
||
|
||
<div class="quarto-title-meta">
|
||
|
||
|
||
|
||
|
||
</div>
|
||
|
||
|
||
</header>
|
||
|
||
<p><em>OBITools</em> manipulate have to manipulate DNA sequence data and taxonomical data. They can use some supplentary metadata describing the experiment and produce some stats about the processed DNA data. All the manipulated data are stored in text files, following standard data format.</p>
|
||
<section id="the-dna-sequence-data" class="level2" data-number="2.1">
|
||
<h2 data-number="2.1" class="anchored" data-anchor-id="the-dna-sequence-data"><span class="header-section-number">2.1</span> The DNA sequence data</h2>
|
||
<p>Sequences can be stored following various format. <em>OBITools</em> knows some of them. The central formats for sequence files manipulated by <em>OBITools</em> scripts are the <a href="#sec-fasta"><em>FASTA</em></a> and <a href="#sec-fastq"><em>FASTQ</em></a> format. <em>OBITools</em> extends the both these formats by specifying a syntax to include in the definition line data qualifying the sequence. All file formats use the <a href="#sec-iupac"><code>IUPAC</code></a> code for encoding nucleotides.</p>
|
||
<p>Moreover these two formats that can be used as input and output formats, <em>OBITools4</em> can read the following format :</p>
|
||
<ul>
|
||
<li><a href="https://ena-docs.readthedocs.io/en/latest/submit/fileprep/flat-file-example.html">EBML flat file</a> format (use by ENA)</li>
|
||
<li><a href="https://www.ncbi.nlm.nih.gov/Sitemap/samplerecord.html">Genbank flat file format</a></li>
|
||
<li><a href="https://pythonhosted.org/OBITools/scripts/ecoPCR.html">ecoPCR output files</a></li>
|
||
</ul>
|
||
<section id="sec-iupac" class="level3" data-number="2.1.1">
|
||
<h3 data-number="2.1.1" class="anchored" data-anchor-id="sec-iupac"><span class="header-section-number">2.1.1</span> The IUPAC Code</h3>
|
||
<p>The International Union of Pure and Applied Chemistry (<a href="">IUPAC</a>) defined the standard code for representing protein or DNA sequences.</p>
|
||
<table class="table">
|
||
<thead>
|
||
<tr class="header">
|
||
<th><strong>Code</strong></th>
|
||
<th><strong>Nucleotide</strong></th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr class="odd">
|
||
<td>A</td>
|
||
<td>Adenine</td>
|
||
</tr>
|
||
<tr class="even">
|
||
<td>C</td>
|
||
<td>Cytosine</td>
|
||
</tr>
|
||
<tr class="odd">
|
||
<td>G</td>
|
||
<td>Guanine</td>
|
||
</tr>
|
||
<tr class="even">
|
||
<td>T</td>
|
||
<td>Thymine</td>
|
||
</tr>
|
||
<tr class="odd">
|
||
<td>U</td>
|
||
<td>Uracil</td>
|
||
</tr>
|
||
<tr class="even">
|
||
<td>R</td>
|
||
<td>Purine (A or G)</td>
|
||
</tr>
|
||
<tr class="odd">
|
||
<td>Y</td>
|
||
<td>Pyrimidine (C, T, or U)</td>
|
||
</tr>
|
||
<tr class="even">
|
||
<td>M</td>
|
||
<td>C or A</td>
|
||
</tr>
|
||
<tr class="odd">
|
||
<td>K</td>
|
||
<td>T, U, or G</td>
|
||
</tr>
|
||
<tr class="even">
|
||
<td>W</td>
|
||
<td>T, U, or A</td>
|
||
</tr>
|
||
<tr class="odd">
|
||
<td>S</td>
|
||
<td>C or G</td>
|
||
</tr>
|
||
<tr class="even">
|
||
<td>B</td>
|
||
<td>C, T, U, or G (not A)</td>
|
||
</tr>
|
||
<tr class="odd">
|
||
<td>D</td>
|
||
<td>A, T, U, or G (not C)</td>
|
||
</tr>
|
||
<tr class="even">
|
||
<td>H</td>
|
||
<td>A, T, U, or C (not G)</td>
|
||
</tr>
|
||
<tr class="odd">
|
||
<td>V</td>
|
||
<td>A, C, or G (not T, not U)</td>
|
||
</tr>
|
||
<tr class="even">
|
||
<td>N</td>
|
||
<td>Any base (A, C, G, T, or U)</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
</section>
|
||
<section id="sec-fasta" class="level3" data-number="2.1.2">
|
||
<h3 data-number="2.1.2" class="anchored" data-anchor-id="sec-fasta"><span class="header-section-number">2.1.2</span> The <em>FASTA</em> sequence format</h3>
|
||
<p>The <a href="#sec-fasta"><em>FASTA</em></a> format is certainly the most widely used sequence file format. This is certainly due to its great simplicity. It was originally created for the Lipman and Pearson <a href="http://www.ncbi.nlm.nih.gov/pubmed/3162770?dopt=Citation"><code>FASTA</code> program</a>. <em>OBITools</em> use in more of the classical <a href="#sec-fasta"><em>FASTA</em></a> format an <code>extended version</code> of this format where structured data are included in the title line.</p>
|
||
<p>In <a href="#sec-fasta"><em>FASTA</em></a> format a sequence is represented by a title line beginning with a <strong><code>></code></strong> character and the sequences by itself following the <a href="#sec-iupac"><code>IUPAC</code></a> code. The sequence is usually split other severals lines of the same length (expect for the last one)</p>
|
||
<pre><code>>my_sequence this is my pretty sequence
|
||
ACGTTGCAGTACGTTGCAGTACGTTGCAGTACGTTGCAGTACGTTGCAGTACGTTGCAGT
|
||
GTGCTGACGTTGCAGTACGTTGCAGTACGTTGCAGTACGTTGCAGTACGTTGCAGTGTTT
|
||
AACGACGTTGCAGTACGTTGCAGT</code></pre>
|
||
<p>This is no special format for the title line excepting that this line should be unique. Usually the first word following the <strong>></strong> character is considered as the sequence identifier. The end of the title line corresponding to a description of the sequence. Several sequences can be concatenated in a same file. The description of the next sequence is just pasted at the end of the record of the previous one</p>
|
||
<pre><code>>sequence_A this is my first pretty sequence
|
||
ACGTTGCAGTACGTTGCAGTACGTTGCAGTACGTTGCAGTACGTTGCAGTACGTTGCAGT
|
||
GTGCTGACGTTGCAGTACGTTGCAGTACGTTGCAGTACGTTGCAGTACGTTGCAGTGTTT
|
||
AACGACGTTGCAGTACGTTGCAGT
|
||
>sequence_B this is my second pretty sequence
|
||
ACGTTGCAGTACGTTGCAGTACGTTGCAGTACGTTGCAGTACGTTGCAGTACGTTGCAGT
|
||
GTGCTGACGTTGCAGTACGTTGCAGTACGTTGCAGTACGTTGCAGTACGTTGCAGTGTTT
|
||
AACGACGTTGCAGTACGTTGCAGT
|
||
>sequence_C this is my third pretty sequence
|
||
ACGTTGCAGTACGTTGCAGTACGTTGCAGTACGTTGCAGTACGTTGCAGTACGTTGCAGT
|
||
GTGCTGACGTTGCAGTACGTTGCAGTACGTTGCAGTACGTTGCAGTACGTTGCAGTGTTT
|
||
AACGACGTTGCAGTACGTTGCAGT</code></pre>
|
||
<section id="file-extensions" class="level4" data-number="2.1.2.1">
|
||
<h4 data-number="2.1.2.1" class="anchored" data-anchor-id="file-extensions"><span class="header-section-number">2.1.2.1</span> File extensions</h4>
|
||
<p>There is no standard file extension for a <a href="#sec-fasta"><em>FASTA</em></a> file, but <code>.fa</code> and <code>.fasta</code>, are commonly used.</p>
|
||
</section>
|
||
</section>
|
||
<section id="sec-fastq" class="level3" data-number="2.1.3">
|
||
<h3 data-number="2.1.3" class="anchored" data-anchor-id="sec-fastq"><span class="header-section-number">2.1.3</span> The <em>FASTQ</em> sequence format<a href="#fn1" class="footnote-ref" id="fnref1" role="doc-noteref"><sup>1</sup></a></h3>
|
||
<p>The <a href="#sec-fastq"><em>FASTQ</em></a> format is a text file format for storing both biological sequences (only nucleic acid sequences) and the associated sequence quality scores. Every nucleotide of the sequence and its associated quality score are each encoded by a single ASCII character. This format was originally developed by the Wellcome Trust Sanger Institute to link a <a href="#sec-fasta"><em>FASTA</em></a> sequence file to the corresponding quality data, but is now became the <em>de facto</em> standard for storing results from high-throughput sequencers <span class="citation" data-cites="cock2010sanger">(<a href="references.html#ref-cock2010sanger" role="doc-biblioref">Cock et al. 2010</a>)</span>.</p>
|
||
<p><em>OBITools</em> considers that a <a href="#sec-fastq"><em>FASTQ</em></a> file uses four lines to encode a sequence record.</p>
|
||
<ul>
|
||
<li>Line 1 begins with a ‘@’ character and is followed by a sequence identifier and an <em>optional</em> description (like a <a href="#sec-fasta"><em>FASTA</em></a> title line).</li>
|
||
<li>Line 2 is the sequence letters, in upper or lower case, but <em>OBITools</em> only write sequences as lower cases.</li>
|
||
<li>Line 3 begins with a ‘+’ character and is <em>optionally</em> followed by the same sequence identifier (and any description) again.</li>
|
||
<li>Line 4 encodes the quality values for the sequence in Line 2, and must contain the same number of symbols as letters in the sequence.</li>
|
||
</ul>
|
||
<p>A <a href="#sec-fastq"><em>FASTQ</em></a> file looks like this:</p>
|
||
<pre><code>@SEQ_ID
|
||
GATTTGGGGTTCAAAGCAGTATCGATCAAATAGTAAATCCATTTGTTCAACTCACAGTTT
|
||
+
|
||
!''*((((***+))%%%++)(%%%%).1***-+*''))**55CCF>>>>>>CCCCCCC65</code></pre>
|
||
<p>The character ‘!’ represents the lowest quality while ‘~’ is the highest. Here are the quality value characters in left-to-right increasing order of quality (<code>ASCII</code>):</p>
|
||
<pre><code>!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]
|
||
^_`abcdefghijklmnopqrstuvwxyz{|}~</code></pre>
|
||
<p>If the original Sanger <a href="#sec-fastq"><em>FASTQ</em></a> files also allowed the sequence and quality strings to be wrapped (split over multiple lines), it is not supported by <em>OBITools</em> as it make parsing complicated due to the unfortunate choice of “@” and “+” as markers (these characters can also occur in the quality string).</p>
|
||
<section id="sequence-quality-scores" class="level4 unnumbered">
|
||
<h4 class="unnumbered anchored" data-anchor-id="sequence-quality-scores">Sequence quality scores</h4>
|
||
<p>The Phred quality value <em>Q</em> is an integer mapping of <em>p</em> (<em>i.e.</em>, the probability that the corresponding base call is incorrect). Two different equations have been in use. The first is the standard Sanger variant to assess reliability of a base call, otherwise known as Phred quality score:</p>
|
||
<p><math display="block" xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>Q</mi><mtext mathvariant="normal">sanger</mtext></msub><mo>=</mo><mo>−</mo><mn>10</mn><mspace width="0.167em"></mspace><msub><mo>log</mo><mn>10</mn></msub><mi>p</mi></mrow><annotation encoding="application/x-tex">
|
||
Q_\text{sanger} = -10 \, \log_{10} p
|
||
</annotation></semantics></math></p>
|
||
<p>The Solexa pipeline (i.e., the software delivered with the Illumina Genome Analyzer) earlier used a different mapping, encoding the odds <math display="inline" xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mstyle mathvariant="bold"><mi>𝐩</mi></mstyle><mi>/</mi><mrow><mo stretchy="true" form="prefix">(</mo><mn>1</mn><mo>−</mo><mstyle mathvariant="bold"><mi>𝐩</mi></mstyle><mo stretchy="true" form="postfix">)</mo></mrow></mrow><annotation encoding="application/x-tex">\mathbf{p}/(1-\mathbf{p})</annotation></semantics></math> instead of the probability <math display="inline" xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mstyle mathvariant="bold"><mi>𝐩</mi></mstyle><annotation encoding="application/x-tex">\mathbf{p}</annotation></semantics></math>:</p>
|
||
<p><math display="block" xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>Q</mi><mtext mathvariant="normal">solexa-prior to v.1.3</mtext></msub><mo>=</mo><mo>−</mo><mn>10</mn><mspace width="0.278em"></mspace><msub><mo>log</mo><mn>10</mn></msub><mfrac><mi>p</mi><mrow><mn>1</mn><mo>−</mo><mi>p</mi></mrow></mfrac></mrow><annotation encoding="application/x-tex">
|
||
Q_\text{solexa-prior to v.1.3} = -10 \; \log_{10} \frac{p}{1-p}
|
||
</annotation></semantics></math></p>
|
||
<p>Although both mappings are asymptotically identical at higher quality values, they differ at lower quality levels (i.e., approximately <math display="inline" xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mstyle mathvariant="bold"><mi>𝐩</mi></mstyle><mo>></mo><mn>0.05</mn></mrow><annotation encoding="application/x-tex">\mathbf{p} > 0.05</annotation></semantics></math>, or equivalently, <math display="inline" xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mstyle mathvariant="bold"><mi>𝐐</mi></mstyle><mo><</mo><mn>13</mn></mrow><annotation encoding="application/x-tex">\mathbf{Q} < 13</annotation></semantics></math>).</p>
|
||
<div id="fig-Probabilitymetrics" class="quarto-figure quarto-figure-center anchored">
|
||
<figure class="figure">
|
||
<p><img src="Probabilitymetrics.png" class="img-fluid figure-img"></p>
|
||
<p></p><figcaption class="figure-caption">Figure 2.1: Relationship between <em>Q</em> and <em>p</em> using the Sanger (red) and Solexa (black) equations (described above). The vertical dotted line indicates <math display="inline" xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mstyle mathvariant="bold"><mi>𝐩</mi></mstyle><mo>=</mo><mn>0.05</mn></mrow><annotation encoding="application/x-tex">\mathbf{p}= 0.05</annotation></semantics></math>, or equivalently, <math display="inline" xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>Q</mi><mo>=</mo><mn>13</mn></mrow><annotation encoding="application/x-tex">Q = 13</annotation></semantics></math>.</figcaption><p></p>
|
||
</figure>
|
||
</div>
|
||
<section id="encoding" class="level5 unnumbered">
|
||
<h5 class="unnumbered anchored" data-anchor-id="encoding">Encoding</h5>
|
||
<p>The <a href="#sec-fastq"><em>FASTQ</em></a> format had differente way of encoding the Phred quality score along the time. Here a breif history of these changes is presented. <em>OBITools</em></p>
|
||
<ul>
|
||
<li>Sanger format can encode a Phred quality score from 0 to 93 using ASCII 33 to 126 (although in raw read data the Phred quality score rarely exceeds 60, higher scores are possible in assemblies or read maps).</li>
|
||
<li>Solexa/Illumina 1.0 format can encode a Solexa/Illumina quality score from -5 to 62 using ASCII 59 to 126 (although in raw read data Solexa scores from -5 to 40 only are expected)</li>
|
||
<li>Starting with Illumina 1.3 and before Illumina 1.8, the format encoded a Phred quality score from 0 to 62 using ASCII 64 to 126 (although in raw read data Phred scores from 0 to 40 only are expected).</li>
|
||
<li>Starting in Illumina 1.5 and before Illumina 1.8, the Phred scores 0 to 2 have a slightly different meaning. The values 0 and 1 are no longer used and the value 2, encoded by ASCII 66 “B”.</li>
|
||
</ul>
|
||
<blockquote class="blockquote">
|
||
<p>Sequencing Control Software, Version 2.6, (Catalog # SY-960-2601, Part # 15009921 Rev. A, November 2009, page 30) states the following: <em>If a read ends with a segment of mostly low quality (Q15 or below), then all of the quality values in the segment are replaced with a value of 2 (encoded as the letter B in Illumina’s text-based encoding of quality scores)… This Q2 indicator does not predict a specific error rate, but rather indicates that a specific final portion of the read should not be used in further analyses.</em> Also, the quality score encoded as “B” letter may occur internally within reads at least as late as pipeline version 1.6, as shown in the following example:</p>
|
||
</blockquote>
|
||
<pre><code>@HWI-EAS209_0006_FC706VJ:5:58:5894:21141#ATCACG/1
|
||
TTAATTGGTAAATAAATCTCCTAATAGCTTAGATNTTACCTTNNNNNNNNNNTAGTTTCTTGAGA
|
||
TTTGTTGGGGGAGACATTTTTGTGATTGCCTTGAT
|
||
+HWI-EAS209_0006_FC706VJ:5:58:5894:21141#ATCACG/1
|
||
efcfffffcfeefffcffffffddf`feed]`]_Ba_^__[YBBBBBBBBBBRTT\]][ dddd`
|
||
ddd^dddadd^BBBBBBBBBBBBBBBBBBBBBBBB</code></pre>
|
||
<p>An alternative interpretation of this ASCII encoding has been proposed. Also, in Illumina runs using PhiX controls, the character ‘B’ was observed to represent an “unknown quality score”. The error rate of ‘B’ reads was roughly 3 phred scores lower the mean observed score of a given run.</p>
|
||
<ul>
|
||
<li>Starting in Illumina 1.8, the quality scores have basically returned to the use of the Sanger format (Phred+33).</li>
|
||
</ul>
|
||
<p><em>OBITools</em> follows the Sanger format. Nevertheless, It is possible to read files encoded following the Solexa/Illumina format by applying a shift of 62 (see the option <strong>–solexa</strong> of the <em>OBITools</em> commands).</p>
|
||
</section>
|
||
</section>
|
||
<section id="file-extensions-1" class="level4" data-number="2.1.3.1">
|
||
<h4 data-number="2.1.3.1" class="anchored" data-anchor-id="file-extensions-1"><span class="header-section-number">2.1.3.1</span> File extensions</h4>
|
||
<p>There is no standard file extension for a <a href="#sec-fastq"><em>FASTQ</em></a> file, but <code>.fq</code> and <code>.fastq</code>, are commonly used.</p>
|
||
</section>
|
||
</section>
|
||
</section>
|
||
<section id="the-taxonomy-files" class="level2" data-number="2.2">
|
||
<h2 data-number="2.2" class="anchored" data-anchor-id="the-taxonomy-files"><span class="header-section-number">2.2</span> The taxonomy files</h2>
|
||
<p>Many OBITools are able to take into account taxonomic data. This is done by specifying a directory containing all :doc:<code>NCBI taxonomy dump files <./taxdump></code>.</p>
|
||
</section>
|
||
<section id="the-sample-description-file" class="level2" data-number="2.3">
|
||
<h2 data-number="2.3" class="anchored" data-anchor-id="the-sample-description-file"><span class="header-section-number">2.3</span> The sample description file</h2>
|
||
<p>A key file for <em>OBITools4</em> is the file describing all samples (PCR) analyzed in the processed sequencing library file. This file, often called the <code>ngsfilter</code> file, is a tab separated values (TSV) file. The format of this file is exactly identical to that used in <em>OBITools2</em> and <em>OBITools4</em>.</p>
|
||
<p><code>{tsv, .smaller} wolf_diet 13a_F730603 aattaac TTAGATACCCCACTATGC TAGAACAGGCTCCTCTAG F wolf_diet 15a_F730814 gaagtag TTAGATACCCCACTATGC TAGAACAGGCTCCTCTAG F wolf_diet 26a_F040644 gaatatc TTAGATACCCCACTATGC TAGAACAGGCTCCTCTAG F wolf_diet 29a_F260619 gcctcct TTAGATACCCCACTATGC TAGAACAGGCTCCTCTAG F</code></p>
|
||
<p>At least six columns must be present in every line of the file.</p>
|
||
<ul>
|
||
<li><p>The first column contains the name of the experience:</p>
|
||
<p>An experiment name groups a set of sample together. Sequences belonging to the experiment are tagged with an attribute <code>experiment</code> containing the name of the experiment in their annotation.</p></li>
|
||
<li><p>The second column contains the sample identifier in the experiment</p>
|
||
<p>The sample identifier must be unique in the experiment. The <code>obimultiplex</code> and <code>obitagpcr</code> commands add to all the sequences bellonging to the same sample an attribute <code>sample</code> containing the sample identifier</p></li>
|
||
<li><p>The third column contains description of the tag used to identify sequences corresponding to this sample</p></li>
|
||
<li><p>The fourth column contains the forward primer sequence</p></li>
|
||
<li><p>The fifth column contains the reverse primer sequence</p></li>
|
||
<li><p>The sixth column must always contain the character <code>F</code> (full length)</p></li>
|
||
</ul>
|
||
|
||
|
||
<div id="refs" class="references csl-bib-body hanging-indent" role="doc-bibliography" style="display: none">
|
||
<div id="ref-cock2010sanger" class="csl-entry" role="doc-biblioentry">
|
||
Cock, Peter JA, Christopher J Fields, Naohisa Goto, Michael L Heuer, and Peter M Rice. 2010. <span>“The Sanger FASTQ File Format for Sequences with Quality Scores, and the Solexa/Illumina FASTQ Variants.”</span> <em>Nucleic Acids Research</em> 38 (6): 1767–71.
|
||
</div>
|
||
</div>
|
||
</section>
|
||
<section id="footnotes" class="footnotes footnotes-end-of-document" role="doc-endnotes">
|
||
<hr>
|
||
<ol>
|
||
<li id="fn1"><p>This article uses material from the Wikipedia article <a href="http://en.wikipedia.org/wiki/FASTQ_format"><code>FASTQ format</code></a> which is released under the <code>Creative Commons Attribution-Share-Alike License 3.0</code><a href="#fnref1" class="footnote-back" role="doc-backlink">↩︎</a></p></li>
|
||
</ol>
|
||
</section>
|
||
|
||
</main> <!-- /main -->
|
||
<script id="quarto-html-after-body" type="application/javascript">
|
||
window.document.addEventListener("DOMContentLoaded", function (event) {
|
||
const toggleBodyColorMode = (bsSheetEl) => {
|
||
const mode = bsSheetEl.getAttribute("data-mode");
|
||
const bodyEl = window.document.querySelector("body");
|
||
if (mode === "dark") {
|
||
bodyEl.classList.add("quarto-dark");
|
||
bodyEl.classList.remove("quarto-light");
|
||
} else {
|
||
bodyEl.classList.add("quarto-light");
|
||
bodyEl.classList.remove("quarto-dark");
|
||
}
|
||
}
|
||
const toggleBodyColorPrimary = () => {
|
||
const bsSheetEl = window.document.querySelector("link#quarto-bootstrap");
|
||
if (bsSheetEl) {
|
||
toggleBodyColorMode(bsSheetEl);
|
||
}
|
||
}
|
||
toggleBodyColorPrimary();
|
||
const icon = "";
|
||
const anchorJS = new window.AnchorJS();
|
||
anchorJS.options = {
|
||
placement: 'right',
|
||
icon: icon
|
||
};
|
||
anchorJS.add('.anchored');
|
||
const clipboard = new window.ClipboardJS('.code-copy-button', {
|
||
target: function(trigger) {
|
||
return trigger.previousElementSibling;
|
||
}
|
||
});
|
||
clipboard.on('success', function(e) {
|
||
// button target
|
||
const button = e.trigger;
|
||
// don't keep focus
|
||
button.blur();
|
||
// flash "checked"
|
||
button.classList.add('code-copy-button-checked');
|
||
var currentTitle = button.getAttribute("title");
|
||
button.setAttribute("title", "Copied!");
|
||
let tooltip;
|
||
if (window.bootstrap) {
|
||
button.setAttribute("data-bs-toggle", "tooltip");
|
||
button.setAttribute("data-bs-placement", "left");
|
||
button.setAttribute("data-bs-title", "Copied!");
|
||
tooltip = new bootstrap.Tooltip(button,
|
||
{ trigger: "manual",
|
||
customClass: "code-copy-button-tooltip",
|
||
offset: [0, -8]});
|
||
tooltip.show();
|
||
}
|
||
setTimeout(function() {
|
||
if (tooltip) {
|
||
tooltip.hide();
|
||
button.removeAttribute("data-bs-title");
|
||
button.removeAttribute("data-bs-toggle");
|
||
button.removeAttribute("data-bs-placement");
|
||
}
|
||
button.setAttribute("title", currentTitle);
|
||
button.classList.remove('code-copy-button-checked');
|
||
}, 1000);
|
||
// clear code selection
|
||
e.clearSelection();
|
||
});
|
||
function tippyHover(el, contentFn) {
|
||
const config = {
|
||
allowHTML: true,
|
||
content: contentFn,
|
||
maxWidth: 500,
|
||
delay: 100,
|
||
arrow: false,
|
||
appendTo: function(el) {
|
||
return el.parentElement;
|
||
},
|
||
interactive: true,
|
||
interactiveBorder: 10,
|
||
theme: 'quarto',
|
||
placement: 'bottom-start'
|
||
};
|
||
window.tippy(el, config);
|
||
}
|
||
const noterefs = window.document.querySelectorAll('a[role="doc-noteref"]');
|
||
for (var i=0; i<noterefs.length; i++) {
|
||
const ref = noterefs[i];
|
||
tippyHover(ref, function() {
|
||
// use id or data attribute instead here
|
||
let href = ref.getAttribute('data-footnote-href') || ref.getAttribute('href');
|
||
try { href = new URL(href).hash; } catch {}
|
||
const id = href.replace(/^#\/?/, "");
|
||
const note = window.document.getElementById(id);
|
||
return note.innerHTML;
|
||
});
|
||
}
|
||
const findCites = (el) => {
|
||
const parentEl = el.parentElement;
|
||
if (parentEl) {
|
||
const cites = parentEl.dataset.cites;
|
||
if (cites) {
|
||
return {
|
||
el,
|
||
cites: cites.split(' ')
|
||
};
|
||
} else {
|
||
return findCites(el.parentElement)
|
||
}
|
||
} else {
|
||
return undefined;
|
||
}
|
||
};
|
||
var bibliorefs = window.document.querySelectorAll('a[role="doc-biblioref"]');
|
||
for (var i=0; i<bibliorefs.length; i++) {
|
||
const ref = bibliorefs[i];
|
||
const citeInfo = findCites(ref);
|
||
if (citeInfo) {
|
||
tippyHover(citeInfo.el, function() {
|
||
var popup = window.document.createElement('div');
|
||
citeInfo.cites.forEach(function(cite) {
|
||
var citeDiv = window.document.createElement('div');
|
||
citeDiv.classList.add('hanging-indent');
|
||
citeDiv.classList.add('csl-entry');
|
||
var biblioDiv = window.document.getElementById('ref-' + cite);
|
||
if (biblioDiv) {
|
||
citeDiv.innerHTML = biblioDiv.innerHTML;
|
||
}
|
||
popup.appendChild(citeDiv);
|
||
});
|
||
return popup.innerHTML;
|
||
});
|
||
}
|
||
}
|
||
});
|
||
</script>
|
||
<nav class="page-navigation">
|
||
<div class="nav-page nav-page-previous">
|
||
<a href="./installation.html" class="pagination-link">
|
||
<i class="bi bi-arrow-left-short"></i> <span class="nav-page-text"><span class="chapter-number">1</span> <span class="chapter-title">Installation of the <em>OBITools</em></span></span>
|
||
</a>
|
||
</div>
|
||
<div class="nav-page nav-page-next">
|
||
<a href="./tutorial.html" class="pagination-link">
|
||
<span class="nav-page-text"><span class="chapter-number">3</span> <span class="chapter-title">OBITools V4 Tutorial</span></span> <i class="bi bi-arrow-right-short"></i>
|
||
</a>
|
||
</div>
|
||
</nav>
|
||
</div> <!-- /content -->
|
||
|
||
|
||
|
||
</body></html> |