diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml index b6b707ad..3bca8203 100644 --- a/.github/workflows/ccpp.yml +++ b/.github/workflows/ccpp.yml @@ -13,19 +13,19 @@ jobs: strategy: matrix: - os: [ubuntu-18.04, ubuntu-20.04] + os: [ubuntu-22.04] steps: - uses: actions/checkout@master - name: download htslib run: | wget https://github.com/samtools/htslib/archive/1.10.2.tar.gz - sudo apt-get install gcc-7 + sudo apt-get install gcc-11 - name: untar run: tar xf 1.10.2.tar.gz - name: install htslib env: - CC: gcc-7 + CC: gcc-11 run: | cd htslib-1.10.2/ autoheader @@ -36,47 +36,42 @@ jobs: sudo ldconfig - name: autotools env: - CC: gcc-7 + CC: gcc-11 run: ./autogen.sh - name: configure env: - CC: gcc-7 + CC: gcc-11 run: ./configure - name: make env: - CC: gcc-7 + CC: gcc-11 run: make - name: make check env: - CC: gcc-7 + CC: gcc-11 run: make check - name: make install env: - CC: gcc-7 + CC: gcc-11 run: sudo make install build-macos: - runs-on: [ macos-11 ] + runs-on: [ macos-14 ] steps: - uses: actions/checkout@master - name: install GNU autotools run: | - curl -O http://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.gz - tar zxvf autoconf-2.69.tar.gz - cd autoconf-2.69 - ./configure && make && sudo make install - brew install automake libtool + brew install autoconf automake libtool - name: download htslib - run: wget https://github.com/samtools/htslib/archive/1.10.2.tar.gz + run: wget https://github.com/samtools/htslib/releases/download/1.12/htslib-1.12.tar.bz2 - name: untar - run: tar xf 1.10.2.tar.gz + run: tar xf htslib-1.12.tar.bz2 - name: install htslib run: | - cd htslib-1.10.2/ - autoheader - autoconf + cd htslib-1.12/ + autoreconf -i ./configure make sudo make install diff --git a/.github/workflows/clang-format-check.yml b/.github/workflows/clang-format-check.yml deleted file mode 100644 index faca04e8..00000000 --- a/.github/workflows/clang-format-check.yml +++ /dev/null @@ -1,11 +0,0 @@ -name: Clang Format Checker -on: [push] -jobs: - clang-format-checking: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: RafikFarhad/clang-format-github-action@v3 - with: - sources: "src/**/*.h,src/**/*.c,tests/**/*.c,src/**/*.cpp,tests/**/*.cpp" - style: "Google" \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 2dd67f8e..057094a6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,18 +1,18 @@ -FROM ubuntu:18.04 +FROM ubuntu:20.04 MAINTAINER Karthik G RUN apt-get update RUN apt-get install -y build-essential autoconf zlib1g-dev python3 wget libbz2-dev liblzma-dev libncurses-dev git bedtools python3-pip vim nano # HTSlib RUN cd root/ &&\ - wget https://github.com/samtools/htslib/releases/download/1.9/htslib-1.9.tar.bz2 &&\ - tar xvf htslib-1.9.tar.bz2 &&\ - cd htslib-1.9/ &&\ + wget https://github.com/samtools/htslib/releases/download/1.10.2/htslib-1.10.2.tar.bz2 &&\ + tar xvf htslib-1.10.2.tar.bz2 &&\ + cd htslib-1.10.2/ &&\ ./configure &&\ make &&\ make install &&\ cd ../ &&\ - rm htslib-1.9.tar.bz2 + rm htslib-1.10.2.tar.bz2 ENV LD_LIBRARY_PATH /usr/local/lib:$LD_LIBRARY_PATH # SAMtools RUN cd root &&\ @@ -34,12 +34,12 @@ RUN cd root/ &&\ make install # bwa RUN cd root/ &&\ - wget https://github.com/lh3/bwa/archive/v0.7.17.tar.gz &&\ - tar xvf v0.7.17.tar.gz &&\ - cd bwa-0.7.17/ &&\ + wget https://github.com/lh3/bwa/archive/v0.7.18.tar.gz &&\ + tar xvf v0.7.18.tar.gz &&\ + cd bwa-0.7.18/ &&\ make &&\ cd ../ &&\ - rm v0.7.17.tar.gz -ENV PATH /root/bwa-0.7.17:$PATH + rm v0.7.18.tar.gz +ENV PATH /root/bwa-0.7.18:$PATH # Snakemake RUN pip3 install pandas snakemake diff --git a/Doxyfile b/Doxyfile index 923f2500..975e220c 100644 --- a/Doxyfile +++ b/Doxyfile @@ -58,7 +58,7 @@ PROJECT_LOGO = # entered, it will be relative to the location where doxygen was started. If # left blank the current directory will be used. -OUTPUT_DIRECTORY = /Users/karthik/Documents/code/ivar/docs +OUTPUT_DIRECTORY = ./docs # If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub- # directories (in 2 levels) under the output directory of each output format and diff --git a/README.md b/README.md index 8e2ba5ea..739b4d7f 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ bioRxiv doi: [https://doi.org/10.1101/383513](https://doi.org/10.1101/383513) Manual for iVar is available [here](https://andersen-lab.github.io/ivar/html/). -## Insallation +## Installation ### Dependencies diff --git a/config.h.in b/config.h.in index 69e60192..c85344c7 100644 --- a/config.h.in +++ b/config.h.in @@ -3,26 +3,23 @@ /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H -/* Define to 1 if you have the `hts' library (-lhts). */ +/* Define to 1 if you have the 'hts' library (-lhts). */ #undef HAVE_LIBHTS -/* Define to 1 if you have the `pthread' library (-lpthread). */ +/* Define to 1 if you have the 'pthread' library (-lpthread). */ #undef HAVE_LIBPTHREAD -/* Define to 1 if you have the `z' library (-lz). */ +/* Define to 1 if you have the 'z' library (-lz). */ #undef HAVE_LIBZ -/* Define to 1 if your system has a GNU libc compatible `malloc' function, and +/* Define to 1 if your system has a GNU libc compatible 'malloc' function, and to 0 otherwise. */ #undef HAVE_MALLOC -/* Define to 1 if you have the `memmove' function. */ +/* Define to 1 if you have the 'memmove' function. */ #undef HAVE_MEMMOVE -/* Define to 1 if you have the header file. */ -#undef HAVE_MEMORY_H - -/* Define to 1 if your system has a GNU libc compatible `realloc' function, +/* Define to 1 if your system has a GNU libc compatible 'realloc' function, and to 0 otherwise. */ #undef HAVE_REALLOC @@ -32,6 +29,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H +/* Define to 1 if you have the header file. */ +#undef HAVE_STDIO_H + /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H @@ -50,7 +50,7 @@ /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H -/* Define to 1 if the system has the type `_Bool'. */ +/* Define to 1 if the system has the type '_Bool'. */ #undef HAVE__BOOL /* Name of package */ @@ -74,7 +74,9 @@ /* Define to the version of this package. */ #undef PACKAGE_VERSION -/* Define to 1 if you have the ANSI C header files. */ +/* Define to 1 if all of the C89 standard headers exist (not just the ones + required in a freestanding environment). This macro is provided for + backward compatibility; new code need not use it. */ #undef STDC_HEADERS /* Version number of package */ @@ -90,7 +92,7 @@ #define below would cause a syntax error. */ #undef _UINT8_T -/* Define to `__inline__' or `__inline' if that's what the C compiler +/* Define to '__inline__' or '__inline' if that's what the C compiler calls it, or to nothing if 'inline' is not supported under any name. */ #ifndef __cplusplus #undef inline diff --git a/configure.ac b/configure.ac index c4eb867e..b5150e2b 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ([2.63]) -AC_INIT([ivar], [1.3.1], [gkarthik@scripps.edu]) +AC_INIT([ivar], [1.4.4], [gkarthik@scripps.edu]) AM_INIT_AUTOMAKE([foreign subdir-objects]) AC_CONFIG_HEADERS([config.h]) diff --git a/data/test.strand.pileup b/data/test.strand.pileup new file mode 100644 index 00000000..44bad26e --- /dev/null +++ b/data/test.strand.pileup @@ -0,0 +1,20 @@ +test 1 G 20 GGGGGGGGGGGGGGGGGGGG ???????????????????? +test 2 A 20 AAAAAAAAAAAAAAAAAAAA ???????????????????? +test 3 G 20 GGGGGGGGGGGGGGGGGGGG ???????????????????? +test 4 G 20 GGGGGGGGGGGGGGGGGGGG ???????????????????? +test 5 C 20 CCCCCCCCCCTTTTTTTTTT ???????????????????? +test 6 T 20 TTTTTTTTTTTTTTTTTTTT ???????????????????? +test 7 G 20 GGGGGGGGGGGGGGGGGGGG ???????????????????? +test 8 C 20 CCCCCCCCCCCCCCCCCCCC ???????????????????? +test 9 C 20 CCCCCCCCCCCCCCCCCCCC ???????????????????? +test 10 A 20 AAAAAAAAAAAAAAAAAAAA ???????????????????? +test 11 G 20 GGGGGGGGGGGGGGGGGGGG ???????????????????? +test 12 C 20 CCCCCCCCCCCCCCCCCCCC ???????????????????? +test 13 C 20 CCCCCCCCCCCCCCCCCCCC ???????????????????? +test 14 G 20 GGGGGGGGGGGGGGGGGGGG ???????????????????? +test 15 G 20 GGGGGGGGGGCCCCCCCCCC ???????????????????? +test 16 A 20 AAAAAAAAAAAAAAAAAAAA ???????????????????? +test 17 C 20 CCCCCCCCCCCCCCCCCCCC ???????????????????? +test 18 T 20 TTTTTTTTTTTTTTTTTTTT ???????????????????? +test 19 T 20 TTTTTTTTTTTTTTTTTTTT ???????????????????? +test 20 C 20 CCCCCCCCCCCCCCCCCCCC ???????????????????? diff --git a/data/test_strand.gff b/data/test_strand.gff new file mode 100644 index 00000000..762ea9c7 --- /dev/null +++ b/data/test_strand.gff @@ -0,0 +1,3 @@ +## GFF3 file format +test Genbank CDS 1 9 . + . ID=test1;Note=positiveStrand;gene=A; +test Genbank CDS 11 20 . - . ID=test2;Note=negativeStrand;gene=B; diff --git a/data/test_unpaired.sorted.bam b/data/test_unpaired.sorted.bam new file mode 100644 index 00000000..180efe00 Binary files /dev/null and b/data/test_unpaired.sorted.bam differ diff --git a/data/test_unpaired.sorted.bam.bai b/data/test_unpaired.sorted.bam.bai new file mode 100644 index 00000000..a6fe2945 Binary files /dev/null and b/data/test_unpaired.sorted.bam.bai differ diff --git a/docs/MANUAL.md b/docs/MANUAL.md index 1cd247cd..3d0bfd6f 100644 --- a/docs/MANUAL.md +++ b/docs/MANUAL.md @@ -42,14 +42,14 @@ Command: ``` ivar trim -Usage: ivar trim -i -b -p [-m ] [-q ] [-s ] +Usage: ivar trim -i [] -b [-p ] [-m ] [-q ] [-s ] Input Options Description - -i (Required) Sorted bam file, with aligned reads, to trim primers and quality + -i Sorted bam file, with aligned reads, to trim primers and quality. If not specified will read from standard in -b (Required) BED file with primer sequences and positions -f Primer pair information file containing left and right primer names for the same amplicon separated by a tab If provided, reads will be filtered based on their overlap with amplicons prior to trimming - -m Minimum length of read to retain after trimming (Default: 30) + -m Minimum length of read to retain after trimming (Default: 50% the average length of the first 1000 reads) -q Minimum quality threshold for sliding window to pass (Default: 20) -s Width of sliding window (Default: 4) -e Include reads with no primers. By default, reads with no primers are excluded @@ -57,16 +57,24 @@ Input Options Description alignment length filter or primer requirements, but mark them QCFAIL Output Options Description - -p (Required) Prefix for the output BAM file + -p Prefix for the output BAM file. If none is specified the output will write to standard out. ``` Example Usage: ``` ivar trim -b test_primers.bed -p test.trimmed -i test.bam -q 15 -m 50 -s 4 +samtools view -h test.bam | ivar trim -b test_primers.bed -p test.trimmed ``` The command above will produce a trimmed BAM file test.trimmed.bam after trimming the aligned reads in test.bam using the primer positions specified in test_primers.bed and a minimum quality threshold of **15**, minimum read length of **50** and a sliding window of **4**. +Example Usage: +``` +bwa mem -t 32 reference.fa 1.fq 2.fq | ivar trim -b test_primers.bed -x 3 -m 30 | samtools sort - | samtools mpileup -aa -A -Q 0 -d 0 - | ivar consensus -p test_consensus -m 10 -n N -t 0.5 +``` + +The command above will allow you to go from alignment to consensus sequence in a single command using the bwa aligner. + Example BED file ``` @@ -112,6 +120,7 @@ Input Options Description -q Minimum quality score threshold to count base (Default: 20) -t Minimum frequency threshold(0 - 1) to call variants (Default: 0.03) -m Minimum read depth to call variants (Default: 0) + -G Count gaps towards depth. By default, gaps are not counted -r Reference file used for alignment. This is used to translate the nucleotide sequences and identify intra host single nucleotide variants -g A GFF file in the GFF3 format can be supplied to specify coordinates of open reading frames (ORFs). In absence of GFF file, amino acid translation will not be done. @@ -280,6 +289,7 @@ Note : samtools mpileup output must be piped into ivar consensus Input Options Description -q Minimum quality score threshold to count base (Default: 20) -t Minimum frequency threshold(0 - 1) to call consensus. (Default: 0) + -c Minimum insertion frequency threshold(0 - 1) to call consensus. (Default: 0.8) Frequently used thresholds | Description ---------------------------|------------ 0 | Majority or most common base diff --git a/docs/html/bc_sd.png b/docs/html/bc_sd.png new file mode 100644 index 00000000..31ca888d Binary files /dev/null and b/docs/html/bc_sd.png differ diff --git a/docs/html/cookbookpage.html b/docs/html/cookbookpage.html index 466eba4a..16c43de5 100644 --- a/docs/html/cookbookpage.html +++ b/docs/html/cookbookpage.html @@ -4,7 +4,7 @@ - + @@ -13,6 +13,7 @@ + @@ -33,21 +34,22 @@ - + +/* @license-end */ +
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
-
-
-
Cookbook
+
+
Cookbook
-

Two pipelines to call iSNVs from known and unknown reference sequences have been written in snakemake.

+

+

Two pipelines to call iSNVs from known and unknown reference sequences have been written in snakemake.

The two pipelines are distributed along with iVar and are present in thepipeline/ and pipeline_field/ fodlers respectively.

For both pipelines, there are four parameters that will have to be set in beginning of the Snakefile.

-
in_dir = "<input fastq files>"
out_dir = "<output directory>"
bed = "<bed-file-with-primer-positions>"
ref="<path to reference fasta>"
- -
-

Call iSNVs from samples with known reference sequence

+
in_dir = "<input fastq files>"
+
out_dir = "<output directory>"
+
bed = "<bed-file-with-primer-positions>"
+
ref="<path to reference fasta>"
+

+

Call iSNVs from samples with known reference sequence

Link to Jupyter Notebook

Link to pipeline

-

Dependencies:

+

Dependencies:

-

Call iSNVs from samples with unknown reference sequence

+

Call iSNVs from samples with unknown reference sequence

Link to pipeline

-

Dependencies:

+

Dependencies:

+
diff --git a/docs/html/dir_49e56c817e5e54854c35e136979f97ca.html b/docs/html/dir_49e56c817e5e54854c35e136979f97ca.html new file mode 100644 index 00000000..21542605 --- /dev/null +++ b/docs/html/dir_49e56c817e5e54854c35e136979f97ca.html @@ -0,0 +1,93 @@ + + + + + + + + + + + +iVar: docs Directory Reference + + + + + + + + + + +
+
+ + + + + + +
+
iVar +
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+
+
docs Directory Reference
+
+
+
+ + + + + diff --git a/docs/html/docd.png b/docs/html/docd.png new file mode 100644 index 00000000..d7c94fda Binary files /dev/null and b/docs/html/docd.png differ diff --git a/docs/html/doxygen.svg b/docs/html/doxygen.svg new file mode 100644 index 00000000..79a76354 --- /dev/null +++ b/docs/html/doxygen.svg @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/html/dynsections.js b/docs/html/dynsections.js index c1ce1226..8f493264 100644 --- a/docs/html/dynsections.js +++ b/docs/html/dynsections.js @@ -1,120 +1,194 @@ /* - @licstart The following is the entire license notice for the - JavaScript code in this file. + @licstart The following is the entire license notice for the JavaScript code in this file. - Copyright (C) 1997-2017 by Dimitri van Heesch + The MIT License (MIT) - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. + Copyright (C) 1997-2020 by Dimitri van Heesch - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. + Permission is hereby granted, free of charge, to any person obtaining a copy of this software + and associated documentation files (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, publish, distribute, + sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + The above copyright notice and this permission notice shall be included in all copies or + substantial portions of the Software. - @licend The above is the entire license notice - for the JavaScript code in this file + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING + BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + @licend The above is the entire license notice for the JavaScript code in this file */ -function toggleVisibility(linkObj) -{ - var base = $(linkObj).attr('id'); - var summary = $('#'+base+'-summary'); - var content = $('#'+base+'-content'); - var trigger = $('#'+base+'-trigger'); - var src=$(trigger).attr('src'); - if (content.is(':visible')===true) { - content.hide(); - summary.show(); - $(linkObj).addClass('closed').removeClass('opened'); - $(trigger).attr('src',src.substring(0,src.length-8)+'closed.png'); - } else { - content.show(); - summary.hide(); - $(linkObj).removeClass('closed').addClass('opened'); - $(trigger).attr('src',src.substring(0,src.length-10)+'open.png'); - } - return false; -} - -function updateStripes() -{ - $('table.directory tr'). - removeClass('even').filter(':visible:even').addClass('even'); -} - -function toggleLevel(level) -{ - $('table.directory tr').each(function() { - var l = this.id.split('_').length-1; - var i = $('#img'+this.id.substring(3)); - var a = $('#arr'+this.id.substring(3)); - if (l'); + // add vertical lines to other rows + $('span[class=lineno]').not(':eq(0)').append(''); + // add toggle controls to lines with fold divs + $('div[class=foldopen]').each(function() { + // extract specific id to use + const id = $(this).attr('id').replace('foldopen',''); + // extract start and end foldable fragment attributes + const start = $(this).attr('data-start'); + const end = $(this).attr('data-end'); + // replace normal fold span with controls for the first line of a foldable fragment + $(this).find('span[class=fold]:first').replaceWith(''); + // append div for folded (closed) representation + $(this).after(''); + // extract the first line from the "open" section to represent closed content + const line = $(this).children().first().clone(); + // remove any glow that might still be active on the original line + $(line).removeClass('glow'); + if (start) { + // if line already ends with a start marker (e.g. trailing {), remove it + $(line).html($(line).html().replace(new RegExp('\\s*'+start+'\\s*$','g'),'')); + } + // replace minus with plus symbol + $(line).find('span[class=fold]').css('background-image',codefold.plusImg[relPath]); + // append ellipsis + $(line).append(' '+start+''+end); + // insert constructed line into closed div + $('#foldclosed'+id).html(line); + }); + }, +}; /* @license-end */ diff --git a/docs/html/index.html b/docs/html/index.html index efe7bb19..0d3ba185 100644 --- a/docs/html/index.html +++ b/docs/html/index.html @@ -4,7 +4,7 @@ - + @@ -13,6 +13,7 @@ + @@ -33,21 +34,22 @@
- + +/* @license-end */ +
@@ -59,17 +61,24 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
-
-
-
Documentation
+
+
Documentation
-
    +

    +
    • Installation
    • Manual
    • Cookbook
    • @@ -80,13 +89,15 @@

      Genome Biology 2019 20:8

      Nathan D Grubaugh, Karthik Gangavarapu, Joshua Quick, Nathaniel L Matteson, Jaqueline Goes De Jesus, Bradley J Main, Amanda L Tan, Lauren M Paul, Doug E Brackney, Saran Grewal, Nikos Gurfield, Koen KA Van Rompay, Sharon Isern, Scott F Michael, Lark L Coffey, Nicholas J Loman, Kristian G Andersen

      bioRxiv doi: https://doi.org/10.1101/383513

      -

+
+ +
diff --git a/docs/html/installpage.html b/docs/html/installpage.html index 0cfcb6ce..7a0eacb8 100644 --- a/docs/html/installpage.html +++ b/docs/html/installpage.html @@ -4,7 +4,7 @@ - + @@ -13,6 +13,7 @@ + @@ -33,21 +34,22 @@ - + +/* @license-end */ +
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
-
-
-
Installation
+
+
Installation

Table of Contents

@@ -89,7 +97,8 @@
  • Contact
  • -

    Dependencies

    +

    +

    Dependencies

    • HTSlib
    • GCC any version after v5.0. Support for c++11 standard required.
    • @@ -100,72 +109,120 @@

      Installing via conda

      iVar is available on bioconda. To install conda, please use the miniconda package. After intalling conda please add the following channels,

      -
      conda config --add channels defaults
      conda config --add channels bioconda
      conda config --add channels conda-forge

      To install iVar,

      -
      conda install ivar

      +
      conda config --add channels defaults
      +
      conda config --add channels bioconda
      +
      conda config --add channels conda-forge
      +

      To install iVar,

      +
      conda install ivar
      +

      Installing via homebrew

      iVar can be installed using Homebrew.

      -
      brew install brewsci/bio/ivar

      +
      brew install brewsci/bio/ivar
      +

      Installing on Mac

      Installing build tools

      Xcode from Apple is required to compile iVar (and other tools) from source. If you don't want to install the full Xcode package from the AppStore, you can install the Xcode command line tools,

      -
      xcode-select --install

      GNU Autotools is required to compile iVar from source.

      +
      xcode-select --install
      +

      GNU Autotools is required to compile iVar from source.

      To install Autotools using homebrew please use the command below,

      -
      brew install autoconf automake libtool

      +
      brew install autoconf automake libtool
      +

      HTSlib installed using conda

      HTSlib can be installed with conda using the command,

      -
      conda install -c bioconda htslib

      The conda binary is by default installed at /opt/. You can check the installation location by running the following command,

      -
      which conda

      The output of the command will be in this format - /opt/conda/bin/conda or /opt/anaconda2/bin/conda or /opt/anaconda3/bin/conda depending on whether you installed miniconda or anaconda.

      +
      conda install -c bioconda htslib
      +

      The conda binary is by default installed at /opt/. You can check the installation location by running the following command,

      +
      which conda
      +

      The output of the command will be in this format - /opt/conda/bin/conda or /opt/anaconda2/bin/conda or /opt/anaconda3/bin/conda depending on whether you installed miniconda or anaconda.

      If the output is for example, /opt/conda/bin/conda, then you can add the path to the lib folder to $LD_LIBRARY_PATH using the command below. You can add this to your ~/.bash_profile or ~/.bashrc to avoid rerunning the command everytime a new bash session starts.

      -
      export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/conda/lib

      +
      export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/conda/lib
      +

      HTSlib installed from source

      Installation instructions and downloads for HTSlib can be found at http://www.htslib.org/download/.

      If HTSlib is installed in a non standard location, please add the following to your .bash_profile so that iVar can find HTSlib dynamic libraries during runtime.

      -
      export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/path/to/hts/lib/folder

      +
      export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/path/to/hts/lib/folder
      +

      Installing iVar

      To install iVar, run the following commands.

      -
      ./autogen.sh
      ./configure
      make
      make install

      If HTSlib was installed using conda, please run the following commands by supplying the prefix to the bin folder of the conda binary.

      +
      ./autogen.sh
      +
      ./configure
      +
      make
      +
      make install
      +

      If HTSlib was installed using conda, please run the following commands by supplying the prefix to the bin folder of the conda binary.

      The prefix to the bin folder can be found using the command which conda. The output of the command will be in this format - /opt/conda/bin/conda or /opt/anaconda2/bin/conda or /opt/anaconda3/bin/conda depending on whether you installed miniconda or anaconda. For example, if the output of the command is /opt/conda/bin/conda, the prefix to the htslib bin folder will be /opt/conda. This can be supplied to ./configure –with-hts=/opt/conda.

      -
      ./autogen.sh
      ./configure --with-hts=/prefix/to/bin/folder/with/HTSlib
      make
      make install

      If HTSlib was installed in a non standard location, please run the following commands,

      -
      ./autogen.sh
      ./configure --with-hts=/prefix/to/bin/folder/with/HTSlib
      make
      make install

      To test installation just run, ivar version and you should get the following output,

      -
      iVar version 1.0
      Please raise issues and bug reports at https://github.com/andersen-lab/ivar/

      +
      ./autogen.sh
      +
      ./configure --with-hts=/prefix/to/bin/folder/with/HTSlib
      +
      make
      +
      make install
      +

      If HTSlib was installed in a non standard location, please run the following commands,

      +
      ./autogen.sh
      +
      ./configure --with-hts=/prefix/to/bin/folder/with/HTSlib
      +
      make
      +
      make install
      +

      To test installation just run, ivar version and you should get the following output,

      +
      iVar version 1.0
      +
      +
      Please raise issues and bug reports at https://github.com/andersen-lab/ivar/
      +

      Installing on Linux

      Installing build tools

      GNU Autotools is required to compile iVar from source.

      To install Autotools using APT please use the command below,

      -
      apt-get install autotools-dev

      +
      apt-get install autotools-dev
      +

      HTSlib installed using conda

      HTSlib can be installed with conda using the command,

      -
      conda install -c bioconda htslib

      The conda binary is by default installed at /opt/. You can check the installation location by running the following command,

      -
      which conda

      The output of the command will be in this format - /opt/conda/bin/conda or /opt/anaconda2/bin/conda or /opt/anaconda3/bin/conda depending on whether you installed miniconda or anaconda.

      +
      conda install -c bioconda htslib
      +

      The conda binary is by default installed at /opt/. You can check the installation location by running the following command,

      +
      which conda
      +

      The output of the command will be in this format - /opt/conda/bin/conda or /opt/anaconda2/bin/conda or /opt/anaconda3/bin/conda depending on whether you installed miniconda or anaconda.

      If the output is for example, /opt/conda/bin/conda, then you can add the path to the lib folder to $LD_LIBRARY_PATH using the command below. You can add this to your ~/.bash_profile or ~/.bashrc to avoid rerunning the command everytime a new bash session starts.

      -
      export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/conda/lib

      +
      export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/conda/lib
      +

      HTSlib installed from source

      Installation instructions and downloads for HTSlib can be found at http://www.htslib.org/download/.

      If HTSlib is installed in a non standard location, please add the following to your .bash_profile so that iVar can find HTSlib dynamic libraries during runtime.

      -
      export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/path/to/hts/lib/folder

      +
      export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/path/to/hts/lib/folder
      +

      Installing iVar

      To install iVar, run the following commands.

      -
      ./autogen.sh
      ./configure
      make
      make install

      If HTSlib was installed using conda, please run the following commands by supplying the prefix to the bin folder of the conda binary.

      +
      ./autogen.sh
      +
      ./configure
      +
      make
      +
      make install
      +

      If HTSlib was installed using conda, please run the following commands by supplying the prefix to the bin folder of the conda binary.

      The prefix to the bin folder can be found using the command which conda. The output of the command will be in this format - /opt/conda/bin/conda or /opt/anaconda2/bin/conda or /opt/anaconda3/bin/conda depending on whether you installed miniconda or anaconda. For example, if the output of the command is /opt/conda/bin/conda, the prefix to the htslib bin folder will be /opt/conda. This can be supplied to ./configure –with-hts=/opt/conda.

      -
      ./autogen.sh
      ./configure --with-hts=/prefix/to/bin/folder/with/HTSlib
      make
      make install

      If HTSlib was installed in a non standard location, please run the following commands,

      -
      ./autogen.sh
      ./configure --with-hts=/prefix/to/bin/folder/with/HTSlib
      make
      make install

      To test installation just run, ivar version and you should get the following output,

      -
      iVar version 1.0
      Please raise issues and bug reports at https://github.com/andersen-lab/ivar/

      +
      ./autogen.sh
      +
      ./configure --with-hts=/prefix/to/bin/folder/with/HTSlib
      +
      make
      +
      make install
      +

      If HTSlib was installed in a non standard location, please run the following commands,

      +
      ./autogen.sh
      +
      ./configure --with-hts=/prefix/to/bin/folder/with/HTSlib
      +
      make
      +
      make install
      +

      To test installation just run, ivar version and you should get the following output,

      +
      iVar version 1.0
      +
      +
      Please raise issues and bug reports at https://github.com/andersen-lab/ivar/
      +

      Running from Docker

      iVar can also be run via Docker. Pull the docker image from Docker Hub using the following command,

      -
      docker pull andersenlabapps/ivar

      This docker image contains all the required dependencies to run iVar and the pipelines developed using iVar. You will have to attach a docker volume to get data into the docker container. Instructions to do so are in the Docker docs.

      +
      docker pull andersenlabapps/ivar
      +

      This docker image contains all the required dependencies to run iVar and the pipelines developed using iVar. You will have to attach a docker volume to get data into the docker container. Instructions to do so are in the Docker docs.

      iVar on Docker Hub

      Contact

      For bug reports please email gkarthik[at]scripps.edu or raise an issue on Github.

    +
    diff --git a/docs/html/jquery.js b/docs/html/jquery.js index 2771c749..1dffb65b 100644 --- a/docs/html/jquery.js +++ b/docs/html/jquery.js @@ -1,99 +1,25 @@ -/* - @licstart The following is the entire license notice for the - JavaScript code in this file. +/*! jQuery v3.6.0 | (c) OpenJS Foundation and other contributors | jquery.org/license */ +!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],r=Object.getPrototypeOf,s=t.slice,g=t.flat?function(e){return t.flat.call(e)}:function(e){return t.concat.apply([],e)},u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},x=function(e){return null!=e&&e===e.window},E=C.document,c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.6.0",S=function(e,t){return new S.fn.init(e,t)};function p(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp(F),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(p.childNodes),p.childNodes),t[p.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!N[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&(U.test(t)||z.test(t))){(f=ee.test(t)&&ye(e.parentNode)||e)===e&&d.scope||((s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=S)),o=(l=h(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+xe(l[o]);c=l.join(",")}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){N(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return g(t.replace($,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[S]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e&&e.namespaceURI,n=e&&(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:p;return r!=C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),p!=C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.scope=ce(function(e){return a.appendChild(e).appendChild(C.createElement("div")),"undefined"!=typeof e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=S,!C.getElementsByName||!C.getElementsByName(S).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){var t;a.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+S+"-]").length||v.push("~="),(t=C.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||v.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+S+"+*").length||v.push(".#.+[+~]"),e.querySelectorAll("\\\f"),v.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",F)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},j=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e==C||e.ownerDocument==p&&y(p,e)?-1:t==C||t.ownerDocument==p&&y(p,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==C?-1:t==C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]==p?-1:s[r]==p?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(T(e),d.matchesSelector&&E&&!N[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){N(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=m[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&m(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,n,r){return m(n)?S.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?S.grep(e,function(e){return e===n!==r}):"string"!=typeof n?S.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||D,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),N.test(r[1])&&S.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,D=S(E);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){while((e=e[t])&&1!==e.nodeType);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i;ce=E.createDocumentFragment().appendChild(E.createElement("div")),(fe=E.createElement("input")).setAttribute("type","radio"),fe.setAttribute("checked","checked"),fe.setAttribute("name","t"),ce.appendChild(fe),y.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="",y.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="",y.option=!!ce.lastChild;var ge={thead:[1,"","
    "],col:[2,"","
    "],tr:[2,"","
    "],td:[3,"","
    "],_default:[0,"",""]};function ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?S.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;n",""]);var me=/<|&#?\w+;/;function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d\s*$/g;function je(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function De(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function qe(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Le(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=Y.get(e).events))for(i in Y.remove(t,"handle events"),s)for(n=0,r=s[i].length;n").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var _t,zt=[],Ut=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=zt.pop()||S.expando+"_"+wt.guid++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Ut.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Ut.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Ut,"$1"+r):!1!==e.jsonp&&(e.url+=(Tt.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||S.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?S(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,zt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((_t=E.implementation.createHTMLDocument("").body).innerHTML="
    ",2===_t.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=xe([e],t,o),o&&o.length&&S(o).remove(),S.merge([],i.childNodes)));var r,i,o},S.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(S.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},S.expr.pseudos.animated=function(t){return S.grep(S.timers,function(e){return t===e.elem}).length},S.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=S.css(e,"position"),c=S(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=S.css(e,"top"),u=S.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,S.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){S.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===S.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===S.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),i.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-S.css(r,"marginTop",!0),left:t.left-i.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===S.css(e,"position"))e=e.offsetParent;return e||re})}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;S.fn[t]=function(e){return $(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),S.each(["top","left"],function(e,n){S.cssHooks[n]=Fe(y.pixelPosition,function(e,t){if(t)return t=We(e,n),Pe.test(t)?S(e).position()[n]+"px":t})}),S.each({Height:"height",Width:"width"},function(a,s){S.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){S.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return $(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?S.css(e,t,i):S.style(e,t,n,i)},s,n?e:void 0,n)}})}),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){S.fn[n]=function(e,t){return 0",options:{classes:{},disabled:!1,create:null},_createWidget:function(t,e){e=y(e||this.defaultElement||this)[0],this.element=y(e),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=y(),this.hoverable=y(),this.focusable=y(),this.classesElementLookup={},e!==this&&(y.data(e,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===e&&this.destroy()}}),this.document=y(e.style?e.ownerDocument:e.document||e),this.window=y(this.document[0].defaultView||this.document[0].parentWindow)),this.options=y.widget.extend({},this.options,this._getCreateOptions(),t),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:y.noop,_create:y.noop,_init:y.noop,destroy:function(){var i=this;this._destroy(),y.each(this.classesElementLookup,function(t,e){i._removeClass(e,t)}),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:y.noop,widget:function(){return this.element},option:function(t,e){var i,s,n,o=t;if(0===arguments.length)return y.widget.extend({},this.options);if("string"==typeof t)if(o={},t=(i=t.split(".")).shift(),i.length){for(s=o[t]=y.widget.extend({},this.options[t]),n=0;n
    "),i=e.children()[0];return y("body").append(e),t=i.offsetWidth,e.css("overflow","scroll"),t===(i=i.offsetWidth)&&(i=e[0].clientWidth),e.remove(),s=t-i},getScrollInfo:function(t){var e=t.isWindow||t.isDocument?"":t.element.css("overflow-x"),i=t.isWindow||t.isDocument?"":t.element.css("overflow-y"),e="scroll"===e||"auto"===e&&t.widthx(D(s),D(n))?o.important="horizontal":o.important="vertical",p.using.call(this,t,o)}),h.offset(y.extend(l,{using:t}))})},y.ui.position={fit:{left:function(t,e){var i=e.within,s=i.isWindow?i.scrollLeft:i.offset.left,n=i.width,o=t.left-e.collisionPosition.marginLeft,h=s-o,a=o+e.collisionWidth-n-s;e.collisionWidth>n?0n?0=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}}),y.ui.plugin={add:function(t,e,i){var s,n=y.ui[t].prototype;for(s in i)n.plugins[s]=n.plugins[s]||[],n.plugins[s].push([e,i[s]])},call:function(t,e,i,s){var n,o=t.plugins[e];if(o&&(s||t.element[0].parentNode&&11!==t.element[0].parentNode.nodeType))for(n=0;n
    ").css({overflow:"hidden",position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.resizable("instance")),this.elementIsWrapper=!0,t={marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom"),marginLeft:this.originalElement.css("marginLeft")},this.element.css(t),this.originalElement.css("margin",0),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css(t),this._proportionallyResize()),this._setupHandles(),e.autoHide&&y(this.element).on("mouseenter",function(){e.disabled||(i._removeClass("ui-resizable-autohide"),i._handles.show())}).on("mouseleave",function(){e.disabled||i.resizing||(i._addClass("ui-resizable-autohide"),i._handles.hide())}),this._mouseInit()},_destroy:function(){this._mouseDestroy(),this._addedHandles.remove();function t(t){y(t).removeData("resizable").removeData("ui-resizable").off(".resizable")}var e;return this.elementIsWrapper&&(t(this.element),e=this.element,this.originalElement.css({position:e.css("position"),width:e.outerWidth(),height:e.outerHeight(),top:e.css("top"),left:e.css("left")}).insertAfter(e),e.remove()),this.originalElement.css("resize",this.originalResizeStyle),t(this.originalElement),this},_setOption:function(t,e){switch(this._super(t,e),t){case"handles":this._removeHandles(),this._setupHandles();break;case"aspectRatio":this._aspectRatio=!!e}},_setupHandles:function(){var t,e,i,s,n,o=this.options,h=this;if(this.handles=o.handles||(y(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this._handles=y(),this._addedHandles=y(),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),i=this.handles.split(","),this.handles={},e=0;e"),this._addClass(n,"ui-resizable-handle "+s),n.css({zIndex:o.zIndex}),this.handles[t]=".ui-resizable-"+t,this.element.children(this.handles[t]).length||(this.element.append(n),this._addedHandles=this._addedHandles.add(n));this._renderAxis=function(t){var e,i,s;for(e in t=t||this.element,this.handles)this.handles[e].constructor===String?this.handles[e]=this.element.children(this.handles[e]).first().show():(this.handles[e].jquery||this.handles[e].nodeType)&&(this.handles[e]=y(this.handles[e]),this._on(this.handles[e],{mousedown:h._mouseDown})),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)&&(i=y(this.handles[e],this.element),s=/sw|ne|nw|se|n|s/.test(e)?i.outerHeight():i.outerWidth(),i=["padding",/ne|nw|n/.test(e)?"Top":/se|sw|s/.test(e)?"Bottom":/^e$/.test(e)?"Right":"Left"].join(""),t.css(i,s),this._proportionallyResize()),this._handles=this._handles.add(this.handles[e])},this._renderAxis(this.element),this._handles=this._handles.add(this.element.find(".ui-resizable-handle")),this._handles.disableSelection(),this._handles.on("mouseover",function(){h.resizing||(this.className&&(n=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),h.axis=n&&n[1]?n[1]:"se")}),o.autoHide&&(this._handles.hide(),this._addClass("ui-resizable-autohide"))},_removeHandles:function(){this._addedHandles.remove()},_mouseCapture:function(t){var e,i,s=!1;for(e in this.handles)(i=y(this.handles[e])[0])!==t.target&&!y.contains(i,t.target)||(s=!0);return!this.options.disabled&&s},_mouseStart:function(t){var e,i,s=this.options,n=this.element;return this.resizing=!0,this._renderProxy(),e=this._num(this.helper.css("left")),i=this._num(this.helper.css("top")),s.containment&&(e+=y(s.containment).scrollLeft()||0,i+=y(s.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:e,top:i},this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:n.width(),height:n.height()},this.originalSize=this._helper?{width:n.outerWidth(),height:n.outerHeight()}:{width:n.width(),height:n.height()},this.sizeDiff={width:n.outerWidth()-n.width(),height:n.outerHeight()-n.height()},this.originalPosition={left:e,top:i},this.originalMousePosition={left:t.pageX,top:t.pageY},this.aspectRatio="number"==typeof s.aspectRatio?s.aspectRatio:this.originalSize.width/this.originalSize.height||1,s=y(".ui-resizable-"+this.axis).css("cursor"),y("body").css("cursor","auto"===s?this.axis+"-resize":s),this._addClass("ui-resizable-resizing"),this._propagate("start",t),!0},_mouseDrag:function(t){var e=this.originalMousePosition,i=this.axis,s=t.pageX-e.left||0,e=t.pageY-e.top||0,i=this._change[i];return this._updatePrevProperties(),i&&(e=i.apply(this,[t,s,e]),this._updateVirtualBoundaries(t.shiftKey),(this._aspectRatio||t.shiftKey)&&(e=this._updateRatio(e,t)),e=this._respectSize(e,t),this._updateCache(e),this._propagate("resize",t),e=this._applyChanges(),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),y.isEmptyObject(e)||(this._updatePrevProperties(),this._trigger("resize",t,this.ui()),this._applyChanges())),!1},_mouseStop:function(t){this.resizing=!1;var e,i,s,n=this.options,o=this;return this._helper&&(s=(e=(i=this._proportionallyResizeElements).length&&/textarea/i.test(i[0].nodeName))&&this._hasScroll(i[0],"left")?0:o.sizeDiff.height,i=e?0:o.sizeDiff.width,e={width:o.helper.width()-i,height:o.helper.height()-s},i=parseFloat(o.element.css("left"))+(o.position.left-o.originalPosition.left)||null,s=parseFloat(o.element.css("top"))+(o.position.top-o.originalPosition.top)||null,n.animate||this.element.css(y.extend(e,{top:s,left:i})),o.helper.height(o.size.height),o.helper.width(o.size.width),this._helper&&!n.animate&&this._proportionallyResize()),y("body").css("cursor","auto"),this._removeClass("ui-resizable-resizing"),this._propagate("stop",t),this._helper&&this.helper.remove(),!1},_updatePrevProperties:function(){this.prevPosition={top:this.position.top,left:this.position.left},this.prevSize={width:this.size.width,height:this.size.height}},_applyChanges:function(){var t={};return this.position.top!==this.prevPosition.top&&(t.top=this.position.top+"px"),this.position.left!==this.prevPosition.left&&(t.left=this.position.left+"px"),this.size.width!==this.prevSize.width&&(t.width=this.size.width+"px"),this.size.height!==this.prevSize.height&&(t.height=this.size.height+"px"),this.helper.css(t),t},_updateVirtualBoundaries:function(t){var e,i,s=this.options,n={minWidth:this._isNumber(s.minWidth)?s.minWidth:0,maxWidth:this._isNumber(s.maxWidth)?s.maxWidth:1/0,minHeight:this._isNumber(s.minHeight)?s.minHeight:0,maxHeight:this._isNumber(s.maxHeight)?s.maxHeight:1/0};(this._aspectRatio||t)&&(e=n.minHeight*this.aspectRatio,i=n.minWidth/this.aspectRatio,s=n.maxHeight*this.aspectRatio,t=n.maxWidth/this.aspectRatio,e>n.minWidth&&(n.minWidth=e),i>n.minHeight&&(n.minHeight=i),st.width,h=this._isNumber(t.height)&&e.minHeight&&e.minHeight>t.height,a=this.originalPosition.left+this.originalSize.width,r=this.originalPosition.top+this.originalSize.height,l=/sw|nw|w/.test(i),i=/nw|ne|n/.test(i);return o&&(t.width=e.minWidth),h&&(t.height=e.minHeight),s&&(t.width=e.maxWidth),n&&(t.height=e.maxHeight),o&&l&&(t.left=a-e.minWidth),s&&l&&(t.left=a-e.maxWidth),h&&i&&(t.top=r-e.minHeight),n&&i&&(t.top=r-e.maxHeight),t.width||t.height||t.left||!t.top?t.width||t.height||t.top||!t.left||(t.left=null):t.top=null,t},_getPaddingPlusBorderDimensions:function(t){for(var e=0,i=[],s=[t.css("borderTopWidth"),t.css("borderRightWidth"),t.css("borderBottomWidth"),t.css("borderLeftWidth")],n=[t.css("paddingTop"),t.css("paddingRight"),t.css("paddingBottom"),t.css("paddingLeft")];e<4;e++)i[e]=parseFloat(s[e])||0,i[e]+=parseFloat(n[e])||0;return{height:i[0]+i[2],width:i[1]+i[3]}},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var t,e=0,i=this.helper||this.element;e").css({overflow:"hidden"}),this._addClass(this.helper,this._helper),this.helper.css({width:this.element.outerWidth(),height:this.element.outerHeight(),position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++e.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(t,e){return{width:this.originalSize.width+e}},w:function(t,e){var i=this.originalSize;return{left:this.originalPosition.left+e,width:i.width-e}},n:function(t,e,i){var s=this.originalSize;return{top:this.originalPosition.top+i,height:s.height-i}},s:function(t,e,i){return{height:this.originalSize.height+i}},se:function(t,e,i){return y.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[t,e,i]))},sw:function(t,e,i){return y.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[t,e,i]))},ne:function(t,e,i){return y.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[t,e,i]))},nw:function(t,e,i){return y.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[t,e,i]))}},_propagate:function(t,e){y.ui.plugin.call(this,t,[e,this.ui()]),"resize"!==t&&this._trigger(t,e,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),y.ui.plugin.add("resizable","animate",{stop:function(e){var i=y(this).resizable("instance"),t=i.options,s=i._proportionallyResizeElements,n=s.length&&/textarea/i.test(s[0].nodeName),o=n&&i._hasScroll(s[0],"left")?0:i.sizeDiff.height,h=n?0:i.sizeDiff.width,n={width:i.size.width-h,height:i.size.height-o},h=parseFloat(i.element.css("left"))+(i.position.left-i.originalPosition.left)||null,o=parseFloat(i.element.css("top"))+(i.position.top-i.originalPosition.top)||null;i.element.animate(y.extend(n,o&&h?{top:o,left:h}:{}),{duration:t.animateDuration,easing:t.animateEasing,step:function(){var t={width:parseFloat(i.element.css("width")),height:parseFloat(i.element.css("height")),top:parseFloat(i.element.css("top")),left:parseFloat(i.element.css("left"))};s&&s.length&&y(s[0]).css({width:t.width,height:t.height}),i._updateCache(t),i._propagate("resize",e)}})}}),y.ui.plugin.add("resizable","containment",{start:function(){var i,s,n=y(this).resizable("instance"),t=n.options,e=n.element,o=t.containment,h=o instanceof y?o.get(0):/parent/.test(o)?e.parent().get(0):o;h&&(n.containerElement=y(h),/document/.test(o)||o===document?(n.containerOffset={left:0,top:0},n.containerPosition={left:0,top:0},n.parentData={element:y(document),left:0,top:0,width:y(document).width(),height:y(document).height()||document.body.parentNode.scrollHeight}):(i=y(h),s=[],y(["Top","Right","Left","Bottom"]).each(function(t,e){s[t]=n._num(i.css("padding"+e))}),n.containerOffset=i.offset(),n.containerPosition=i.position(),n.containerSize={height:i.innerHeight()-s[3],width:i.innerWidth()-s[1]},t=n.containerOffset,e=n.containerSize.height,o=n.containerSize.width,o=n._hasScroll(h,"left")?h.scrollWidth:o,e=n._hasScroll(h)?h.scrollHeight:e,n.parentData={element:h,left:t.left,top:t.top,width:o,height:e}))},resize:function(t){var e=y(this).resizable("instance"),i=e.options,s=e.containerOffset,n=e.position,o=e._aspectRatio||t.shiftKey,h={top:0,left:0},a=e.containerElement,t=!0;a[0]!==document&&/static/.test(a.css("position"))&&(h=s),n.left<(e._helper?s.left:0)&&(e.size.width=e.size.width+(e._helper?e.position.left-s.left:e.position.left-h.left),o&&(e.size.height=e.size.width/e.aspectRatio,t=!1),e.position.left=i.helper?s.left:0),n.top<(e._helper?s.top:0)&&(e.size.height=e.size.height+(e._helper?e.position.top-s.top:e.position.top),o&&(e.size.width=e.size.height*e.aspectRatio,t=!1),e.position.top=e._helper?s.top:0),i=e.containerElement.get(0)===e.element.parent().get(0),n=/relative|absolute/.test(e.containerElement.css("position")),i&&n?(e.offset.left=e.parentData.left+e.position.left,e.offset.top=e.parentData.top+e.position.top):(e.offset.left=e.element.offset().left,e.offset.top=e.element.offset().top),n=Math.abs(e.sizeDiff.width+(e._helper?e.offset.left-h.left:e.offset.left-s.left)),s=Math.abs(e.sizeDiff.height+(e._helper?e.offset.top-h.top:e.offset.top-s.top)),n+e.size.width>=e.parentData.width&&(e.size.width=e.parentData.width-n,o&&(e.size.height=e.size.width/e.aspectRatio,t=!1)),s+e.size.height>=e.parentData.height&&(e.size.height=e.parentData.height-s,o&&(e.size.width=e.size.height*e.aspectRatio,t=!1)),t||(e.position.left=e.prevPosition.left,e.position.top=e.prevPosition.top,e.size.width=e.prevSize.width,e.size.height=e.prevSize.height)},stop:function(){var t=y(this).resizable("instance"),e=t.options,i=t.containerOffset,s=t.containerPosition,n=t.containerElement,o=y(t.helper),h=o.offset(),a=o.outerWidth()-t.sizeDiff.width,o=o.outerHeight()-t.sizeDiff.height;t._helper&&!e.animate&&/relative/.test(n.css("position"))&&y(this).css({left:h.left-s.left-i.left,width:a,height:o}),t._helper&&!e.animate&&/static/.test(n.css("position"))&&y(this).css({left:h.left-s.left-i.left,width:a,height:o})}}),y.ui.plugin.add("resizable","alsoResize",{start:function(){var t=y(this).resizable("instance").options;y(t.alsoResize).each(function(){var t=y(this);t.data("ui-resizable-alsoresize",{width:parseFloat(t.width()),height:parseFloat(t.height()),left:parseFloat(t.css("left")),top:parseFloat(t.css("top"))})})},resize:function(t,i){var e=y(this).resizable("instance"),s=e.options,n=e.originalSize,o=e.originalPosition,h={height:e.size.height-n.height||0,width:e.size.width-n.width||0,top:e.position.top-o.top||0,left:e.position.left-o.left||0};y(s.alsoResize).each(function(){var t=y(this),s=y(this).data("ui-resizable-alsoresize"),n={},e=t.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];y.each(e,function(t,e){var i=(s[e]||0)+(h[e]||0);i&&0<=i&&(n[e]=i||null)}),t.css(n)})},stop:function(){y(this).removeData("ui-resizable-alsoresize")}}),y.ui.plugin.add("resizable","ghost",{start:function(){var t=y(this).resizable("instance"),e=t.size;t.ghost=t.originalElement.clone(),t.ghost.css({opacity:.25,display:"block",position:"relative",height:e.height,width:e.width,margin:0,left:0,top:0}),t._addClass(t.ghost,"ui-resizable-ghost"),!1!==y.uiBackCompat&&"string"==typeof t.options.ghost&&t.ghost.addClass(this.options.ghost),t.ghost.appendTo(t.helper)},resize:function(){var t=y(this).resizable("instance");t.ghost&&t.ghost.css({position:"relative",height:t.size.height,width:t.size.width})},stop:function(){var t=y(this).resizable("instance");t.ghost&&t.helper&&t.helper.get(0).removeChild(t.ghost.get(0))}}),y.ui.plugin.add("resizable","grid",{resize:function(){var t,e=y(this).resizable("instance"),i=e.options,s=e.size,n=e.originalSize,o=e.originalPosition,h=e.axis,a="number"==typeof i.grid?[i.grid,i.grid]:i.grid,r=a[0]||1,l=a[1]||1,u=Math.round((s.width-n.width)/r)*r,p=Math.round((s.height-n.height)/l)*l,d=n.width+u,c=n.height+p,f=i.maxWidth&&i.maxWidthd,s=i.minHeight&&i.minHeight>c;i.grid=a,m&&(d+=r),s&&(c+=l),f&&(d-=r),g&&(c-=l),/^(se|s|e)$/.test(h)?(e.size.width=d,e.size.height=c):/^(ne)$/.test(h)?(e.size.width=d,e.size.height=c,e.position.top=o.top-p):/^(sw)$/.test(h)?(e.size.width=d,e.size.height=c,e.position.left=o.left-u):((c-l<=0||d-r<=0)&&(t=e._getPaddingPlusBorderDimensions(this)),0=f[g]?0:Math.min(f[g],n));!a&&1)[^>]*$|#([\w\-]*)$)/,bM=/\S/,bI=/^\s+/,bE=/\s+$/,bA=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,bN=/^[\],:{}\s]*$/,bW=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,bP=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,bJ=/(?:^|:|,)(?:\s*\[)+/g,by=/(webkit)[ \/]([\w.]+)/,bR=/(opera)(?:.*version)?[ \/]([\w.]+)/,bQ=/(msie) ([\w.]+)/,bS=/(mozilla)(?:.*? rv:([\w.]+))?/,bB=/-([a-z]|[0-9])/ig,bZ=/^-ms-/,bT=function(b0,b1){return(b1+"").toUpperCase()},bX=bu.userAgent,bV,bC,e,bL=Object.prototype.toString,bG=Object.prototype.hasOwnProperty,bz=Array.prototype.push,bK=Array.prototype.slice,bO=String.prototype.trim,bv=Array.prototype.indexOf,bx={};bF.fn=bF.prototype={constructor:bF,init:function(b0,b4,b3){var b2,b5,b1,b6;if(!b0){return this}if(b0.nodeType){this.context=this[0]=b0;this.length=1;return this}if(b0==="body"&&!b4&&av.body){this.context=av;this[0]=av.body;this.selector=b0;this.length=1;return this}if(typeof b0==="string"){if(b0.charAt(0)==="<"&&b0.charAt(b0.length-1)===">"&&b0.length>=3){b2=[null,b0,null]}else{b2=bY.exec(b0)}if(b2&&(b2[1]||!b4)){if(b2[1]){b4=b4 instanceof bF?b4[0]:b4;b6=(b4?b4.ownerDocument||b4:av);b1=bA.exec(b0);if(b1){if(bF.isPlainObject(b4)){b0=[av.createElement(b1[1])];bF.fn.attr.call(b0,b4,true)}else{b0=[b6.createElement(b1[1])]}}else{b1=bF.buildFragment([b2[1]],[b6]);b0=(b1.cacheable?bF.clone(b1.fragment):b1.fragment).childNodes}return bF.merge(this,b0)}else{b5=av.getElementById(b2[2]);if(b5&&b5.parentNode){if(b5.id!==b2[2]){return b3.find(b0)}this.length=1;this[0]=b5}this.context=av;this.selector=b0;return this}}else{if(!b4||b4.jquery){return(b4||b3).find(b0)}else{return this.constructor(b4).find(b0)}}}else{if(bF.isFunction(b0)){return b3.ready(b0)}}if(b0.selector!==L){this.selector=b0.selector;this.context=b0.context}return bF.makeArray(b0,this)},selector:"",jquery:"1.7.1",length:0,size:function(){return this.length},toArray:function(){return bK.call(this,0)},get:function(b0){return b0==null?this.toArray():(b0<0?this[this.length+b0]:this[b0])},pushStack:function(b1,b3,b0){var b2=this.constructor();if(bF.isArray(b1)){bz.apply(b2,b1)}else{bF.merge(b2,b1)}b2.prevObject=this;b2.context=this.context;if(b3==="find"){b2.selector=this.selector+(this.selector?" ":"")+b0}else{if(b3){b2.selector=this.selector+"."+b3+"("+b0+")"}}return b2},each:function(b1,b0){return bF.each(this,b1,b0)},ready:function(b0){bF.bindReady();bC.add(b0);return this},eq:function(b0){b0=+b0;return b0===-1?this.slice(b0):this.slice(b0,b0+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(bK.apply(this,arguments),"slice",bK.call(arguments).join(","))},map:function(b0){return this.pushStack(bF.map(this,function(b2,b1){return b0.call(b2,b1,b2)}))},end:function(){return this.prevObject||this.constructor(null)},push:bz,sort:[].sort,splice:[].splice};bF.fn.init.prototype=bF.fn;bF.extend=bF.fn.extend=function(){var b9,b2,b0,b1,b6,b7,b5=arguments[0]||{},b4=1,b3=arguments.length,b8=false;if(typeof b5==="boolean"){b8=b5;b5=arguments[1]||{};b4=2}if(typeof b5!=="object"&&!bF.isFunction(b5)){b5={}}if(b3===b4){b5=this;--b4}for(;b40){return}bC.fireWith(av,[bF]);if(bF.fn.trigger){bF(av).trigger("ready").off("ready")}}},bindReady:function(){if(bC){return}bC=bF.Callbacks("once memory");if(av.readyState==="complete"){return setTimeout(bF.ready,1)}if(av.addEventListener){av.addEventListener("DOMContentLoaded",e,false);bb.addEventListener("load",bF.ready,false)}else{if(av.attachEvent){av.attachEvent("onreadystatechange",e);bb.attachEvent("onload",bF.ready);var b0=false;try{b0=bb.frameElement==null}catch(b1){}if(av.documentElement.doScroll&&b0){bw()}}}},isFunction:function(b0){return bF.type(b0)==="function"},isArray:Array.isArray||function(b0){return bF.type(b0)==="array"},isWindow:function(b0){return b0&&typeof b0==="object"&&"setInterval" in b0},isNumeric:function(b0){return !isNaN(parseFloat(b0))&&isFinite(b0)},type:function(b0){return b0==null?String(b0):bx[bL.call(b0)]||"object"},isPlainObject:function(b2){if(!b2||bF.type(b2)!=="object"||b2.nodeType||bF.isWindow(b2)){return false}try{if(b2.constructor&&!bG.call(b2,"constructor")&&!bG.call(b2.constructor.prototype,"isPrototypeOf")){return false}}catch(b1){return false}var b0;for(b0 in b2){}return b0===L||bG.call(b2,b0)},isEmptyObject:function(b1){for(var b0 in b1){return false}return true},error:function(b0){throw new Error(b0)},parseJSON:function(b0){if(typeof b0!=="string"||!b0){return null}b0=bF.trim(b0);if(bb.JSON&&bb.JSON.parse){return bb.JSON.parse(b0)}if(bN.test(b0.replace(bW,"@").replace(bP,"]").replace(bJ,""))){return(new Function("return "+b0))()}bF.error("Invalid JSON: "+b0)},parseXML:function(b2){var b0,b1;try{if(bb.DOMParser){b1=new DOMParser();b0=b1.parseFromString(b2,"text/xml")}else{b0=new ActiveXObject("Microsoft.XMLDOM");b0.async="false";b0.loadXML(b2)}}catch(b3){b0=L}if(!b0||!b0.documentElement||b0.getElementsByTagName("parsererror").length){bF.error("Invalid XML: "+b2)}return b0},noop:function(){},globalEval:function(b0){if(b0&&bM.test(b0)){(bb.execScript||function(b1){bb["eval"].call(bb,b1)})(b0)}},camelCase:function(b0){return b0.replace(bZ,"ms-").replace(bB,bT)},nodeName:function(b1,b0){return b1.nodeName&&b1.nodeName.toUpperCase()===b0.toUpperCase()},each:function(b3,b6,b2){var b1,b4=0,b5=b3.length,b0=b5===L||bF.isFunction(b3);if(b2){if(b0){for(b1 in b3){if(b6.apply(b3[b1],b2)===false){break}}}else{for(;b40&&b0[0]&&b0[b1-1])||b1===0||bF.isArray(b0));if(b3){for(;b21?aJ.call(arguments,0):bG;if(!(--bw)){bC.resolveWith(bC,bx)}}}function bz(bF){return function(bG){bB[bF]=arguments.length>1?aJ.call(arguments,0):bG;bC.notifyWith(bE,bB)}}if(e>1){for(;bv
    a";bI=bv.getElementsByTagName("*");bF=bv.getElementsByTagName("a")[0];if(!bI||!bI.length||!bF){return{}}bG=av.createElement("select");bx=bG.appendChild(av.createElement("option"));bE=bv.getElementsByTagName("input")[0];bJ={leadingWhitespace:(bv.firstChild.nodeType===3),tbody:!bv.getElementsByTagName("tbody").length,htmlSerialize:!!bv.getElementsByTagName("link").length,style:/top/.test(bF.getAttribute("style")),hrefNormalized:(bF.getAttribute("href")==="/a"),opacity:/^0.55/.test(bF.style.opacity),cssFloat:!!bF.style.cssFloat,checkOn:(bE.value==="on"),optSelected:bx.selected,getSetAttribute:bv.className!=="t",enctype:!!av.createElement("form").enctype,html5Clone:av.createElement("nav").cloneNode(true).outerHTML!=="<:nav>",submitBubbles:true,changeBubbles:true,focusinBubbles:false,deleteExpando:true,noCloneEvent:true,inlineBlockNeedsLayout:false,shrinkWrapBlocks:false,reliableMarginRight:true};bE.checked=true;bJ.noCloneChecked=bE.cloneNode(true).checked;bG.disabled=true;bJ.optDisabled=!bx.disabled;try{delete bv.test}catch(bC){bJ.deleteExpando=false}if(!bv.addEventListener&&bv.attachEvent&&bv.fireEvent){bv.attachEvent("onclick",function(){bJ.noCloneEvent=false});bv.cloneNode(true).fireEvent("onclick")}bE=av.createElement("input");bE.value="t";bE.setAttribute("type","radio");bJ.radioValue=bE.value==="t";bE.setAttribute("checked","checked");bv.appendChild(bE);bD=av.createDocumentFragment();bD.appendChild(bv.lastChild);bJ.checkClone=bD.cloneNode(true).cloneNode(true).lastChild.checked;bJ.appendChecked=bE.checked;bD.removeChild(bE);bD.appendChild(bv);bv.innerHTML="";if(bb.getComputedStyle){bA=av.createElement("div");bA.style.width="0";bA.style.marginRight="0";bv.style.width="2px";bv.appendChild(bA);bJ.reliableMarginRight=(parseInt((bb.getComputedStyle(bA,null)||{marginRight:0}).marginRight,10)||0)===0}if(bv.attachEvent){for(by in {submit:1,change:1,focusin:1}){bB="on"+by;bw=(bB in bv);if(!bw){bv.setAttribute(bB,"return;");bw=(typeof bv[bB]==="function")}bJ[by+"Bubbles"]=bw}}bD.removeChild(bv);bD=bG=bx=bA=bv=bE=null;b(function(){var bM,bU,bV,bT,bN,bO,bL,bS,bR,e,bP,bQ=av.getElementsByTagName("body")[0];if(!bQ){return}bL=1;bS="position:absolute;top:0;left:0;width:1px;height:1px;margin:0;";bR="visibility:hidden;border:0;";e="style='"+bS+"border:5px solid #000;padding:0;'";bP="
    ";bM=av.createElement("div");bM.style.cssText=bR+"width:0;height:0;position:static;top:0;margin-top:"+bL+"px";bQ.insertBefore(bM,bQ.firstChild);bv=av.createElement("div");bM.appendChild(bv);bv.innerHTML="
    t
    ";bz=bv.getElementsByTagName("td");bw=(bz[0].offsetHeight===0);bz[0].style.display="";bz[1].style.display="none";bJ.reliableHiddenOffsets=bw&&(bz[0].offsetHeight===0);bv.innerHTML="";bv.style.width=bv.style.paddingLeft="1px";b.boxModel=bJ.boxModel=bv.offsetWidth===2;if(typeof bv.style.zoom!=="undefined"){bv.style.display="inline";bv.style.zoom=1;bJ.inlineBlockNeedsLayout=(bv.offsetWidth===2);bv.style.display="";bv.innerHTML="
    ";bJ.shrinkWrapBlocks=(bv.offsetWidth!==2)}bv.style.cssText=bS+bR;bv.innerHTML=bP;bU=bv.firstChild;bV=bU.firstChild;bN=bU.nextSibling.firstChild.firstChild;bO={doesNotAddBorder:(bV.offsetTop!==5),doesAddBorderForTableAndCells:(bN.offsetTop===5)};bV.style.position="fixed";bV.style.top="20px";bO.fixedPosition=(bV.offsetTop===20||bV.offsetTop===15);bV.style.position=bV.style.top="";bU.style.overflow="hidden";bU.style.position="relative";bO.subtractsBorderForOverflowNotVisible=(bV.offsetTop===-5);bO.doesNotIncludeMarginInBodyOffset=(bQ.offsetTop!==bL);bQ.removeChild(bM);bv=bM=null;b.extend(bJ,bO)});return bJ})();var aS=/^(?:\{.*\}|\[.*\])$/,aA=/([A-Z])/g;b.extend({cache:{},uuid:0,expando:"jQuery"+(b.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:true,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:true},hasData:function(e){e=e.nodeType?b.cache[e[b.expando]]:e[b.expando];return !!e&&!S(e)},data:function(bx,bv,bz,by){if(!b.acceptData(bx)){return}var bG,bA,bD,bE=b.expando,bC=typeof bv==="string",bF=bx.nodeType,e=bF?b.cache:bx,bw=bF?bx[bE]:bx[bE]&&bE,bB=bv==="events";if((!bw||!e[bw]||(!bB&&!by&&!e[bw].data))&&bC&&bz===L){return}if(!bw){if(bF){bx[bE]=bw=++b.uuid}else{bw=bE}}if(!e[bw]){e[bw]={};if(!bF){e[bw].toJSON=b.noop}}if(typeof bv==="object"||typeof bv==="function"){if(by){e[bw]=b.extend(e[bw],bv)}else{e[bw].data=b.extend(e[bw].data,bv)}}bG=bA=e[bw];if(!by){if(!bA.data){bA.data={}}bA=bA.data}if(bz!==L){bA[b.camelCase(bv)]=bz}if(bB&&!bA[bv]){return bG.events}if(bC){bD=bA[bv];if(bD==null){bD=bA[b.camelCase(bv)]}}else{bD=bA}return bD},removeData:function(bx,bv,by){if(!b.acceptData(bx)){return}var bB,bA,bz,bC=b.expando,bD=bx.nodeType,e=bD?b.cache:bx,bw=bD?bx[bC]:bC;if(!e[bw]){return}if(bv){bB=by?e[bw]:e[bw].data;if(bB){if(!b.isArray(bv)){if(bv in bB){bv=[bv]}else{bv=b.camelCase(bv);if(bv in bB){bv=[bv]}else{bv=bv.split(" ")}}}for(bA=0,bz=bv.length;bA-1){return true}}return false},val:function(bx){var e,bv,by,bw=this[0];if(!arguments.length){if(bw){e=b.valHooks[bw.nodeName.toLowerCase()]||b.valHooks[bw.type];if(e&&"get" in e&&(bv=e.get(bw,"value"))!==L){return bv}bv=bw.value;return typeof bv==="string"?bv.replace(aU,""):bv==null?"":bv}return}by=b.isFunction(bx);return this.each(function(bA){var bz=b(this),bB;if(this.nodeType!==1){return}if(by){bB=bx.call(this,bA,bz.val())}else{bB=bx}if(bB==null){bB=""}else{if(typeof bB==="number"){bB+=""}else{if(b.isArray(bB)){bB=b.map(bB,function(bC){return bC==null?"":bC+""})}}}e=b.valHooks[this.nodeName.toLowerCase()]||b.valHooks[this.type];if(!e||!("set" in e)||e.set(this,bB,"value")===L){this.value=bB}})}});b.extend({valHooks:{option:{get:function(e){var bv=e.attributes.value;return !bv||bv.specified?e.value:e.text}},select:{get:function(e){var bA,bv,bz,bx,by=e.selectedIndex,bB=[],bC=e.options,bw=e.type==="select-one";if(by<0){return null}bv=bw?by:0;bz=bw?by+1:bC.length;for(;bv=0});if(!e.length){bv.selectedIndex=-1}return e}}},attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(bA,bx,bB,bz){var bw,e,by,bv=bA.nodeType;if(!bA||bv===3||bv===8||bv===2){return}if(bz&&bx in b.attrFn){return b(bA)[bx](bB)}if(typeof bA.getAttribute==="undefined"){return b.prop(bA,bx,bB)}by=bv!==1||!b.isXMLDoc(bA);if(by){bx=bx.toLowerCase();e=b.attrHooks[bx]||(ao.test(bx)?aY:be)}if(bB!==L){if(bB===null){b.removeAttr(bA,bx);return}else{if(e&&"set" in e&&by&&(bw=e.set(bA,bB,bx))!==L){return bw}else{bA.setAttribute(bx,""+bB);return bB}}}else{if(e&&"get" in e&&by&&(bw=e.get(bA,bx))!==null){return bw}else{bw=bA.getAttribute(bx);return bw===null?L:bw}}},removeAttr:function(bx,bz){var by,bA,bv,e,bw=0;if(bz&&bx.nodeType===1){bA=bz.toLowerCase().split(af);e=bA.length;for(;bw=0)}}})});var bd=/^(?:textarea|input|select)$/i,n=/^([^\.]*)?(?:\.(.+))?$/,J=/\bhover(\.\S+)?\b/,aO=/^key/,bf=/^(?:mouse|contextmenu)|click/,T=/^(?:focusinfocus|focusoutblur)$/,U=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,Y=function(e){var bv=U.exec(e);if(bv){bv[1]=(bv[1]||"").toLowerCase();bv[3]=bv[3]&&new RegExp("(?:^|\\s)"+bv[3]+"(?:\\s|$)")}return bv},j=function(bw,e){var bv=bw.attributes||{};return((!e[1]||bw.nodeName.toLowerCase()===e[1])&&(!e[2]||(bv.id||{}).value===e[2])&&(!e[3]||e[3].test((bv["class"]||{}).value)))},bt=function(e){return b.event.special.hover?e:e.replace(J,"mouseenter$1 mouseleave$1")};b.event={add:function(bx,bC,bJ,bA,by){var bD,bB,bK,bI,bH,bF,e,bG,bv,bz,bw,bE;if(bx.nodeType===3||bx.nodeType===8||!bC||!bJ||!(bD=b._data(bx))){return}if(bJ.handler){bv=bJ;bJ=bv.handler}if(!bJ.guid){bJ.guid=b.guid++}bK=bD.events;if(!bK){bD.events=bK={}}bB=bD.handle;if(!bB){bD.handle=bB=function(bL){return typeof b!=="undefined"&&(!bL||b.event.triggered!==bL.type)?b.event.dispatch.apply(bB.elem,arguments):L};bB.elem=bx}bC=b.trim(bt(bC)).split(" ");for(bI=0;bI=0){bG=bG.slice(0,-1);bw=true}if(bG.indexOf(".")>=0){bx=bG.split(".");bG=bx.shift();bx.sort()}if((!bA||b.event.customEvent[bG])&&!b.event.global[bG]){return}bv=typeof bv==="object"?bv[b.expando]?bv:new b.Event(bG,bv):new b.Event(bG);bv.type=bG;bv.isTrigger=true;bv.exclusive=bw;bv.namespace=bx.join(".");bv.namespace_re=bv.namespace?new RegExp("(^|\\.)"+bx.join("\\.(?:.*\\.)?")+"(\\.|$)"):null;by=bG.indexOf(":")<0?"on"+bG:"";if(!bA){e=b.cache;for(bC in e){if(e[bC].events&&e[bC].events[bG]){b.event.trigger(bv,bD,e[bC].handle.elem,true)}}return}bv.result=L;if(!bv.target){bv.target=bA}bD=bD!=null?b.makeArray(bD):[];bD.unshift(bv);bF=b.event.special[bG]||{};if(bF.trigger&&bF.trigger.apply(bA,bD)===false){return}bB=[[bA,bF.bindType||bG]];if(!bJ&&!bF.noBubble&&!b.isWindow(bA)){bI=bF.delegateType||bG;bH=T.test(bI+bG)?bA:bA.parentNode;bz=null;for(;bH;bH=bH.parentNode){bB.push([bH,bI]);bz=bH}if(bz&&bz===bA.ownerDocument){bB.push([bz.defaultView||bz.parentWindow||bb,bI])}}for(bC=0;bCbA){bH.push({elem:this,matches:bz.slice(bA)})}for(bC=0;bC0?this.on(e,null,bx,bw):this.trigger(e)};if(b.attrFn){b.attrFn[e]=true}if(aO.test(e)){b.event.fixHooks[e]=b.event.keyHooks}if(bf.test(e)){b.event.fixHooks[e]=b.event.mouseHooks}}); -/*! - * Sizzle CSS Selector Engine - * Copyright 2011, The Dojo Foundation - * Released under the MIT, BSD, and GPL Licenses. - * More information: http://sizzlejs.com/ - */ -(function(){var bH=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,bC="sizcache"+(Math.random()+"").replace(".",""),bI=0,bL=Object.prototype.toString,bB=false,bA=true,bK=/\\/g,bO=/\r\n/g,bQ=/\W/;[0,0].sort(function(){bA=false;return 0});var by=function(bV,e,bY,bZ){bY=bY||[];e=e||av;var b1=e;if(e.nodeType!==1&&e.nodeType!==9){return[]}if(!bV||typeof bV!=="string"){return bY}var bS,b3,b6,bR,b2,b5,b4,bX,bU=true,bT=by.isXML(e),bW=[],b0=bV;do{bH.exec("");bS=bH.exec(b0);if(bS){b0=bS[3];bW.push(bS[1]);if(bS[2]){bR=bS[3];break}}}while(bS);if(bW.length>1&&bD.exec(bV)){if(bW.length===2&&bE.relative[bW[0]]){b3=bM(bW[0]+bW[1],e,bZ)}else{b3=bE.relative[bW[0]]?[e]:by(bW.shift(),e);while(bW.length){bV=bW.shift();if(bE.relative[bV]){bV+=bW.shift()}b3=bM(bV,b3,bZ)}}}else{if(!bZ&&bW.length>1&&e.nodeType===9&&!bT&&bE.match.ID.test(bW[0])&&!bE.match.ID.test(bW[bW.length-1])){b2=by.find(bW.shift(),e,bT);e=b2.expr?by.filter(b2.expr,b2.set)[0]:b2.set[0]}if(e){b2=bZ?{expr:bW.pop(),set:bF(bZ)}:by.find(bW.pop(),bW.length===1&&(bW[0]==="~"||bW[0]==="+")&&e.parentNode?e.parentNode:e,bT);b3=b2.expr?by.filter(b2.expr,b2.set):b2.set;if(bW.length>0){b6=bF(b3)}else{bU=false}while(bW.length){b5=bW.pop();b4=b5;if(!bE.relative[b5]){b5=""}else{b4=bW.pop()}if(b4==null){b4=e}bE.relative[b5](b6,b4,bT)}}else{b6=bW=[]}}if(!b6){b6=b3}if(!b6){by.error(b5||bV)}if(bL.call(b6)==="[object Array]"){if(!bU){bY.push.apply(bY,b6)}else{if(e&&e.nodeType===1){for(bX=0;b6[bX]!=null;bX++){if(b6[bX]&&(b6[bX]===true||b6[bX].nodeType===1&&by.contains(e,b6[bX]))){bY.push(b3[bX])}}}else{for(bX=0;b6[bX]!=null;bX++){if(b6[bX]&&b6[bX].nodeType===1){bY.push(b3[bX])}}}}}else{bF(b6,bY)}if(bR){by(bR,b1,bY,bZ);by.uniqueSort(bY)}return bY};by.uniqueSort=function(bR){if(bJ){bB=bA;bR.sort(bJ);if(bB){for(var e=1;e0};by.find=function(bX,e,bY){var bW,bS,bU,bT,bV,bR;if(!bX){return[]}for(bS=0,bU=bE.order.length;bS":function(bW,bR){var bV,bU=typeof bR==="string",bS=0,e=bW.length;if(bU&&!bQ.test(bR)){bR=bR.toLowerCase();for(;bS=0)){if(!bS){e.push(bV)}}else{if(bS){bR[bU]=false}}}}return false},ID:function(e){return e[1].replace(bK,"")},TAG:function(bR,e){return bR[1].replace(bK,"").toLowerCase()},CHILD:function(e){if(e[1]==="nth"){if(!e[2]){by.error(e[0])}e[2]=e[2].replace(/^\+|\s*/g,"");var bR=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(e[2]==="even"&&"2n"||e[2]==="odd"&&"2n+1"||!/\D/.test(e[2])&&"0n+"+e[2]||e[2]);e[2]=(bR[1]+(bR[2]||1))-0;e[3]=bR[3]-0}else{if(e[2]){by.error(e[0])}}e[0]=bI++;return e},ATTR:function(bU,bR,bS,e,bV,bW){var bT=bU[1]=bU[1].replace(bK,"");if(!bW&&bE.attrMap[bT]){bU[1]=bE.attrMap[bT]}bU[4]=(bU[4]||bU[5]||"").replace(bK,"");if(bU[2]==="~="){bU[4]=" "+bU[4]+" "}return bU},PSEUDO:function(bU,bR,bS,e,bV){if(bU[1]==="not"){if((bH.exec(bU[3])||"").length>1||/^\w/.test(bU[3])){bU[3]=by(bU[3],null,null,bR)}else{var bT=by.filter(bU[3],bR,bS,true^bV);if(!bS){e.push.apply(e,bT)}return false}}else{if(bE.match.POS.test(bU[0])||bE.match.CHILD.test(bU[0])){return true}}return bU},POS:function(e){e.unshift(true);return e}},filters:{enabled:function(e){return e.disabled===false&&e.type!=="hidden"},disabled:function(e){return e.disabled===true},checked:function(e){return e.checked===true},selected:function(e){if(e.parentNode){e.parentNode.selectedIndex}return e.selected===true},parent:function(e){return !!e.firstChild},empty:function(e){return !e.firstChild},has:function(bS,bR,e){return !!by(e[3],bS).length},header:function(e){return(/h\d/i).test(e.nodeName)},text:function(bS){var e=bS.getAttribute("type"),bR=bS.type;return bS.nodeName.toLowerCase()==="input"&&"text"===bR&&(e===bR||e===null)},radio:function(e){return e.nodeName.toLowerCase()==="input"&&"radio"===e.type},checkbox:function(e){return e.nodeName.toLowerCase()==="input"&&"checkbox"===e.type},file:function(e){return e.nodeName.toLowerCase()==="input"&&"file"===e.type},password:function(e){return e.nodeName.toLowerCase()==="input"&&"password"===e.type},submit:function(bR){var e=bR.nodeName.toLowerCase();return(e==="input"||e==="button")&&"submit"===bR.type},image:function(e){return e.nodeName.toLowerCase()==="input"&&"image"===e.type},reset:function(bR){var e=bR.nodeName.toLowerCase();return(e==="input"||e==="button")&&"reset"===bR.type},button:function(bR){var e=bR.nodeName.toLowerCase();return e==="input"&&"button"===bR.type||e==="button"},input:function(e){return(/input|select|textarea|button/i).test(e.nodeName)},focus:function(e){return e===e.ownerDocument.activeElement}},setFilters:{first:function(bR,e){return e===0},last:function(bS,bR,e,bT){return bR===bT.length-1},even:function(bR,e){return e%2===0},odd:function(bR,e){return e%2===1},lt:function(bS,bR,e){return bRe[3]-0},nth:function(bS,bR,e){return e[3]-0===bR},eq:function(bS,bR,e){return e[3]-0===bR}},filter:{PSEUDO:function(bS,bX,bW,bY){var e=bX[1],bR=bE.filters[e];if(bR){return bR(bS,bW,bX,bY)}else{if(e==="contains"){return(bS.textContent||bS.innerText||bw([bS])||"").indexOf(bX[3])>=0}else{if(e==="not"){var bT=bX[3];for(var bV=0,bU=bT.length;bV=0)}}},ID:function(bR,e){return bR.nodeType===1&&bR.getAttribute("id")===e},TAG:function(bR,e){return(e==="*"&&bR.nodeType===1)||!!bR.nodeName&&bR.nodeName.toLowerCase()===e},CLASS:function(bR,e){return(" "+(bR.className||bR.getAttribute("class"))+" ").indexOf(e)>-1},ATTR:function(bV,bT){var bS=bT[1],e=by.attr?by.attr(bV,bS):bE.attrHandle[bS]?bE.attrHandle[bS](bV):bV[bS]!=null?bV[bS]:bV.getAttribute(bS),bW=e+"",bU=bT[2],bR=bT[4];return e==null?bU==="!=":!bU&&by.attr?e!=null:bU==="="?bW===bR:bU==="*="?bW.indexOf(bR)>=0:bU==="~="?(" "+bW+" ").indexOf(bR)>=0:!bR?bW&&e!==false:bU==="!="?bW!==bR:bU==="^="?bW.indexOf(bR)===0:bU==="$="?bW.substr(bW.length-bR.length)===bR:bU==="|="?bW===bR||bW.substr(0,bR.length+1)===bR+"-":false},POS:function(bU,bR,bS,bV){var e=bR[2],bT=bE.setFilters[e];if(bT){return bT(bU,bS,bR,bV)}}}};var bD=bE.match.POS,bx=function(bR,e){return"\\"+(e-0+1)};for(var bz in bE.match){bE.match[bz]=new RegExp(bE.match[bz].source+(/(?![^\[]*\])(?![^\(]*\))/.source));bE.leftMatch[bz]=new RegExp(/(^(?:.|\r|\n)*?)/.source+bE.match[bz].source.replace(/\\(\d+)/g,bx))}var bF=function(bR,e){bR=Array.prototype.slice.call(bR,0);if(e){e.push.apply(e,bR);return e}return bR};try{Array.prototype.slice.call(av.documentElement.childNodes,0)[0].nodeType}catch(bP){bF=function(bU,bT){var bS=0,bR=bT||[];if(bL.call(bU)==="[object Array]"){Array.prototype.push.apply(bR,bU)}else{if(typeof bU.length==="number"){for(var e=bU.length;bS";e.insertBefore(bR,e.firstChild);if(av.getElementById(bS)){bE.find.ID=function(bU,bV,bW){if(typeof bV.getElementById!=="undefined"&&!bW){var bT=bV.getElementById(bU[1]);return bT?bT.id===bU[1]||typeof bT.getAttributeNode!=="undefined"&&bT.getAttributeNode("id").nodeValue===bU[1]?[bT]:L:[]}};bE.filter.ID=function(bV,bT){var bU=typeof bV.getAttributeNode!=="undefined"&&bV.getAttributeNode("id");return bV.nodeType===1&&bU&&bU.nodeValue===bT}}e.removeChild(bR);e=bR=null})();(function(){var e=av.createElement("div");e.appendChild(av.createComment(""));if(e.getElementsByTagName("*").length>0){bE.find.TAG=function(bR,bV){var bU=bV.getElementsByTagName(bR[1]);if(bR[1]==="*"){var bT=[];for(var bS=0;bU[bS];bS++){if(bU[bS].nodeType===1){bT.push(bU[bS])}}bU=bT}return bU}}e.innerHTML="";if(e.firstChild&&typeof e.firstChild.getAttribute!=="undefined"&&e.firstChild.getAttribute("href")!=="#"){bE.attrHandle.href=function(bR){return bR.getAttribute("href",2)}}e=null})();if(av.querySelectorAll){(function(){var e=by,bT=av.createElement("div"),bS="__sizzle__";bT.innerHTML="

    ";if(bT.querySelectorAll&&bT.querySelectorAll(".TEST").length===0){return}by=function(b4,bV,bZ,b3){bV=bV||av;if(!b3&&!by.isXML(bV)){var b2=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b4);if(b2&&(bV.nodeType===1||bV.nodeType===9)){if(b2[1]){return bF(bV.getElementsByTagName(b4),bZ)}else{if(b2[2]&&bE.find.CLASS&&bV.getElementsByClassName){return bF(bV.getElementsByClassName(b2[2]),bZ)}}}if(bV.nodeType===9){if(b4==="body"&&bV.body){return bF([bV.body],bZ)}else{if(b2&&b2[3]){var bY=bV.getElementById(b2[3]);if(bY&&bY.parentNode){if(bY.id===b2[3]){return bF([bY],bZ)}}else{return bF([],bZ)}}}try{return bF(bV.querySelectorAll(b4),bZ)}catch(b0){}}else{if(bV.nodeType===1&&bV.nodeName.toLowerCase()!=="object"){var bW=bV,bX=bV.getAttribute("id"),bU=bX||bS,b6=bV.parentNode,b5=/^\s*[+~]/.test(b4);if(!bX){bV.setAttribute("id",bU)}else{bU=bU.replace(/'/g,"\\$&")}if(b5&&b6){bV=bV.parentNode}try{if(!b5||b6){return bF(bV.querySelectorAll("[id='"+bU+"'] "+b4),bZ)}}catch(b1){}finally{if(!bX){bW.removeAttribute("id")}}}}}return e(b4,bV,bZ,b3)};for(var bR in e){by[bR]=e[bR]}bT=null})()}(function(){var e=av.documentElement,bS=e.matchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.msMatchesSelector;if(bS){var bU=!bS.call(av.createElement("div"),"div"),bR=false;try{bS.call(av.documentElement,"[test!='']:sizzle")}catch(bT){bR=true}by.matchesSelector=function(bW,bY){bY=bY.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!by.isXML(bW)){try{if(bR||!bE.match.PSEUDO.test(bY)&&!/!=/.test(bY)){var bV=bS.call(bW,bY);if(bV||!bU||bW.document&&bW.document.nodeType!==11){return bV}}}catch(bX){}}return by(bY,null,null,[bW]).length>0}}})();(function(){var e=av.createElement("div");e.innerHTML="
    ";if(!e.getElementsByClassName||e.getElementsByClassName("e").length===0){return}e.lastChild.className="e";if(e.getElementsByClassName("e").length===1){return}bE.order.splice(1,0,"CLASS");bE.find.CLASS=function(bR,bS,bT){if(typeof bS.getElementsByClassName!=="undefined"&&!bT){return bS.getElementsByClassName(bR[1])}};e=null})();function bv(bR,bW,bV,bZ,bX,bY){for(var bT=0,bS=bZ.length;bT0){bU=e;break}}}e=e[bR]}bZ[bT]=bU}}}if(av.documentElement.contains){by.contains=function(bR,e){return bR!==e&&(bR.contains?bR.contains(e):true)}}else{if(av.documentElement.compareDocumentPosition){by.contains=function(bR,e){return !!(bR.compareDocumentPosition(e)&16)}}else{by.contains=function(){return false}}}by.isXML=function(e){var bR=(e?e.ownerDocument||e:0).documentElement;return bR?bR.nodeName!=="HTML":false};var bM=function(bS,e,bW){var bV,bX=[],bU="",bY=e.nodeType?[e]:e;while((bV=bE.match.PSEUDO.exec(bS))){bU+=bV[0];bS=bS.replace(bE.match.PSEUDO,"")}bS=bE.relative[bS]?bS+"*":bS;for(var bT=0,bR=bY.length;bT0){for(bB=bA;bB=0:b.filter(e,this).length>0:this.filter(e).length>0)},closest:function(by,bx){var bv=[],bw,e,bz=this[0];if(b.isArray(by)){var bB=1;while(bz&&bz.ownerDocument&&bz!==bx){for(bw=0;bw-1:b.find.matchesSelector(bz,by)){bv.push(bz);break}else{bz=bz.parentNode;if(!bz||!bz.ownerDocument||bz===bx||bz.nodeType===11){break}}}}bv=bv.length>1?b.unique(bv):bv;return this.pushStack(bv,"closest",by)},index:function(e){if(!e){return(this[0]&&this[0].parentNode)?this.prevAll().length:-1}if(typeof e==="string"){return b.inArray(this[0],b(e))}return b.inArray(e.jquery?e[0]:e,this)},add:function(e,bv){var bx=typeof e==="string"?b(e,bv):b.makeArray(e&&e.nodeType?[e]:e),bw=b.merge(this.get(),bx);return this.pushStack(C(bx[0])||C(bw[0])?bw:b.unique(bw))},andSelf:function(){return this.add(this.prevObject)}});function C(e){return !e||!e.parentNode||e.parentNode.nodeType===11}b.each({parent:function(bv){var e=bv.parentNode;return e&&e.nodeType!==11?e:null},parents:function(e){return b.dir(e,"parentNode")},parentsUntil:function(bv,e,bw){return b.dir(bv,"parentNode",bw)},next:function(e){return b.nth(e,2,"nextSibling")},prev:function(e){return b.nth(e,2,"previousSibling")},nextAll:function(e){return b.dir(e,"nextSibling")},prevAll:function(e){return b.dir(e,"previousSibling")},nextUntil:function(bv,e,bw){return b.dir(bv,"nextSibling",bw)},prevUntil:function(bv,e,bw){return b.dir(bv,"previousSibling",bw)},siblings:function(e){return b.sibling(e.parentNode.firstChild,e)},children:function(e){return b.sibling(e.firstChild)},contents:function(e){return b.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:b.makeArray(e.childNodes)}},function(e,bv){b.fn[e]=function(by,bw){var bx=b.map(this,bv,by);if(!ab.test(e)){bw=by}if(bw&&typeof bw==="string"){bx=b.filter(bw,bx)}bx=this.length>1&&!ay[e]?b.unique(bx):bx;if((this.length>1||a9.test(bw))&&aq.test(e)){bx=bx.reverse()}return this.pushStack(bx,e,P.call(arguments).join(","))}});b.extend({filter:function(bw,e,bv){if(bv){bw=":not("+bw+")"}return e.length===1?b.find.matchesSelector(e[0],bw)?[e[0]]:[]:b.find.matches(bw,e)},dir:function(bw,bv,by){var e=[],bx=bw[bv];while(bx&&bx.nodeType!==9&&(by===L||bx.nodeType!==1||!b(bx).is(by))){if(bx.nodeType===1){e.push(bx)}bx=bx[bv]}return e},nth:function(by,e,bw,bx){e=e||1;var bv=0;for(;by;by=by[bw]){if(by.nodeType===1&&++bv===e){break}}return by},sibling:function(bw,bv){var e=[];for(;bw;bw=bw.nextSibling){if(bw.nodeType===1&&bw!==bv){e.push(bw)}}return e}});function aG(bx,bw,e){bw=bw||0;if(b.isFunction(bw)){return b.grep(bx,function(bz,by){var bA=!!bw.call(bz,by,bz);return bA===e})}else{if(bw.nodeType){return b.grep(bx,function(bz,by){return(bz===bw)===e})}else{if(typeof bw==="string"){var bv=b.grep(bx,function(by){return by.nodeType===1});if(bp.test(bw)){return b.filter(bw,bv,!e)}else{bw=b.filter(bw,bv)}}}}return b.grep(bx,function(bz,by){return(b.inArray(bz,bw)>=0)===e})}function a(e){var bw=aR.split("|"),bv=e.createDocumentFragment();if(bv.createElement){while(bw.length){bv.createElement(bw.pop())}}return bv}var aR="abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",ag=/ jQuery\d+="(?:\d+|null)"/g,ar=/^\s+/,R=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,d=/<([\w:]+)/,w=/",""],legend:[1,"
    ","
    "],thead:[1,"","
    "],tr:[2,"","
    "],td:[3,"","
    "],col:[2,"","
    "],area:[1,"",""],_default:[0,"",""]},ac=a(av);ax.optgroup=ax.option;ax.tbody=ax.tfoot=ax.colgroup=ax.caption=ax.thead;ax.th=ax.td;if(!b.support.htmlSerialize){ax._default=[1,"div
    ","
    "]}b.fn.extend({text:function(e){if(b.isFunction(e)){return this.each(function(bw){var bv=b(this);bv.text(e.call(this,bw,bv.text()))})}if(typeof e!=="object"&&e!==L){return this.empty().append((this[0]&&this[0].ownerDocument||av).createTextNode(e))}return b.text(this)},wrapAll:function(e){if(b.isFunction(e)){return this.each(function(bw){b(this).wrapAll(e.call(this,bw))})}if(this[0]){var bv=b(e,this[0].ownerDocument).eq(0).clone(true);if(this[0].parentNode){bv.insertBefore(this[0])}bv.map(function(){var bw=this;while(bw.firstChild&&bw.firstChild.nodeType===1){bw=bw.firstChild}return bw}).append(this)}return this},wrapInner:function(e){if(b.isFunction(e)){return this.each(function(bv){b(this).wrapInner(e.call(this,bv))})}return this.each(function(){var bv=b(this),bw=bv.contents();if(bw.length){bw.wrapAll(e)}else{bv.append(e)}})},wrap:function(e){var bv=b.isFunction(e);return this.each(function(bw){b(this).wrapAll(bv?e.call(this,bw):e)})},unwrap:function(){return this.parent().each(function(){if(!b.nodeName(this,"body")){b(this).replaceWith(this.childNodes)}}).end()},append:function(){return this.domManip(arguments,true,function(e){if(this.nodeType===1){this.appendChild(e)}})},prepend:function(){return this.domManip(arguments,true,function(e){if(this.nodeType===1){this.insertBefore(e,this.firstChild)}})},before:function(){if(this[0]&&this[0].parentNode){return this.domManip(arguments,false,function(bv){this.parentNode.insertBefore(bv,this)})}else{if(arguments.length){var e=b.clean(arguments);e.push.apply(e,this.toArray());return this.pushStack(e,"before",arguments)}}},after:function(){if(this[0]&&this[0].parentNode){return this.domManip(arguments,false,function(bv){this.parentNode.insertBefore(bv,this.nextSibling)})}else{if(arguments.length){var e=this.pushStack(this,"after",arguments);e.push.apply(e,b.clean(arguments));return e}}},remove:function(e,bx){for(var bv=0,bw;(bw=this[bv])!=null;bv++){if(!e||b.filter(e,[bw]).length){if(!bx&&bw.nodeType===1){b.cleanData(bw.getElementsByTagName("*"));b.cleanData([bw])}if(bw.parentNode){bw.parentNode.removeChild(bw)}}}return this},empty:function(){for(var e=0,bv;(bv=this[e])!=null;e++){if(bv.nodeType===1){b.cleanData(bv.getElementsByTagName("*"))}while(bv.firstChild){bv.removeChild(bv.firstChild)}}return this},clone:function(bv,e){bv=bv==null?false:bv;e=e==null?bv:e;return this.map(function(){return b.clone(this,bv,e)})},html:function(bx){if(bx===L){return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(ag,""):null}else{if(typeof bx==="string"&&!ae.test(bx)&&(b.support.leadingWhitespace||!ar.test(bx))&&!ax[(d.exec(bx)||["",""])[1].toLowerCase()]){bx=bx.replace(R,"<$1>");try{for(var bw=0,bv=this.length;bw1&&bw0?this.clone(true):this).get();b(bC[bA])[bv](by);bz=bz.concat(by)}return this.pushStack(bz,e,bC.selector)}}});function bg(e){if(typeof e.getElementsByTagName!=="undefined"){return e.getElementsByTagName("*")}else{if(typeof e.querySelectorAll!=="undefined"){return e.querySelectorAll("*")}else{return[]}}}function az(e){if(e.type==="checkbox"||e.type==="radio"){e.defaultChecked=e.checked}}function E(e){var bv=(e.nodeName||"").toLowerCase();if(bv==="input"){az(e)}else{if(bv!=="script"&&typeof e.getElementsByTagName!=="undefined"){b.grep(e.getElementsByTagName("input"),az)}}}function al(e){var bv=av.createElement("div");ac.appendChild(bv);bv.innerHTML=e.outerHTML;return bv.firstChild}b.extend({clone:function(by,bA,bw){var e,bv,bx,bz=b.support.html5Clone||!ah.test("<"+by.nodeName)?by.cloneNode(true):al(by);if((!b.support.noCloneEvent||!b.support.noCloneChecked)&&(by.nodeType===1||by.nodeType===11)&&!b.isXMLDoc(by)){ai(by,bz);e=bg(by);bv=bg(bz);for(bx=0;e[bx];++bx){if(bv[bx]){ai(e[bx],bv[bx])}}}if(bA){t(by,bz);if(bw){e=bg(by);bv=bg(bz);for(bx=0;e[bx];++bx){t(e[bx],bv[bx])}}}e=bv=null;return bz},clean:function(bw,by,bH,bA){var bF;by=by||av;if(typeof by.createElement==="undefined"){by=by.ownerDocument||by[0]&&by[0].ownerDocument||av}var bI=[],bB;for(var bE=0,bz;(bz=bw[bE])!=null;bE++){if(typeof bz==="number"){bz+=""}if(!bz){continue}if(typeof bz==="string"){if(!W.test(bz)){bz=by.createTextNode(bz)}else{bz=bz.replace(R,"<$1>");var bK=(d.exec(bz)||["",""])[1].toLowerCase(),bx=ax[bK]||ax._default,bD=bx[0],bv=by.createElement("div");if(by===av){ac.appendChild(bv)}else{a(by).appendChild(bv)}bv.innerHTML=bx[1]+bz+bx[2];while(bD--){bv=bv.lastChild}if(!b.support.tbody){var e=w.test(bz),bC=bK==="table"&&!e?bv.firstChild&&bv.firstChild.childNodes:bx[1]===""&&!e?bv.childNodes:[];for(bB=bC.length-1;bB>=0;--bB){if(b.nodeName(bC[bB],"tbody")&&!bC[bB].childNodes.length){bC[bB].parentNode.removeChild(bC[bB])}}}if(!b.support.leadingWhitespace&&ar.test(bz)){bv.insertBefore(by.createTextNode(ar.exec(bz)[0]),bv.firstChild)}bz=bv.childNodes}}var bG;if(!b.support.appendChecked){if(bz[0]&&typeof(bG=bz.length)==="number"){for(bB=0;bB=0){return bx+"px"}}else{return bx}}}});if(!b.support.opacity){b.cssHooks.opacity={get:function(bv,e){return au.test((e&&bv.currentStyle?bv.currentStyle.filter:bv.style.filter)||"")?(parseFloat(RegExp.$1)/100)+"":e?"1":""},set:function(by,bz){var bx=by.style,bv=by.currentStyle,e=b.isNumeric(bz)?"alpha(opacity="+bz*100+")":"",bw=bv&&bv.filter||bx.filter||"";bx.zoom=1;if(bz>=1&&b.trim(bw.replace(ak,""))===""){bx.removeAttribute("filter");if(bv&&!bv.filter){return}}bx.filter=ak.test(bw)?bw.replace(ak,e):bw+" "+e}}}b(function(){if(!b.support.reliableMarginRight){b.cssHooks.marginRight={get:function(bw,bv){var e;b.swap(bw,{display:"inline-block"},function(){if(bv){e=Z(bw,"margin-right","marginRight")}else{e=bw.style.marginRight}});return e}}}});if(av.defaultView&&av.defaultView.getComputedStyle){aI=function(by,bw){var bv,bx,e;bw=bw.replace(z,"-$1").toLowerCase();if((bx=by.ownerDocument.defaultView)&&(e=bx.getComputedStyle(by,null))){bv=e.getPropertyValue(bw);if(bv===""&&!b.contains(by.ownerDocument.documentElement,by)){bv=b.style(by,bw)}}return bv}}if(av.documentElement.currentStyle){aX=function(bz,bw){var bA,e,by,bv=bz.currentStyle&&bz.currentStyle[bw],bx=bz.style;if(bv===null&&bx&&(by=bx[bw])){bv=by}if(!bc.test(bv)&&bn.test(bv)){bA=bx.left;e=bz.runtimeStyle&&bz.runtimeStyle.left;if(e){bz.runtimeStyle.left=bz.currentStyle.left}bx.left=bw==="fontSize"?"1em":(bv||0);bv=bx.pixelLeft+"px";bx.left=bA;if(e){bz.runtimeStyle.left=e}}return bv===""?"auto":bv}}Z=aI||aX;function p(by,bw,bv){var bA=bw==="width"?by.offsetWidth:by.offsetHeight,bz=bw==="width"?an:a1,bx=0,e=bz.length;if(bA>0){if(bv!=="border"){for(;bx)<[^<]*)*<\/script>/gi,q=/^(?:select|textarea)/i,h=/\s+/,br=/([?&])_=[^&]*/,K=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,A=b.fn.load,aa={},r={},aE,s,aV=["*/"]+["*"];try{aE=bl.href}catch(aw){aE=av.createElement("a");aE.href="";aE=aE.href}s=K.exec(aE.toLowerCase())||[];function f(e){return function(by,bA){if(typeof by!=="string"){bA=by;by="*"}if(b.isFunction(bA)){var bx=by.toLowerCase().split(h),bw=0,bz=bx.length,bv,bB,bC;for(;bw=0){var e=bw.slice(by,bw.length);bw=bw.slice(0,by)}var bx="GET";if(bz){if(b.isFunction(bz)){bA=bz;bz=L}else{if(typeof bz==="object"){bz=b.param(bz,b.ajaxSettings.traditional);bx="POST"}}}var bv=this;b.ajax({url:bw,type:bx,dataType:"html",data:bz,complete:function(bC,bB,bD){bD=bC.responseText;if(bC.isResolved()){bC.done(function(bE){bD=bE});bv.html(e?b("
    ").append(bD.replace(a6,"")).find(e):bD)}if(bA){bv.each(bA,[bD,bB,bC])}}});return this},serialize:function(){return b.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?b.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||q.test(this.nodeName)||aZ.test(this.type))}).map(function(e,bv){var bw=b(this).val();return bw==null?null:b.isArray(bw)?b.map(bw,function(by,bx){return{name:bv.name,value:by.replace(bs,"\r\n")}}):{name:bv.name,value:bw.replace(bs,"\r\n")}}).get()}});b.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(e,bv){b.fn[bv]=function(bw){return this.on(bv,bw)}});b.each(["get","post"],function(e,bv){b[bv]=function(bw,by,bz,bx){if(b.isFunction(by)){bx=bx||bz;bz=by;by=L}return b.ajax({type:bv,url:bw,data:by,success:bz,dataType:bx})}});b.extend({getScript:function(e,bv){return b.get(e,L,bv,"script")},getJSON:function(e,bv,bw){return b.get(e,bv,bw,"json")},ajaxSetup:function(bv,e){if(e){am(bv,b.ajaxSettings)}else{e=bv;bv=b.ajaxSettings}am(bv,e);return bv},ajaxSettings:{url:aE,isLocal:aM.test(s[1]),global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":aV},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":bb.String,"text html":true,"text json":b.parseJSON,"text xml":b.parseXML},flatOptions:{context:true,url:true}},ajaxPrefilter:f(aa),ajaxTransport:f(r),ajax:function(bz,bx){if(typeof bz==="object"){bx=bz;bz=L}bx=bx||{};var bD=b.ajaxSetup({},bx),bS=bD.context||bD,bG=bS!==bD&&(bS.nodeType||bS instanceof b)?b(bS):b.event,bR=b.Deferred(),bN=b.Callbacks("once memory"),bB=bD.statusCode||{},bC,bH={},bO={},bQ,by,bL,bE,bI,bA=0,bw,bK,bJ={readyState:0,setRequestHeader:function(bT,bU){if(!bA){var e=bT.toLowerCase();bT=bO[e]=bO[e]||bT;bH[bT]=bU}return this},getAllResponseHeaders:function(){return bA===2?bQ:null},getResponseHeader:function(bT){var e;if(bA===2){if(!by){by={};while((e=aD.exec(bQ))){by[e[1].toLowerCase()]=e[2]}}e=by[bT.toLowerCase()]}return e===L?null:e},overrideMimeType:function(e){if(!bA){bD.mimeType=e}return this},abort:function(e){e=e||"abort";if(bL){bL.abort(e)}bF(0,e);return this}};function bF(bZ,bU,b0,bW){if(bA===2){return}bA=2;if(bE){clearTimeout(bE)}bL=L;bQ=bW||"";bJ.readyState=bZ>0?4:0;var bT,b4,b3,bX=bU,bY=b0?bj(bD,bJ,b0):L,bV,b2;if(bZ>=200&&bZ<300||bZ===304){if(bD.ifModified){if((bV=bJ.getResponseHeader("Last-Modified"))){b.lastModified[bC]=bV}if((b2=bJ.getResponseHeader("Etag"))){b.etag[bC]=b2}}if(bZ===304){bX="notmodified";bT=true}else{try{b4=G(bD,bY);bX="success";bT=true}catch(b1){bX="parsererror";b3=b1}}}else{b3=bX;if(!bX||bZ){bX="error";if(bZ<0){bZ=0}}}bJ.status=bZ;bJ.statusText=""+(bU||bX);if(bT){bR.resolveWith(bS,[b4,bX,bJ])}else{bR.rejectWith(bS,[bJ,bX,b3])}bJ.statusCode(bB);bB=L;if(bw){bG.trigger("ajax"+(bT?"Success":"Error"),[bJ,bD,bT?b4:b3])}bN.fireWith(bS,[bJ,bX]);if(bw){bG.trigger("ajaxComplete",[bJ,bD]);if(!(--b.active)){b.event.trigger("ajaxStop")}}}bR.promise(bJ);bJ.success=bJ.done;bJ.error=bJ.fail;bJ.complete=bN.add;bJ.statusCode=function(bT){if(bT){var e;if(bA<2){for(e in bT){bB[e]=[bB[e],bT[e]]}}else{e=bT[bJ.status];bJ.then(e,e)}}return this};bD.url=((bz||bD.url)+"").replace(bq,"").replace(c,s[1]+"//");bD.dataTypes=b.trim(bD.dataType||"*").toLowerCase().split(h);if(bD.crossDomain==null){bI=K.exec(bD.url.toLowerCase());bD.crossDomain=!!(bI&&(bI[1]!=s[1]||bI[2]!=s[2]||(bI[3]||(bI[1]==="http:"?80:443))!=(s[3]||(s[1]==="http:"?80:443))))}if(bD.data&&bD.processData&&typeof bD.data!=="string"){bD.data=b.param(bD.data,bD.traditional)}aW(aa,bD,bx,bJ);if(bA===2){return false}bw=bD.global;bD.type=bD.type.toUpperCase();bD.hasContent=!aQ.test(bD.type);if(bw&&b.active++===0){b.event.trigger("ajaxStart")}if(!bD.hasContent){if(bD.data){bD.url+=(M.test(bD.url)?"&":"?")+bD.data;delete bD.data}bC=bD.url;if(bD.cache===false){var bv=b.now(),bP=bD.url.replace(br,"$1_="+bv);bD.url=bP+((bP===bD.url)?(M.test(bD.url)?"&":"?")+"_="+bv:"")}}if(bD.data&&bD.hasContent&&bD.contentType!==false||bx.contentType){bJ.setRequestHeader("Content-Type",bD.contentType)}if(bD.ifModified){bC=bC||bD.url;if(b.lastModified[bC]){bJ.setRequestHeader("If-Modified-Since",b.lastModified[bC])}if(b.etag[bC]){bJ.setRequestHeader("If-None-Match",b.etag[bC])}}bJ.setRequestHeader("Accept",bD.dataTypes[0]&&bD.accepts[bD.dataTypes[0]]?bD.accepts[bD.dataTypes[0]]+(bD.dataTypes[0]!=="*"?", "+aV+"; q=0.01":""):bD.accepts["*"]);for(bK in bD.headers){bJ.setRequestHeader(bK,bD.headers[bK])}if(bD.beforeSend&&(bD.beforeSend.call(bS,bJ,bD)===false||bA===2)){bJ.abort();return false}for(bK in {success:1,error:1,complete:1}){bJ[bK](bD[bK])}bL=aW(r,bD,bx,bJ);if(!bL){bF(-1,"No Transport")}else{bJ.readyState=1;if(bw){bG.trigger("ajaxSend",[bJ,bD])}if(bD.async&&bD.timeout>0){bE=setTimeout(function(){bJ.abort("timeout")},bD.timeout)}try{bA=1;bL.send(bH,bF)}catch(bM){if(bA<2){bF(-1,bM)}else{throw bM}}}return bJ},param:function(e,bw){var bv=[],by=function(bz,bA){bA=b.isFunction(bA)?bA():bA;bv[bv.length]=encodeURIComponent(bz)+"="+encodeURIComponent(bA)};if(bw===L){bw=b.ajaxSettings.traditional}if(b.isArray(e)||(e.jquery&&!b.isPlainObject(e))){b.each(e,function(){by(this.name,this.value)})}else{for(var bx in e){v(bx,e[bx],bw,by)}}return bv.join("&").replace(k,"+")}});function v(bw,by,bv,bx){if(b.isArray(by)){b.each(by,function(bA,bz){if(bv||ap.test(bw)){bx(bw,bz)}else{v(bw+"["+(typeof bz==="object"||b.isArray(bz)?bA:"")+"]",bz,bv,bx)}})}else{if(!bv&&by!=null&&typeof by==="object"){for(var e in by){v(bw+"["+e+"]",by[e],bv,bx)}}else{bx(bw,by)}}}b.extend({active:0,lastModified:{},etag:{}});function bj(bD,bC,bz){var bv=bD.contents,bB=bD.dataTypes,bw=bD.responseFields,by,bA,bx,e;for(bA in bw){if(bA in bz){bC[bw[bA]]=bz[bA]}}while(bB[0]==="*"){bB.shift();if(by===L){by=bD.mimeType||bC.getResponseHeader("content-type")}}if(by){for(bA in bv){if(bv[bA]&&bv[bA].test(by)){bB.unshift(bA);break}}}if(bB[0] in bz){bx=bB[0]}else{for(bA in bz){if(!bB[0]||bD.converters[bA+" "+bB[0]]){bx=bA;break}if(!e){e=bA}}bx=bx||e}if(bx){if(bx!==bB[0]){bB.unshift(bx)}return bz[bx]}}function G(bH,bz){if(bH.dataFilter){bz=bH.dataFilter(bz,bH.dataType)}var bD=bH.dataTypes,bG={},bA,bE,bw=bD.length,bB,bC=bD[0],bx,by,bF,bv,e;for(bA=1;bA=bw.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();bw.animatedProperties[this.prop]=true;for(bA in bw.animatedProperties){if(bw.animatedProperties[bA]!==true){e=false}}if(e){if(bw.overflow!=null&&!b.support.shrinkWrapBlocks){b.each(["","X","Y"],function(bC,bD){bz.style["overflow"+bD]=bw.overflow[bC]})}if(bw.hide){b(bz).hide()}if(bw.hide||bw.show){for(bA in bw.animatedProperties){b.style(bz,bA,bw.orig[bA]);b.removeData(bz,"fxshow"+bA,true);b.removeData(bz,"toggle"+bA,true)}}bv=bw.complete;if(bv){bw.complete=false;bv.call(bz)}}return false}else{if(bw.duration==Infinity){this.now=bx}else{bB=bx-this.startTime;this.state=bB/bw.duration;this.pos=b.easing[bw.animatedProperties[this.prop]](this.state,bB,0,1,bw.duration);this.now=this.start+((this.end-this.start)*this.pos)}this.update()}return true}};b.extend(b.fx,{tick:function(){var bw,bv=b.timers,e=0;for(;e").appendTo(e),bw=bv.css("display");bv.remove();if(bw==="none"||bw===""){if(!a8){a8=av.createElement("iframe");a8.frameBorder=a8.width=a8.height=0}e.appendChild(a8);if(!m||!a8.createElement){m=(a8.contentWindow||a8.contentDocument).document;m.write((av.compatMode==="CSS1Compat"?"":"")+"");m.close()}bv=m.createElement(bx);m.body.appendChild(bv);bw=b.css(bv,"display");e.removeChild(a8)}Q[bx]=bw}return Q[bx]}var V=/^t(?:able|d|h)$/i,ad=/^(?:body|html)$/i;if("getBoundingClientRect" in av.documentElement){b.fn.offset=function(bI){var by=this[0],bB;if(bI){return this.each(function(e){b.offset.setOffset(this,bI,e)})}if(!by||!by.ownerDocument){return null}if(by===by.ownerDocument.body){return b.offset.bodyOffset(by)}try{bB=by.getBoundingClientRect()}catch(bF){}var bH=by.ownerDocument,bw=bH.documentElement;if(!bB||!b.contains(bw,by)){return bB?{top:bB.top,left:bB.left}:{top:0,left:0}}var bC=bH.body,bD=aK(bH),bA=bw.clientTop||bC.clientTop||0,bE=bw.clientLeft||bC.clientLeft||0,bv=bD.pageYOffset||b.support.boxModel&&bw.scrollTop||bC.scrollTop,bz=bD.pageXOffset||b.support.boxModel&&bw.scrollLeft||bC.scrollLeft,bG=bB.top+bv-bA,bx=bB.left+bz-bE;return{top:bG,left:bx}}}else{b.fn.offset=function(bF){var bz=this[0];if(bF){return this.each(function(bG){b.offset.setOffset(this,bF,bG)})}if(!bz||!bz.ownerDocument){return null}if(bz===bz.ownerDocument.body){return b.offset.bodyOffset(bz)}var bC,bw=bz.offsetParent,bv=bz,bE=bz.ownerDocument,bx=bE.documentElement,bA=bE.body,bB=bE.defaultView,e=bB?bB.getComputedStyle(bz,null):bz.currentStyle,bD=bz.offsetTop,by=bz.offsetLeft;while((bz=bz.parentNode)&&bz!==bA&&bz!==bx){if(b.support.fixedPosition&&e.position==="fixed"){break}bC=bB?bB.getComputedStyle(bz,null):bz.currentStyle;bD-=bz.scrollTop;by-=bz.scrollLeft;if(bz===bw){bD+=bz.offsetTop;by+=bz.offsetLeft;if(b.support.doesNotAddBorder&&!(b.support.doesAddBorderForTableAndCells&&V.test(bz.nodeName))){bD+=parseFloat(bC.borderTopWidth)||0;by+=parseFloat(bC.borderLeftWidth)||0}bv=bw;bw=bz.offsetParent}if(b.support.subtractsBorderForOverflowNotVisible&&bC.overflow!=="visible"){bD+=parseFloat(bC.borderTopWidth)||0;by+=parseFloat(bC.borderLeftWidth)||0}e=bC}if(e.position==="relative"||e.position==="static"){bD+=bA.offsetTop;by+=bA.offsetLeft}if(b.support.fixedPosition&&e.position==="fixed"){bD+=Math.max(bx.scrollTop,bA.scrollTop);by+=Math.max(bx.scrollLeft,bA.scrollLeft)}return{top:bD,left:by}}}b.offset={bodyOffset:function(e){var bw=e.offsetTop,bv=e.offsetLeft;if(b.support.doesNotIncludeMarginInBodyOffset){bw+=parseFloat(b.css(e,"marginTop"))||0;bv+=parseFloat(b.css(e,"marginLeft"))||0}return{top:bw,left:bv}},setOffset:function(bx,bG,bA){var bB=b.css(bx,"position");if(bB==="static"){bx.style.position="relative"}var bz=b(bx),bv=bz.offset(),e=b.css(bx,"top"),bE=b.css(bx,"left"),bF=(bB==="absolute"||bB==="fixed")&&b.inArray("auto",[e,bE])>-1,bD={},bC={},bw,by;if(bF){bC=bz.position();bw=bC.top;by=bC.left}else{bw=parseFloat(e)||0;by=parseFloat(bE)||0}if(b.isFunction(bG)){bG=bG.call(bx,bA,bv)}if(bG.top!=null){bD.top=(bG.top-bv.top)+bw}if(bG.left!=null){bD.left=(bG.left-bv.left)+by}if("using" in bG){bG.using.call(bx,bD)}else{bz.css(bD)}}};b.fn.extend({position:function(){if(!this[0]){return null}var bw=this[0],bv=this.offsetParent(),bx=this.offset(),e=ad.test(bv[0].nodeName)?{top:0,left:0}:bv.offset();bx.top-=parseFloat(b.css(bw,"marginTop"))||0;bx.left-=parseFloat(b.css(bw,"marginLeft"))||0;e.top+=parseFloat(b.css(bv[0],"borderTopWidth"))||0;e.left+=parseFloat(b.css(bv[0],"borderLeftWidth"))||0;return{top:bx.top-e.top,left:bx.left-e.left}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||av.body;while(e&&(!ad.test(e.nodeName)&&b.css(e,"position")==="static")){e=e.offsetParent}return e})}});b.each(["Left","Top"],function(bv,e){var bw="scroll"+e;b.fn[bw]=function(bz){var bx,by;if(bz===L){bx=this[0];if(!bx){return null}by=aK(bx);return by?("pageXOffset" in by)?by[bv?"pageYOffset":"pageXOffset"]:b.support.boxModel&&by.document.documentElement[bw]||by.document.body[bw]:bx[bw]}return this.each(function(){by=aK(this);if(by){by.scrollTo(!bv?bz:b(by).scrollLeft(),bv?bz:b(by).scrollTop())}else{this[bw]=bz}})}});function aK(e){return b.isWindow(e)?e:e.nodeType===9?e.defaultView||e.parentWindow:false}b.each(["Height","Width"],function(bv,e){var bw=e.toLowerCase();b.fn["inner"+e]=function(){var bx=this[0];return bx?bx.style?parseFloat(b.css(bx,bw,"padding")):this[bw]():null};b.fn["outer"+e]=function(by){var bx=this[0];return bx?bx.style?parseFloat(b.css(bx,bw,by?"margin":"border")):this[bw]():null};b.fn[bw]=function(bz){var bA=this[0];if(!bA){return bz==null?null:this}if(b.isFunction(bz)){return this.each(function(bE){var bD=b(this);bD[bw](bz.call(this,bE,bD[bw]()))})}if(b.isWindow(bA)){var bB=bA.document.documentElement["client"+e],bx=bA.document.body;return bA.document.compatMode==="CSS1Compat"&&bB||bx&&bx["client"+e]||bB}else{if(bA.nodeType===9){return Math.max(bA.documentElement["client"+e],bA.body["scroll"+e],bA.documentElement["scroll"+e],bA.body["offset"+e],bA.documentElement["offset"+e])}else{if(bz===L){var bC=b.css(bA,bw),by=parseFloat(bC);return b.isNumeric(by)?by:bC}else{return this.css(bw,typeof bz==="string"?bz:bz+"px")}}}}});bb.jQuery=bb.$=b;if(typeof define==="function"&&define.amd&&define.amd.jQuery){define("jquery",[],function(){return b})}})(window);/*! - * jQuery UI 1.8.18 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI - */ -(function(a,d){a.ui=a.ui||{};if(a.ui.version){return}a.extend(a.ui,{version:"1.8.18",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}});a.fn.extend({propAttr:a.fn.prop||a.fn.attr,_focus:a.fn.focus,focus:function(e,f){return typeof e==="number"?this.each(function(){var g=this;setTimeout(function(){a(g).focus();if(f){f.call(g)}},e)}):this._focus.apply(this,arguments)},scrollParent:function(){var e;if((a.browser.msie&&(/(static|relative)/).test(this.css("position")))||(/absolute/).test(this.css("position"))){e=this.parents().filter(function(){return(/(relative|absolute|fixed)/).test(a.curCSS(this,"position",1))&&(/(auto|scroll)/).test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0)}else{e=this.parents().filter(function(){return(/(auto|scroll)/).test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0)}return(/fixed/).test(this.css("position"))||!e.length?a(document):e},zIndex:function(h){if(h!==d){return this.css("zIndex",h)}if(this.length){var f=a(this[0]),e,g;while(f.length&&f[0]!==document){e=f.css("position");if(e==="absolute"||e==="relative"||e==="fixed"){g=parseInt(f.css("zIndex"),10);if(!isNaN(g)&&g!==0){return g}}f=f.parent()}}return 0},disableSelection:function(){return this.bind((a.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(e){e.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}});a.each(["Width","Height"],function(g,e){var f=e==="Width"?["Left","Right"]:["Top","Bottom"],h=e.toLowerCase(),k={innerWidth:a.fn.innerWidth,innerHeight:a.fn.innerHeight,outerWidth:a.fn.outerWidth,outerHeight:a.fn.outerHeight};function j(m,l,i,n){a.each(f,function(){l-=parseFloat(a.curCSS(m,"padding"+this,true))||0;if(i){l-=parseFloat(a.curCSS(m,"border"+this+"Width",true))||0}if(n){l-=parseFloat(a.curCSS(m,"margin"+this,true))||0}});return l}a.fn["inner"+e]=function(i){if(i===d){return k["inner"+e].call(this)}return this.each(function(){a(this).css(h,j(this,i)+"px")})};a.fn["outer"+e]=function(i,l){if(typeof i!=="number"){return k["outer"+e].call(this,i)}return this.each(function(){a(this).css(h,j(this,i,true,l)+"px")})}});function c(g,e){var j=g.nodeName.toLowerCase();if("area"===j){var i=g.parentNode,h=i.name,f;if(!g.href||!h||i.nodeName.toLowerCase()!=="map"){return false}f=a("img[usemap=#"+h+"]")[0];return !!f&&b(f)}return(/input|select|textarea|button|object/.test(j)?!g.disabled:"a"==j?g.href||e:e)&&b(g)}function b(e){return !a(e).parents().andSelf().filter(function(){return a.curCSS(this,"visibility")==="hidden"||a.expr.filters.hidden(this)}).length}a.extend(a.expr[":"],{data:function(g,f,e){return !!a.data(g,e[3])},focusable:function(e){return c(e,!isNaN(a.attr(e,"tabindex")))},tabbable:function(g){var e=a.attr(g,"tabindex"),f=isNaN(e);return(f||e>=0)&&c(g,!f)}});a(function(){var e=document.body,f=e.appendChild(f=document.createElement("div"));f.offsetHeight;a.extend(f.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});a.support.minHeight=f.offsetHeight===100;a.support.selectstart="onselectstart" in f;e.removeChild(f).style.display="none"});a.extend(a.ui,{plugin:{add:function(f,g,j){var h=a.ui[f].prototype;for(var e in j){h.plugins[e]=h.plugins[e]||[];h.plugins[e].push([g,j[e]])}},call:function(e,g,f){var j=e.plugins[g];if(!j||!e.element[0].parentNode){return}for(var h=0;h0){return true}h[e]=1;g=(h[e]>0);h[e]=0;return g},isOverAxis:function(f,e,g){return(f>e)&&(f<(e+g))},isOver:function(j,f,i,h,e,g){return a.ui.isOverAxis(j,i,e)&&a.ui.isOverAxis(f,h,g)}})})(jQuery);/*! - * jQuery UI Widget 1.8.18 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Widget - */ -(function(b,d){if(b.cleanData){var c=b.cleanData;b.cleanData=function(f){for(var g=0,h;(h=f[g])!=null;g++){try{b(h).triggerHandler("remove")}catch(j){}}c(f)}}else{var a=b.fn.remove;b.fn.remove=function(e,f){return this.each(function(){if(!f){if(!e||b.filter(e,[this]).length){b("*",this).add([this]).each(function(){try{b(this).triggerHandler("remove")}catch(g){}})}}return a.call(b(this),e,f)})}}b.widget=function(f,h,e){var g=f.split(".")[0],j;f=f.split(".")[1];j=g+"-"+f;if(!e){e=h;h=b.Widget}b.expr[":"][j]=function(k){return !!b.data(k,f)};b[g]=b[g]||{};b[g][f]=function(k,l){if(arguments.length){this._createWidget(k,l)}};var i=new h();i.options=b.extend(true,{},i.options);b[g][f].prototype=b.extend(true,i,{namespace:g,widgetName:f,widgetEventPrefix:b[g][f].prototype.widgetEventPrefix||f,widgetBaseClass:j},e);b.widget.bridge(f,b[g][f])};b.widget.bridge=function(f,e){b.fn[f]=function(i){var g=typeof i==="string",h=Array.prototype.slice.call(arguments,1),j=this;i=!g&&h.length?b.extend.apply(null,[true,i].concat(h)):i;if(g&&i.charAt(0)==="_"){return j}if(g){this.each(function(){var k=b.data(this,f),l=k&&b.isFunction(k[i])?k[i].apply(k,h):k;if(l!==k&&l!==d){j=l;return false}})}else{this.each(function(){var k=b.data(this,f);if(k){k.option(i||{})._init()}else{b.data(this,f,new e(i,this))}})}return j}};b.Widget=function(e,f){if(arguments.length){this._createWidget(e,f)}};b.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:false},_createWidget:function(f,g){b.data(g,this.widgetName,this);this.element=b(g);this.options=b.extend(true,{},this.options,this._getCreateOptions(),f);var e=this;this.element.bind("remove."+this.widgetName,function(){e.destroy()});this._create();this._trigger("create");this._init()},_getCreateOptions:function(){return b.metadata&&b.metadata.get(this.element[0])[this.widgetName]},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName);this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled ui-state-disabled")},widget:function(){return this.element},option:function(f,g){var e=f;if(arguments.length===0){return b.extend({},this.options)}if(typeof f==="string"){if(g===d){return this.options[f]}e={};e[f]=g}this._setOptions(e);return this},_setOptions:function(f){var e=this;b.each(f,function(g,h){e._setOption(g,h)});return this},_setOption:function(e,f){this.options[e]=f;if(e==="disabled"){this.widget()[f?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",f)}return this},enable:function(){return this._setOption("disabled",false)},disable:function(){return this._setOption("disabled",true)},_trigger:function(e,f,g){var j,i,h=this.options[e];g=g||{};f=b.Event(f);f.type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).toLowerCase();f.target=this.element[0];i=f.originalEvent;if(i){for(j in i){if(!(j in f)){f[j]=i[j]}}}this.element.trigger(f,g);return !(b.isFunction(h)&&h.call(this.element[0],f,g)===false||f.isDefaultPrevented())}}})(jQuery);/*! - * jQuery UI Mouse 1.8.18 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Mouse - * - * Depends: - * jquery.ui.widget.js - */ -(function(b,c){var a=false;b(document).mouseup(function(d){a=false});b.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var d=this;this.element.bind("mousedown."+this.widgetName,function(e){return d._mouseDown(e)}).bind("click."+this.widgetName,function(e){if(true===b.data(e.target,d.widgetName+".preventClickEvent")){b.removeData(e.target,d.widgetName+".preventClickEvent");e.stopImmediatePropagation();return false}});this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName)},_mouseDown:function(f){if(a){return}(this._mouseStarted&&this._mouseUp(f));this._mouseDownEvent=f;var e=this,g=(f.which==1),d=(typeof this.options.cancel=="string"&&f.target.nodeName?b(f.target).closest(this.options.cancel).length:false);if(!g||d||!this._mouseCapture(f)){return true}this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){e.mouseDelayMet=true},this.options.delay)}if(this._mouseDistanceMet(f)&&this._mouseDelayMet(f)){this._mouseStarted=(this._mouseStart(f)!==false);if(!this._mouseStarted){f.preventDefault();return true}}if(true===b.data(f.target,this.widgetName+".preventClickEvent")){b.removeData(f.target,this.widgetName+".preventClickEvent")}this._mouseMoveDelegate=function(h){return e._mouseMove(h)};this._mouseUpDelegate=function(h){return e._mouseUp(h)};b(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);f.preventDefault();a=true;return true},_mouseMove:function(d){if(b.browser.msie&&!(document.documentMode>=9)&&!d.button){return this._mouseUp(d)}if(this._mouseStarted){this._mouseDrag(d);return d.preventDefault()}if(this._mouseDistanceMet(d)&&this._mouseDelayMet(d)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,d)!==false);(this._mouseStarted?this._mouseDrag(d):this._mouseUp(d))}return !this._mouseStarted},_mouseUp:function(d){b(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;if(d.target==this._mouseDownEvent.target){b.data(d.target,this.widgetName+".preventClickEvent",true)}this._mouseStop(d)}return false},_mouseDistanceMet:function(d){return(Math.max(Math.abs(this._mouseDownEvent.pageX-d.pageX),Math.abs(this._mouseDownEvent.pageY-d.pageY))>=this.options.distance)},_mouseDelayMet:function(d){return this.mouseDelayMet},_mouseStart:function(d){},_mouseDrag:function(d){},_mouseStop:function(d){},_mouseCapture:function(d){return true}})})(jQuery);(function(c,d){c.widget("ui.resizable",c.ui.mouse,{widgetEventPrefix:"resize",options:{alsoResize:false,animate:false,animateDuration:"slow",animateEasing:"swing",aspectRatio:false,autoHide:false,containment:false,ghost:false,grid:false,handles:"e,s,se",helper:false,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1000},_create:function(){var f=this,k=this.options;this.element.addClass("ui-resizable");c.extend(this,{_aspectRatio:!!(k.aspectRatio),aspectRatio:k.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:k.helper||k.ghost||k.animate?k.helper||"ui-resizable-helper":null});if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)){this.element.wrap(c('
    ').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")}));this.element=this.element.parent().data("resizable",this.element.data("resizable"));this.elementIsWrapper=true;this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")});this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});this.originalResizeStyle=this.originalElement.css("resize");this.originalElement.css("resize","none");this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"}));this.originalElement.css({margin:this.originalElement.css("margin")});this._proportionallyResize()}this.handles=k.handles||(!c(".ui-resizable-handle",this.element).length?"e,s,se":{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"});if(this.handles.constructor==String){if(this.handles=="all"){this.handles="n,e,s,w,se,sw,ne,nw"}var l=this.handles.split(",");this.handles={};for(var g=0;g
    ');if(/sw|se|ne|nw/.test(j)){h.css({zIndex:++k.zIndex})}if("se"==j){h.addClass("ui-icon ui-icon-gripsmall-diagonal-se")}this.handles[j]=".ui-resizable-"+j;this.element.append(h)}}this._renderAxis=function(q){q=q||this.element;for(var n in this.handles){if(this.handles[n].constructor==String){this.handles[n]=c(this.handles[n],this.element).show()}if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var o=c(this.handles[n],this.element),p=0;p=/sw|ne|nw|se|n|s/.test(n)?o.outerHeight():o.outerWidth();var m=["padding",/ne|nw|n/.test(n)?"Top":/se|sw|s/.test(n)?"Bottom":/^e$/.test(n)?"Right":"Left"].join("");q.css(m,p);this._proportionallyResize()}if(!c(this.handles[n]).length){continue}}};this._renderAxis(this.element);this._handles=c(".ui-resizable-handle",this.element).disableSelection();this._handles.mouseover(function(){if(!f.resizing){if(this.className){var i=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)}f.axis=i&&i[1]?i[1]:"se"}});if(k.autoHide){this._handles.hide();c(this.element).addClass("ui-resizable-autohide").hover(function(){if(k.disabled){return}c(this).removeClass("ui-resizable-autohide");f._handles.show()},function(){if(k.disabled){return}if(!f.resizing){c(this).addClass("ui-resizable-autohide");f._handles.hide()}})}this._mouseInit()},destroy:function(){this._mouseDestroy();var e=function(g){c(g).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){e(this.element);var f=this.element;f.after(this.originalElement.css({position:f.css("position"),width:f.outerWidth(),height:f.outerHeight(),top:f.css("top"),left:f.css("left")})).remove()}this.originalElement.css("resize",this.originalResizeStyle);e(this.originalElement);return this},_mouseCapture:function(f){var g=false;for(var e in this.handles){if(c(this.handles[e])[0]==f.target){g=true}}return !this.options.disabled&&g},_mouseStart:function(g){var j=this.options,f=this.element.position(),e=this.element;this.resizing=true;this.documentScroll={top:c(document).scrollTop(),left:c(document).scrollLeft()};if(e.is(".ui-draggable")||(/absolute/).test(e.css("position"))){e.css({position:"absolute",top:f.top,left:f.left})}this._renderProxy();var k=b(this.helper.css("left")),h=b(this.helper.css("top"));if(j.containment){k+=c(j.containment).scrollLeft()||0;h+=c(j.containment).scrollTop()||0}this.offset=this.helper.offset();this.position={left:k,top:h};this.size=this._helper?{width:e.outerWidth(),height:e.outerHeight()}:{width:e.width(),height:e.height()};this.originalSize=this._helper?{width:e.outerWidth(),height:e.outerHeight()}:{width:e.width(),height:e.height()};this.originalPosition={left:k,top:h};this.sizeDiff={width:e.outerWidth()-e.width(),height:e.outerHeight()-e.height()};this.originalMousePosition={left:g.pageX,top:g.pageY};this.aspectRatio=(typeof j.aspectRatio=="number")?j.aspectRatio:((this.originalSize.width/this.originalSize.height)||1);var i=c(".ui-resizable-"+this.axis).css("cursor");c("body").css("cursor",i=="auto"?this.axis+"-resize":i);e.addClass("ui-resizable-resizing");this._propagate("start",g);return true},_mouseDrag:function(e){var h=this.helper,g=this.options,m={},q=this,j=this.originalMousePosition,n=this.axis;var r=(e.pageX-j.left)||0,p=(e.pageY-j.top)||0;var i=this._change[n];if(!i){return false}var l=i.apply(this,[e,r,p]),k=c.browser.msie&&c.browser.version<7,f=this.sizeDiff;this._updateVirtualBoundaries(e.shiftKey);if(this._aspectRatio||e.shiftKey){l=this._updateRatio(l,e)}l=this._respectSize(l,e);this._propagate("resize",e);h.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"});if(!this._helper&&this._proportionallyResizeElements.length){this._proportionallyResize()}this._updateCache(l);this._trigger("resize",e,this.ui());return false},_mouseStop:function(h){this.resizing=false;var i=this.options,m=this;if(this._helper){var g=this._proportionallyResizeElements,e=g.length&&(/textarea/i).test(g[0].nodeName),f=e&&c.ui.hasScroll(g[0],"left")?0:m.sizeDiff.height,k=e?0:m.sizeDiff.width;var n={width:(m.helper.width()-k),height:(m.helper.height()-f)},j=(parseInt(m.element.css("left"),10)+(m.position.left-m.originalPosition.left))||null,l=(parseInt(m.element.css("top"),10)+(m.position.top-m.originalPosition.top))||null;if(!i.animate){this.element.css(c.extend(n,{top:l,left:j}))}m.helper.height(m.size.height);m.helper.width(m.size.width);if(this._helper&&!i.animate){this._proportionallyResize()}}c("body").css("cursor","auto");this.element.removeClass("ui-resizable-resizing");this._propagate("stop",h);if(this._helper){this.helper.remove()}return false},_updateVirtualBoundaries:function(g){var j=this.options,i,h,f,k,e;e={minWidth:a(j.minWidth)?j.minWidth:0,maxWidth:a(j.maxWidth)?j.maxWidth:Infinity,minHeight:a(j.minHeight)?j.minHeight:0,maxHeight:a(j.maxHeight)?j.maxHeight:Infinity};if(this._aspectRatio||g){i=e.minHeight*this.aspectRatio;f=e.minWidth/this.aspectRatio;h=e.maxHeight*this.aspectRatio;k=e.maxWidth/this.aspectRatio;if(i>e.minWidth){e.minWidth=i}if(f>e.minHeight){e.minHeight=f}if(hl.width),s=a(l.height)&&i.minHeight&&(i.minHeight>l.height);if(h){l.width=i.minWidth}if(s){l.height=i.minHeight}if(t){l.width=i.maxWidth}if(m){l.height=i.maxHeight}var f=this.originalPosition.left+this.originalSize.width,p=this.position.top+this.size.height;var k=/sw|nw|w/.test(q),e=/nw|ne|n/.test(q);if(h&&k){l.left=f-i.minWidth}if(t&&k){l.left=f-i.maxWidth}if(s&&e){l.top=p-i.minHeight}if(m&&e){l.top=p-i.maxHeight}var n=!l.width&&!l.height;if(n&&!l.left&&l.top){l.top=null}else{if(n&&!l.top&&l.left){l.left=null}}return l},_proportionallyResize:function(){var k=this.options;if(!this._proportionallyResizeElements.length){return}var g=this.helper||this.element;for(var f=0;f');var e=c.browser.msie&&c.browser.version<7,g=(e?1:0),h=(e?2:-1);this.helper.addClass(this._helper).css({width:this.element.outerWidth()+h,height:this.element.outerHeight()+h,position:"absolute",left:this.elementOffset.left-g+"px",top:this.elementOffset.top-g+"px",zIndex:++i.zIndex});this.helper.appendTo("body").disableSelection()}else{this.helper=this.element}},_change:{e:function(g,f,e){return{width:this.originalSize.width+f}},w:function(h,f,e){var j=this.options,g=this.originalSize,i=this.originalPosition;return{left:i.left+f,width:g.width-f}},n:function(h,f,e){var j=this.options,g=this.originalSize,i=this.originalPosition;return{top:i.top+e,height:g.height-e}},s:function(g,f,e){return{height:this.originalSize.height+e}},se:function(g,f,e){return c.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[g,f,e]))},sw:function(g,f,e){return c.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[g,f,e]))},ne:function(g,f,e){return c.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[g,f,e]))},nw:function(g,f,e){return c.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[g,f,e]))}},_propagate:function(f,e){c.ui.plugin.call(this,f,[e,this.ui()]);(f!="resize"&&this._trigger(f,e,this.ui()))},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}});c.extend(c.ui.resizable,{version:"1.8.18"});c.ui.plugin.add("resizable","alsoResize",{start:function(f,g){var e=c(this).data("resizable"),i=e.options;var h=function(j){c(j).each(function(){var k=c(this);k.data("resizable-alsoresize",{width:parseInt(k.width(),10),height:parseInt(k.height(),10),left:parseInt(k.css("left"),10),top:parseInt(k.css("top"),10)})})};if(typeof(i.alsoResize)=="object"&&!i.alsoResize.parentNode){if(i.alsoResize.length){i.alsoResize=i.alsoResize[0];h(i.alsoResize)}else{c.each(i.alsoResize,function(j){h(j)})}}else{h(i.alsoResize)}},resize:function(g,i){var f=c(this).data("resizable"),j=f.options,h=f.originalSize,l=f.originalPosition;var k={height:(f.size.height-h.height)||0,width:(f.size.width-h.width)||0,top:(f.position.top-l.top)||0,left:(f.position.left-l.left)||0},e=function(m,n){c(m).each(function(){var q=c(this),r=c(this).data("resizable-alsoresize"),p={},o=n&&n.length?n:q.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];c.each(o,function(s,u){var t=(r[u]||0)+(k[u]||0);if(t&&t>=0){p[u]=t||null}});q.css(p)})};if(typeof(j.alsoResize)=="object"&&!j.alsoResize.nodeType){c.each(j.alsoResize,function(m,n){e(m,n)})}else{e(j.alsoResize)}},stop:function(e,f){c(this).removeData("resizable-alsoresize")}});c.ui.plugin.add("resizable","animate",{stop:function(i,n){var p=c(this).data("resizable"),j=p.options;var h=p._proportionallyResizeElements,e=h.length&&(/textarea/i).test(h[0].nodeName),f=e&&c.ui.hasScroll(h[0],"left")?0:p.sizeDiff.height,l=e?0:p.sizeDiff.width;var g={width:(p.size.width-l),height:(p.size.height-f)},k=(parseInt(p.element.css("left"),10)+(p.position.left-p.originalPosition.left))||null,m=(parseInt(p.element.css("top"),10)+(p.position.top-p.originalPosition.top))||null;p.element.animate(c.extend(g,m&&k?{top:m,left:k}:{}),{duration:j.animateDuration,easing:j.animateEasing,step:function(){var o={width:parseInt(p.element.css("width"),10),height:parseInt(p.element.css("height"),10),top:parseInt(p.element.css("top"),10),left:parseInt(p.element.css("left"),10)};if(h&&h.length){c(h[0]).css({width:o.width,height:o.height})}p._updateCache(o);p._propagate("resize",i)}})}});c.ui.plugin.add("resizable","containment",{start:function(f,r){var t=c(this).data("resizable"),j=t.options,l=t.element;var g=j.containment,k=(g instanceof c)?g.get(0):(/parent/.test(g))?l.parent().get(0):g;if(!k){return}t.containerElement=c(k);if(/document/.test(g)||g==document){t.containerOffset={left:0,top:0};t.containerPosition={left:0,top:0};t.parentData={element:c(document),left:0,top:0,width:c(document).width(),height:c(document).height()||document.body.parentNode.scrollHeight}}else{var n=c(k),i=[];c(["Top","Right","Left","Bottom"]).each(function(p,o){i[p]=b(n.css("padding"+o))});t.containerOffset=n.offset();t.containerPosition=n.position();t.containerSize={height:(n.innerHeight()-i[3]),width:(n.innerWidth()-i[1])};var q=t.containerOffset,e=t.containerSize.height,m=t.containerSize.width,h=(c.ui.hasScroll(k,"left")?k.scrollWidth:m),s=(c.ui.hasScroll(k)?k.scrollHeight:e);t.parentData={element:k,left:q.left,top:q.top,width:h,height:s}}},resize:function(g,q){var t=c(this).data("resizable"),i=t.options,f=t.containerSize,p=t.containerOffset,m=t.size,n=t.position,r=t._aspectRatio||g.shiftKey,e={top:0,left:0},h=t.containerElement;if(h[0]!=document&&(/static/).test(h.css("position"))){e=p}if(n.left<(t._helper?p.left:0)){t.size.width=t.size.width+(t._helper?(t.position.left-p.left):(t.position.left-e.left));if(r){t.size.height=t.size.width/i.aspectRatio}t.position.left=i.helper?p.left:0}if(n.top<(t._helper?p.top:0)){t.size.height=t.size.height+(t._helper?(t.position.top-p.top):t.position.top);if(r){t.size.width=t.size.height*i.aspectRatio}t.position.top=t._helper?p.top:0}t.offset.left=t.parentData.left+t.position.left;t.offset.top=t.parentData.top+t.position.top;var l=Math.abs((t._helper?t.offset.left-e.left:(t.offset.left-e.left))+t.sizeDiff.width),s=Math.abs((t._helper?t.offset.top-e.top:(t.offset.top-p.top))+t.sizeDiff.height);var k=t.containerElement.get(0)==t.element.parent().get(0),j=/relative|absolute/.test(t.containerElement.css("position"));if(k&&j){l-=t.parentData.left}if(l+t.size.width>=t.parentData.width){t.size.width=t.parentData.width-l;if(r){t.size.height=t.size.width/t.aspectRatio}}if(s+t.size.height>=t.parentData.height){t.size.height=t.parentData.height-s;if(r){t.size.width=t.size.height*t.aspectRatio}}},stop:function(f,n){var q=c(this).data("resizable"),g=q.options,l=q.position,m=q.containerOffset,e=q.containerPosition,i=q.containerElement;var j=c(q.helper),r=j.offset(),p=j.outerWidth()-q.sizeDiff.width,k=j.outerHeight()-q.sizeDiff.height;if(q._helper&&!g.animate&&(/relative/).test(i.css("position"))){c(this).css({left:r.left-e.left-m.left,width:p,height:k})}if(q._helper&&!g.animate&&(/static/).test(i.css("position"))){c(this).css({left:r.left-e.left-m.left,width:p,height:k})}}});c.ui.plugin.add("resizable","ghost",{start:function(g,h){var e=c(this).data("resizable"),i=e.options,f=e.size;e.ghost=e.originalElement.clone();e.ghost.css({opacity:0.25,display:"block",position:"relative",height:f.height,width:f.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof i.ghost=="string"?i.ghost:"");e.ghost.appendTo(e.helper)},resize:function(f,g){var e=c(this).data("resizable"),h=e.options;if(e.ghost){e.ghost.css({position:"relative",height:e.size.height,width:e.size.width})}},stop:function(f,g){var e=c(this).data("resizable"),h=e.options;if(e.ghost&&e.helper){e.helper.get(0).removeChild(e.ghost.get(0))}}});c.ui.plugin.add("resizable","grid",{resize:function(e,m){var p=c(this).data("resizable"),h=p.options,k=p.size,i=p.originalSize,j=p.originalPosition,n=p.axis,l=h._aspectRatio||e.shiftKey;h.grid=typeof h.grid=="number"?[h.grid,h.grid]:h.grid;var g=Math.round((k.width-i.width)/(h.grid[0]||1))*(h.grid[0]||1),f=Math.round((k.height-i.height)/(h.grid[1]||1))*(h.grid[1]||1);if(/^(se|s|e)$/.test(n)){p.size.width=i.width+g;p.size.height=i.height+f}else{if(/^(ne)$/.test(n)){p.size.width=i.width+g;p.size.height=i.height+f;p.position.top=j.top-f}else{if(/^(sw)$/.test(n)){p.size.width=i.width+g;p.size.height=i.height+f;p.position.left=j.left-g}else{p.size.width=i.width+g;p.size.height=i.height+f;p.position.top=j.top-f;p.position.left=j.left-g}}}}});var b=function(e){return parseInt(e,10)||0};var a=function(e){return !isNaN(parseInt(e,10))}})(jQuery);/*! - * jQuery hashchange event - v1.3 - 7/21/2010 - * http://benalman.com/projects/jquery-hashchange-plugin/ - * - * Copyright (c) 2010 "Cowboy" Ben Alman - * Dual licensed under the MIT and GPL licenses. - * http://benalman.com/about/license/ - */ -(function($,e,b){var c="hashchange",h=document,f,g=$.event.special,i=h.documentMode,d="on"+c in e&&(i===b||i>7);function a(j){j=j||location.href;return"#"+j.replace(/^[^#]*#?(.*)$/,"$1")}$.fn[c]=function(j){return j?this.bind(c,j):this.trigger(c)};$.fn[c].delay=50;g[c]=$.extend(g[c],{setup:function(){if(d){return false}$(f.start)},teardown:function(){if(d){return false}$(f.stop)}});f=(function(){var j={},p,m=a(),k=function(q){return q},l=k,o=k;j.start=function(){p||n()};j.stop=function(){p&&clearTimeout(p);p=b};function n(){var r=a(),q=o(m);if(r!==m){l(m=r,q);$(e).trigger(c)}else{if(q!==m){location.href=location.href.replace(/#.*/,"")+q}}p=setTimeout(n,$.fn[c].delay)}$.browser.msie&&!d&&(function(){var q,r;j.start=function(){if(!q){r=$.fn[c].src;r=r&&r+a();q=$(' +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    -
    -
    -
    Manual
    +
    +
    Manual

    Table of Contents

    @@ -82,27 +90,28 @@
    -

    +

    +

    Available Commands

    - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + +
    Command Description
    trim Trim reads in aligned BAM
    variants Call variants from aligned BAM file
    filtervariants Filter variants across replicates or multiple samples aligned using the same reference
    consensus Call consensus from aligned BAM file
    getmasked Detect primer mismatches and get primer indices for the amplicon to be masked
    removereads Remove reads from trimmed BAM file
    version Show version information
    trimadapter (EXPERIMENTAL) Trim adapter sequences from reads
    Command Description
    trim Trim reads in aligned BAM
    variants Call variants from aligned BAM file
    filtervariants Filter variants across replicates or multiple samples aligned using the same reference
    consensus Call consensus from aligned BAM file
    getmasked Detect primer mismatches and get primer indices for the amplicon to be masked
    removereads Remove reads from trimmed BAM file
    version Show version information
    trimadapter (EXPERIMENTAL) Trim adapter sequences from reads

    To view detailed usage for each command type ivar <command> Note : Commands maked (EXPERIMENTAL) are still under active development.

    @@ -112,113 +121,190 @@

    iVar uses primer positions supplied in a BED file to soft clip primer sequences from an aligned and sorted BAM file. Following this, the reads are trimmed based on a quality threshold(Default: 20). To do the quality trimming, iVar uses a sliding window approach(Default: 4). The windows slides from the 5' end to the 3' end and if at any point the average base quality in the window falls below the threshold, the remaining read is soft clipped. If after trimming, the length of the read is greater than the minimum length specified(Default: 30), the read is written to the new trimmed BAM file.

    Please note that the strand is taken into account while doing the trimming so forward primers are trimmed only from forward strand and reverse primers are trimmed from reverse strand.

    To sort and index an aligned BAM file (OPTIONAL, if index is not present iVar will create one), the following command can be used,

    -
    # Input file - test.bam
    samtools sort -o test.sorted.bam test.bam && samtools index test.sorted.bam.

    Note: All the trimming in iVar is done by soft-clipping reads in an aligned BAM file. This information is lost if reads are extracted in fastq or fasta format from the trimmed BAM file.

    -

    Command:

    ivar trim
    Usage: ivar trim -i <input.bam> -b <primers.bed> -p <prefix> [-m <min-length>] [-q <min-quality>] [-s <sliding-window-width>]
    Input Options Description
    -i (Required) Sorted bam file, with aligned reads, to trim primers and quality
    -b (Required) BED file with primer sequences and positions
    -m Minimum length of read to retain after trimming (Default: 30)
    -q Minimum quality threshold for sliding window to pass (Default: 20)
    -s Width of sliding window (Default: 4)
    -e Include reads with no primers. By default, reads with no primers are excluded
    Output Options Description
    -p (Required) Prefix for the output BAM file

    Example Usage:

    ivar trim -b test_primers.bed -p test.trimmed -i test.bam -q 15 -m 50 -s 4

    The command above will produce a trimmed BAM file test.trimmed.bam after trimming the aligned reads in test.bam using the primer positions specified in test_primers.bed and a minimum quality threshold of 15, minimum read length of 50 and a sliding window of 4.

    +
    # Input file - test.bam
    +
    samtools sort -o test.sorted.bam test.bam && samtools index test.sorted.bam.
    +

    Note: All the trimming in iVar is done by soft-clipping reads in an aligned BAM file. This information is lost if reads are extracted in fastq or fasta format from the trimmed BAM file.

    +

    Command:

    ivar trim
    +
    +
    Usage: ivar trim -i [<input.bam>] -b <primers.bed> [-p <prefix>] [-m <min-length>] [-q <min-quality>] [-s <sliding-window-width>]
    +
    +
    Input Options Description
    +
    -i Sorted bam file, with aligned reads, to trim primers and quality. If not specified will read from standard in
    +
    -b (Required) BED file with primer sequences and positions
    +
    -f Primer pair information file containing left and right primer names for the same amplicon separated by a tab
    +
    If provided, reads will be filtered based on their overlap with amplicons prior to trimming
    +
    -m Minimum length of read to retain after trimming (Default: 50% the average length of the first 1000 reads)
    +
    -q Minimum quality threshold for sliding window to pass (Default: 20)
    +
    -s Width of sliding window (Default: 4)
    +
    -e Include reads with no primers. By default, reads with no primers are excluded
    +
    -k Keep reads to allow for reanalysis: keep reads which would be dropped by
    +
    alignment length filter or primer requirements, but mark them QCFAIL
    +
    +
    Output Options Description
    +
    -p Prefix for the output BAM file. If none is specified the output will write to standard out.
    +

    Example Usage:

    ivar trim -b test_primers.bed -p test.trimmed -i test.bam -q 15 -m 50 -s 4
    +
    samtools view -h test.bam | ivar trim -b test_primers.bed -p test.trimmed
    +

    The command above will produce a trimmed BAM file test.trimmed.bam after trimming the aligned reads in test.bam using the primer positions specified in test_primers.bed and a minimum quality threshold of 15, minimum read length of 50 and a sliding window of 4.

    +

    Example Usage:

    bwa mem -t 32 reference.fa 1.fq 2.fq | ivar trim -b test_primers.bed -x 3 -m 30 | samtools sort - | samtools mpileup -aa -A -Q 0 -d 0 - | ivar consensus -p test_consensus -m 10 -n N -t 0.5
    +

    The command above will allow you to go from alignment to consensus sequence in a single command using the bwa aligner.

    Example BED file

    -
    Puerto 28 52 400_1_out_L 60 +
    Puerto 482 504 400_1_out_R 60 -
    Puerto 359 381 400_2_out_L 60 +
    Puerto 796 818 400_2_out_R 60 -
    Puerto 658 680 400_3_out_L* 60 +
    Puerto 1054 1076 400_3_out_R* 60 -
    .
    .
    .
    .

    +
    Puerto 28 52 400_1_out_L 60 +
    +
    Puerto 482 504 400_1_out_R 60 -
    +
    Puerto 359 381 400_2_out_L 60 +
    +
    Puerto 796 818 400_2_out_R 60 -
    +
    Puerto 658 680 400_3_out_L* 60 +
    +
    Puerto 1054 1076 400_3_out_R* 60 -
    +
    .
    +
    .
    +
    .
    +
    .
    +

    Call variants with iVar

    iVar uses the output of the samtools mpileup command to call variants - single nucleotide variants(SNVs) and indels. In order to call variants correctly, the reference file used for alignment must be passed to iVar using the -r flag. The output of samtools pileup is piped into ivar variants to generate a .tsv file with the variants. There are two parameters that can be set for variant calling using iVar - minimum quality(Default: 20) and minimum frequency(Default: 0.03). Minimum quality is the minimum quality for a base to be counted towards the ungapped depth to canculate iSNV frequency at a given position. For insertions, the quality metric is discarded and the mpileup depth is used directly. Minimum frequency is the minimum frequency required for a SNV or indel to be reported.

    Amino acid translation of iSNVs

    -

    iVar can identify codons and translate variants into amino acids using a GFF file in the https://github.com/The-Sequence-Ontology/Specifications/blob/master/gff3.md "GFF3" format containing the required coding regions (CDS). In absence of a GFF file, iVar will not perform the translation and "NA" will be added to the output file in place of the reference and alternate codons and amino acids. The GFF file in the GFF3 format can be downloaded via ftp from NCBI RefSeq/Genbank. They are usually the files with the extension ".gff.gz". For example, the GFF file for Zaire Ebolavirus can be found here. More details on GFF3 files hosted by NCBI can be found in their ftp FAQs.

    +

    iVar can identify codons and translate variants into amino acids using a GFF file in the GFF3 format containing the required coding regions (CDS). In absence of a GFF file, iVar will not perform the translation and "NA" will be added to the output file in place of the reference and alternate codons and amino acids. The GFF file in the GFF3 format can be downloaded via ftp from NCBI RefSeq/Genbank. They are usually the files with the extension ".gff.gz". For example, the GFF file for Zaire Ebolavirus can be found here. More details on GFF3 files hosted by NCBI can be found in their ftp FAQs.

    Account for RNA editing through polymerase slippage

    Some RNA viruses such as Ebola virus, might have polymerase slippage causing the insertion of a couple of nucleotides. More details can be found here. iVar can account for this editing and identify the correct open reading frames. The user will have to specify two additional parameters, EditPosition: Position at which edit occurs and EditSequence: The sequence tht is inserted at the given positon, in the "attributes" column of the GFF file to account for this. A test example is given below,

    -
    test Genbank CDS 2 292 . + . ID=id-testedit1;Note=PinkFloyd;EditPosition=100;EditSequence=A
    test Genbank CDS 2 292 . + . ID=id-testedit2;Note=AnotherBrickInTheWall;EditPosition=102;EditSequence=AA

    If a certain base is present in multiple CDSs, iVar will add a new row for each CDS frame and distinguish the rows by adding the ID (specified in attributes of GFF) of the GFF feature used for the translation. This is shown for position 42 in the example output below. There are two rows with two different GFF features: id-test3 and id-test4.

    -

    Command:

    Usage: samtools mpileup -aa -A -d 0 -B -Q 0 --reference [<reference-fasta] <input.bam> | ivar variants -p <prefix> [-q <min-quality>] [-t <min-frequency-threshold>] [-m <minimum depth>] [-r <reference-fasta>] [-g GFF file]
    Note : samtools mpileup output must be piped into ivar variants
    Input Options Description
    -q Minimum quality score threshold to count base (Default: 20)
    -t Minimum frequency threshold(0 - 1) to call variants (Default: 0.03)
    -m Minimum read depth to call variants (Default: 0)
    -r Reference file used for alignment. This is used to translate the nucleotide sequences and identify intra host single nucleotide variants
    -g A GFF file in the GFF3 format can be supplied to specify coordinates of open reading frames (ORFs). In absence of GFF file, amino acid translation will not be done.
    Output Options Description
    -p (Required) Prefix for the output tsv variant file

    Example Usage:

    samtools mpileup -aa -A -d 600000 -B -Q 0 test.trimmed.bam | ivar variants -p test -q 20 -t 0.03 -r test_reference.fa -g test.gff

    The command above will generate a test.tsv file.

    +
    test Genbank CDS 2 292 . + . ID=id-testedit1;Note=PinkFloyd;EditPosition=100;EditSequence=A
    +
    test Genbank CDS 2 292 . + . ID=id-testedit2;Note=AnotherBrickInTheWall;EditPosition=102;EditSequence=AA
    +

    If a certain base is present in multiple CDSs, iVar will add a new row for each CDS frame and distinguish the rows by adding the ID (specified in attributes of GFF) of the GFF feature used for the translation. This is shown for position 42 in the example output below. There are two rows with two different GFF features: id-test3 and id-test4.

    +

    Command:

    Usage: samtools mpileup -aa -A -d 0 -B -Q 0 --reference [<reference-fasta] <input.bam> | ivar variants -p <prefix> [-q <min-quality>] [-t <min-frequency-threshold>] [-m <minimum depth>] [-r <reference-fasta>] [-g GFF file]
    +
    +
    Note : samtools mpileup output must be piped into ivar variants
    +
    +
    Input Options Description
    +
    -q Minimum quality score threshold to count base (Default: 20)
    +
    -t Minimum frequency threshold(0 - 1) to call variants (Default: 0.03)
    +
    -m Minimum read depth to call variants (Default: 0)
    +
    -G Count gaps towards depth. By default, gaps are not counted
    +
    -r Reference file used for alignment. This is used to translate the nucleotide sequences and identify intra host single nucleotide variants
    +
    -g A GFF file in the GFF3 format can be supplied to specify coordinates of open reading frames (ORFs). In absence of GFF file, amino acid translation will not be done.
    +
    +
    Output Options Description
    +
    -p (Required) Prefix for the output tsv variant file
    +

    Example Usage:

    samtools mpileup -aa -A -d 600000 -B -Q 0 test.trimmed.bam | ivar variants -p test -q 20 -t 0.03 -r test_reference.fa -g test.gff
    +

    The command above will generate a test.tsv file.

    Example of output .tsv file.

    -
    REGION POS REF ALT REF_DP REF_RV REF_QUAL ALT_DP ALT_RV ALT_QUAL ALT_FREQ TOTAL_DP PVAL PASS GFF_FEATURE REF_CODON REF_AA ALT_CODON ALT_AA
    test 42 G T 0 0 0 1 0 49 1 1 1 FALSE id-test3 AGG R ATG M
    test 42 G T 0 0 0 1 0 49 1 1 1 FALSE id-test4 CAG Q CAT H
    test 320 A T 1 1 35 1 1 46 0.5 2 0.666667 FALSE NA NA NA NA NA
    test 365 A T 0 0 0 1 1 27 1 1 1 FALSE NA NA NA NA NA

    Description

    +
    REGION POS REF ALT REF_DP REF_RV REF_QUAL ALT_DP ALT_RV ALT_QUAL ALT_FREQ TOTAL_DP PVAL PASS GFF_FEATURE REF_CODON REF_AA ALT_CODON ALT_AA
    +
    test 42 G T 0 0 0 1 0 49 1 1 1 FALSE id-test3 AGG R ATG M
    +
    test 42 G T 0 0 0 1 0 49 1 1 1 FALSE id-test4 CAG Q CAT H
    +
    test 320 A T 1 1 35 1 1 46 0.5 2 0.666667 FALSE NA NA NA NA NA
    +
    test 365 A T 0 0 0 1 1 27 1 1 1 FALSE NA NA NA NA NA
    +

    Description

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Field Description
    REGION Region from BAM file
    POS Position on reference sequence
    REF Reference base
    ALT Alternate Base
    REF_DP Ungapped depth of reference base
    REF_RV Ungapped depth of reference base on reverse reads
    REF_QUAL Mean quality of reference base
    ALT_DP Ungapped depth of alternate base.
    ALT_RV Ungapped deapth of alternate base on reverse reads
    ALT_QUAL Mean quality of alternate base
    ALT_FREQ Frequency of alternate base
    TOTAL_DP Total depth at position
    PVAL p-value of fisher's exact test
    PASS Result of p-value <= 0.05
    GFF_FEATURE ID of the GFF feature used for the translation
    REF_CODON Codong using the reference base
    REF_AA Amino acid translated from reference codon
    ALT_CODON Codon using the alternate base
    ALT_AA Amino acid translated from the alternate codon
    Field Description
    REGION Region from BAM file
    POS Position on reference sequence
    REF Reference base
    ALT Alternate Base
    REF_DP Ungapped depth of reference base
    REF_RV Ungapped depth of reference base on reverse reads
    REF_QUAL Mean quality of reference base
    ALT_DP Ungapped depth of alternate base.
    ALT_RV Ungapped deapth of alternate base on reverse reads
    ALT_QUAL Mean quality of alternate base
    ALT_FREQ Frequency of alternate base
    TOTAL_DP Total depth at position
    PVAL p-value of fisher's exact test
    PASS Result of p-value <= 0.05
    GFF_FEATURE ID of the GFF feature used for the translation
    REF_CODON Codong using the reference base
    REF_AA Amino acid translated from reference codon
    ALT_CODON Codon using the alternate base
    ALT_AA Amino acid translated from the alternate codon

    Note: Please use the -B options with samtools mpileup to call variants and generate consensus. When a reference sequence is supplied, the quality of the reference base is reduced to 0 (ASCII: !) in the mpileup output. Disabling BAQ with -B seems to fix this. This was tested in samtools 1.7 and 1.8.

    Filter variants across replicates with iVar

    iVar can be used to get an intersection of variants(in .tsv files) called from any number of replicates or from different samples using the same reference sequence. This intersection will filter out any iSNVs that do not occur in a minimum fraction of the files supplied. This parameter can be changed using the -t flag which range from 0 to 1 (default). Fields that are different across replicates(fields apart from REGION, POS, REF, ALT, REF_CODON, REF_AA, ALT_CODON, ALT_AA) will have the filename added as a suffix. If there are a large number of files to be filtered, the -f flag can be used to supply a text file with one sample/replicate variant .tsv file per line.

    -

    Command:

    Usage: ivar filtervariants -p <prefix> replicate-one.tsv replicate-two.tsv ... OR ivar filtervariants -p <prefix> -f <text file with one variant file per line>
    Input: Variant tsv files for each replicate/sample
    Input Options Description
    -t Minimum fration of files required to contain the same variant. Specify value within [0,1]. (Default: 1)
    -f A text file with one variant file per line.
    Output Options Description
    -p (Required) Prefix for the output filtered tsv file

    Example Usage: The command below only retains those variants that are found in atleast 50% of the fiels supplied

    ivar filtervariants -t 0.5 -p test.filtered test.1.tsv test.2.tsv test.3.tsv

    The three replicates can also be supplied using a text file as shown below

    -
    ivar filtervariants -t 0.5 -p test.filtered -f filter_files.txt

    filter_files.txt

    ./path/to/test.1.tsv
    ./path/to/test.2.tsv
    ./path/to/test.3.tsv

    The command above will prodoce an output .tsv file test.filtered.tsv.

    +

    Command:

    Usage: ivar filtervariants -p <prefix> replicate-one.tsv replicate-two.tsv ... OR ivar filtervariants -p <prefix> -f <text file with one variant file per line>
    +
    Input: Variant tsv files for each replicate/sample
    +
    +
    Input Options Description
    +
    -t Minimum fration of files required to contain the same variant. Specify value within [0,1]. (Default: 1)
    +
    -f A text file with one variant file per line.
    +
    +
    Output Options Description
    +
    -p (Required) Prefix for the output filtered tsv file
    +

    Example Usage: The command below only retains those variants that are found in atleast 50% of the fiels supplied

    ivar filtervariants -t 0.5 -p test.filtered test.1.tsv test.2.tsv test.3.tsv
    +

    The three replicates can also be supplied using a text file as shown below

    +
    ivar filtervariants -t 0.5 -p test.filtered -f filter_files.txt
    +

    filter_files.txt

    ./path/to/test.1.tsv
    +
    ./path/to/test.2.tsv
    +
    ./path/to/test.3.tsv
    +

    The command above will prodoce an output .tsv file test.filtered.tsv.

    Example output of filtered .tsv file from three files test_rep1.tsv and test_rep2.tsv

    -
    REGION POS REF ALT GFF_FEATURE REF_CODON REF_AA ALT_CODON ALT_AA REF_DP_test.1.tsv REF_RV_test.1.tsv REF_QUAL_test.1.tsv ALT_DP_test.1.tsv ALT_RV_test.1.tsv ALT_QUAL_test.1.tsv ALT_FREQ_test.1.tsv TOTAL_DP_test.1.tsv PVAL_test.1.tsv PASS_test.1.tsv REF_DP_test.2.tsv REF_RV_test.2.tsv REF_QUAL_test.2.tsv ALT_DP_test.2.tsv ALT_RV_test.2.tsv ALT_QUAL_test.2.tsv ALT_FREQ_test.2.tsv TOTAL_DP_test.2.tsv PVAL_test.2.tsv PASS_test.2.tsv REF_DP_test.3.tsv REF_RV_test.3.tsv REF_QUAL_test.3.tsv ALT_DP_test.3.tsv ALT_RV_test.3.tsv ALT_QUAL_test.3.tsv ALT_FREQ_test.3.tsv TOTAL_DP_test.3.tsv PVAL_test.3.tsv PASS_test.3.tsv
    test 139 T A id-test3 GCT A GCA A 1 0 32 1 0 55 0.5 2 0.666667 FALSE 1 0 32 1 0 55 0.5 2 0.666667 FALSE NA NA NA NA NA NA NA NA NA NA
    test 320 A T NA NA NA NA NA 1 1 35 1 1 46 0.5 2 0.666667 FALSE NA NA NA NA NA NA NA NA NA NA 1 1 35 1 1 46 0.5 2 0.666667 FALSE
    test 365 A T NA NA NA NA NA 0 0 0 1 1 27 1 1 1 FALSE 0 0 0 1 1 27 1 1 1 FALSE 0 0 0 1 1 27 1 1 1 FALSE
    test 42 G T id-test4 CAG Q CAT H 0 0 0 1 0 49 1 1 1 FALSE 0 0 0 1 0 49 1 1 1 FALSE NA NA NA NA NA NA NA NA NA NA
    test 42 G T id-testedit1 AGG R ATG M 0 0 0 1 0 49 1 1 1 FALSE 0 0 0 1 0 49 1 1 1 FALSE 0 0 0 1 0 49 1 1 1 FALSE
    test 69 T G id-testedit2 TTG L TGG W 1 0 57 1 0 53 0.5 2 0.666667 FALSE 1 0 57 1 0 53 0.5 2 0.666667 FALSE 1 0 57 1 0 53 0.5 2 0.666667 FALSE

    Description of fields

    +
    REGION POS REF ALT GFF_FEATURE REF_CODON REF_AA ALT_CODON ALT_AA REF_DP_test.1.tsv REF_RV_test.1.tsv REF_QUAL_test.1.tsv ALT_DP_test.1.tsv ALT_RV_test.1.tsv ALT_QUAL_test.1.tsv ALT_FREQ_test.1.tsv TOTAL_DP_test.1.tsv PVAL_test.1.tsv PASS_test.1.tsv REF_DP_test.2.tsv REF_RV_test.2.tsv REF_QUAL_test.2.tsv ALT_DP_test.2.tsv ALT_RV_test.2.tsv ALT_QUAL_test.2.tsv ALT_FREQ_test.2.tsv TOTAL_DP_test.2.tsv PVAL_test.2.tsv PASS_test.2.tsv REF_DP_test.3.tsv REF_RV_test.3.tsv REF_QUAL_test.3.tsv ALT_DP_test.3.tsv ALT_RV_test.3.tsv ALT_QUAL_test.3.tsv ALT_FREQ_test.3.tsv TOTAL_DP_test.3.tsv PVAL_test.3.tsv PASS_test.3.tsv
    +
    test 139 T A id-test3 GCT A GCA A 1 0 32 1 0 55 0.5 2 0.666667 FALSE 1 0 32 1 0 55 0.5 2 0.666667 FALSE NA NA NA NA NA NA NA NA NA NA
    +
    test 320 A T NA NA NA NA NA 1 1 35 1 1 46 0.5 2 0.666667 FALSE NA NA NA NA NA NA NA NA NA NA 1 1 35 1 1 46 0.5 2 0.666667 FALSE
    +
    test 365 A T NA NA NA NA NA 0 0 0 1 1 27 1 1 1 FALSE 0 0 0 1 1 27 1 1 1 FALSE 0 0 0 1 1 27 1 1 1 FALSE
    +
    test 42 G T id-test4 CAG Q CAT H 0 0 0 1 0 49 1 1 1 FALSE 0 0 0 1 0 49 1 1 1 FALSE NA NA NA NA NA NA NA NA NA NA
    +
    test 42 G T id-testedit1 AGG R ATG M 0 0 0 1 0 49 1 1 1 FALSE 0 0 0 1 0 49 1 1 1 FALSE 0 0 0 1 0 49 1 1 1 FALSE
    +
    test 69 T G id-testedit2 TTG L TGG W 1 0 57 1 0 53 0.5 2 0.666667 FALSE 1 0 57 1 0 53 0.5 2 0.666667 FALSE 1 0 57 1 0 53 0.5 2 0.666667 FALSE
    +

    Description of fields

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    No Field Description
    1 REGION Common region across all replicate variant tsv files
    2 POS Common position across all variant tsv files
    3 REF Common reference base across all variant tsv files
    4 ALT Common alternate base across all variant tsv files
    5 GFF_FEATURE GFF feature used for the translation
    6 REF_CODON The codon using the reference base
    7 REF_AA Reference codon translated into amino acid
    8 ALT_CODON Codon using the alternate base
    9 ALT_AA Alternate codon translated into amino acid
    10 REF_DP_<rep1-tsv-file-name> Depth of reference base in replicate 1
    11 REF_RV_<rep1-tsv-file-name> Depth of reference base on reverse reads in replicate 1
    12 REF_QUAL_<rep1-tsv-file-name> Mean quality of reference base in replicate 1
    13 ALT_DP_<rep1-tsv-file-name> Depth of alternate base in replicate 1
    14 ALT_RV_<rep1-tsv-file-name> Deapth of alternate base on reverse reads in replicate 1
    15 ALT_QUAL_<rep1-tsv-file-name> Mean quality of alternate base in replicate 1
    16 ALT_FREQ_<rep1-tsv-file-name> Frequency of alternate base in replicate 1
    17 TOTAL_DP_<rep1-tsv-file-name> Total depth at position in replicate 1
    18 PVAL_<rep1-tsv-file-name> p-value of fisher's exact test in replicate 1
    19 PASS_<rep1-tsv-file-name> Result of p-value <= 0.05 in replicate 1
    20 Continue rows 10 - 19 for every replicate provided
    No Field Description
    1 REGION Common region across all replicate variant tsv files
    2 POS Common position across all variant tsv files
    3 REF Common reference base across all variant tsv files
    4 ALT Common alternate base across all variant tsv files
    5 GFF_FEATURE GFF feature used for the translation
    6 REF_CODON The codon using the reference base
    7 REF_AA Reference codon translated into amino acid
    8 ALT_CODON Codon using the alternate base
    9 ALT_AA Alternate codon translated into amino acid
    10 REF_DP_<rep1-tsv-file-name> Depth of reference base in replicate 1
    11 REF_RV_<rep1-tsv-file-name> Depth of reference base on reverse reads in replicate 1
    12 REF_QUAL_<rep1-tsv-file-name> Mean quality of reference base in replicate 1
    13 ALT_DP_<rep1-tsv-file-name> Depth of alternate base in replicate 1
    14 ALT_RV_<rep1-tsv-file-name> Deapth of alternate base on reverse reads in replicate 1
    15 ALT_QUAL_<rep1-tsv-file-name> Mean quality of alternate base in replicate 1
    16 ALT_FREQ_<rep1-tsv-file-name> Frequency of alternate base in replicate 1
    17 TOTAL_DP_<rep1-tsv-file-name> Total depth at position in replicate 1
    18 PVAL_<rep1-tsv-file-name> p-value of fisher's exact test in replicate 1
    19 PASS_<rep1-tsv-file-name> Result of p-value <= 0.05 in replicate 1
    20 Continue rows 10 - 19 for every replicate provided

    Generate a consensus sequences from an aligned BAM file

    @@ -226,61 +312,128 @@

    As an example, consider a position with 6As, 3Ts and 1C. The table below shows the consensus nucleotide called at different frequencies.

    - - - - - - - - - - - - - + + + + + + + + + + + + +
    Minimum frequency threshold Consensus
    0 A
    0.5 A
    0.6 A
    0.7 W(A or T)
    0.9 W (A or T)
    1 H (A or T or C)
    Minimum frequency threshold Consensus
    0 A
    0.5 A
    0.6 A
    0.7 W(A or T)
    0.9 W (A or T)
    1 H (A or T or C)

    If there are two nucleotides at the same frequency, both nucleotides are used to call an ambigious base as the consensus. As an example, consider a position wiht 6 Ts, 2As and 2 Gs. The table below shows the consensus nucleotide called at different frequencies.

    - - - - - - - - - - - - - + + + + + + + + + + + + +
    Minimum frequency threshold Consensus
    0 T
    0.5 T
    0.6 T
    0.7 D(A or T or G)
    0.9 D(A or T or G)
    1 D(A or T or G)
    Minimum frequency threshold Consensus
    0 T
    0.5 T
    0.6 T
    0.7 D(A or T or G)
    0.9 D(A or T or G)
    1 D(A or T or G)

    The output of the command is a fasta file with the consensus sequence and a .txt file with the average quality of every base used to generate the consensus at each position. For insertions, the quality is set to be the minimum quality threshold since mpileup doesn't give the quality of bases in insertions.

    Command:

    -
    ivar consensus
    Usage: samtools mpileup -aa -A -d 0 -Q 0 <input.bam> | ivar consensus -p <prefix>
    Note : samtools mpileup output must be piped into ivar consensus
    Input Options Description
    -q Minimum quality score threshold to count base (Default: 20)
    -t Minimum frequency threshold(0 - 1) to call consensus. (Default: 0)
    Frequently used thresholds | Description
    ---------------------------|------------
    0 | Majority or most common base
    0.2 | Bases that make up atleast 20% of the depth at a position
    0.5 | Strict or bases that make up atleast 50% of the depth at a position
    0.9 | Strict or bases that make up atleast 90% of the depth at a position
    1 | Identical or bases that make up 100% of the depth at a position. Will have highest ambiguities
    -m Minimum depth to call consensus(Default: 10)
    -k If '-k' flag is added, regions with depth less than minimum depth will not be added to the consensus sequence. Using '-k' will override any option specified using -n
    -n (N/-) Character to print in regions with less than minimum coverage(Default: N)
    Output Options Description
    -p (Required) Prefix for the output fasta file and quality file

    Example Usage:

    samtools mpileup -d 1000 -A -Q 0 test.bam | ivar consensus -p test -q 20 -t 0

    The command above will produce a test.fa fasta file with the consensus sequence and a test.qual.txt with the average quality of each base in the consensus sequence.

    +
    ivar consensus
    +
    +
    Usage: samtools mpileup -aa -A -d 0 -Q 0 <input.bam> | ivar consensus -p <prefix>
    +
    +
    Note : samtools mpileup output must be piped into ivar consensus
    +
    +
    Input Options Description
    +
    -q Minimum quality score threshold to count base (Default: 20)
    +
    -t Minimum frequency threshold(0 - 1) to call consensus. (Default: 0)
    +
    -c Minimum insertion frequency threshold(0 - 1) to call consensus. (Default: 0.8)
    +
    Frequently used thresholds | Description
    +
    ---------------------------|------------
    +
    0 | Majority or most common base
    +
    0.2 | Bases that make up atleast 20% of the depth at a position
    +
    0.5 | Strict or bases that make up atleast 50% of the depth at a position
    +
    0.9 | Strict or bases that make up atleast 90% of the depth at a position
    +
    1 | Identical or bases that make up 100% of the depth at a position. Will have highest ambiguities
    +
    -m Minimum depth to call consensus(Default: 10)
    +
    -k If '-k' flag is added, regions with depth less than minimum depth will not be added to the consensus sequence. Using '-k' will override any option specified using -n
    +
    -n (N/-) Character to print in regions with less than minimum coverage(Default: N)
    +
    +
    Output Options Description
    +
    -p (Required) Prefix for the output fasta file and quality file
    +

    Example Usage:

    samtools mpileup -d 1000 -A -Q 0 test.bam | ivar consensus -p test -q 20 -t 0
    +

    The command above will produce a test.fa fasta file with the consensus sequence and a test.qual.txt with the average quality of each base in the consensus sequence.

    Get primers with mismatches to the reference sequence

    iVar uses a .tsv file with variants to get the zero based indices(based on the BED file) of mismatched primers. This command requires another .tsv file with each line containing the left and right primer names separated by a tab. This is used to get both the primers for an amplicon with a single mismatched primer. The output is a text file with the zero based primer indices delimited by a space. The output is written to a a text file using the prefix provided.

    -

    Command:

    ivar getmasked
    Usage: ivar getmasked -i <input-filtered.tsv> -b <primers.bed> -f <primer_pairs.tsv> -p <prefix>
    Note: This step is used only for amplicon-based sequencing.
    Input Options Description
    -i (Required) Input filtered variants tsv generated from 'ivar filtervariants'
    -b (Required) BED file with primer sequences and positions
    -f (Required) Primer pair information file containing left and right primer names for the same amplicon separated by a tab
    Output Options Description
    -p (Required) Prefix for the output text file

    Example BED file

    -
    Puerto 28 52 400_1_out_L 60 +
    Puerto 482 504 400_1_out_R 60 -
    Puerto 359 381 400_2_out_L 60 +
    Puerto 796 818 400_2_out_R 60 -
    Puerto 658 680 400_3_out_L* 60 +
    Puerto 1054 1076 400_3_out_R* 60 -
    .
    .
    .
    .

    Example primer pair information file

    400_1_out_L 400_1_out_R
    400_2_out_L 400_2_out_R
    400_3_out_L 400_3_out_R
    .
    .
    .
    .

    Example Usage:

    ivar getmasked -i test.filtered.tsv -b primers.bed -f pair_information.tsv -p test.masked.txt

    The command above produces an output file - test.masked.txt.

    +

    Command:

    ivar getmasked
    +
    Usage: ivar getmasked -i <input-filtered.tsv> -b <primers.bed> -f <primer_pairs.tsv> -p <prefix>
    +
    Note: This step is used only for amplicon-based sequencing.
    +
    +
    Input Options Description
    +
    -i (Required) Input filtered variants tsv generated from 'ivar filtervariants'
    +
    -b (Required) BED file with primer sequences and positions
    +
    -f (Required) Primer pair information file containing left and right primer names for the same amplicon separated by a tab
    +
    Output Options Description
    +
    -p (Required) Prefix for the output text file
    +

    Example BED file

    +
    Puerto 28 52 400_1_out_L 60 +
    +
    Puerto 482 504 400_1_out_R 60 -
    +
    Puerto 359 381 400_2_out_L 60 +
    +
    Puerto 796 818 400_2_out_R 60 -
    +
    Puerto 658 680 400_3_out_L* 60 +
    +
    Puerto 1054 1076 400_3_out_R* 60 -
    +
    .
    +
    .
    +
    .
    +
    .
    +

    Example primer pair information file

    400_1_out_L 400_1_out_R
    +
    400_2_out_L 400_2_out_R
    +
    400_3_out_L 400_3_out_R
    +
    .
    +
    .
    +
    .
    +
    .
    +

    Example Usage:

    ivar getmasked -i test.filtered.tsv -b primers.bed -f pair_information.tsv -p test.masked.txt
    +

    The command above produces an output file - test.masked.txt.

    Example Output:

    -
    1 2 7 8

    +
    1 2 7 8
    +

    Remove reads associated with mismatched primer indices

    This command accepts an aligned and sorted BAM file trimmed using ivar trim and removes the reads corresponding to the supplied primer indices, which is the output of ivar getmasked command. Under the hood, ivar trim adds the zero based primer index(based on the BED file) to the BAM auxillary data for every read. Hence, ivar removereads will only work on BAM files that have been trimmed using ivar trim.

    -

    Command:

    ivar removereads
    Usage: ivar removereads -i <input.trimmed.bam> -p <prefix> -t <text-file-with-primer-indices>
    Note: This step is used only for amplicon-based sequencing.
    Input Options Description
    -i (Required) Input BAM file trimmed with ivar trim. Must be sorted and indexed, which can be done using sort_index_bam.sh
    -t (Required) Text file with primer indices separated by spaces. This is the output of getmasked command.
    Output Options Description
    -p (Required) Prefix for the output filtered BAM file

    Example Usage:

    ivar trim -i test.bam -p test.trimmed
    ivar removereads -i test.trimmed.bam -p test.trimmed.masked.bam -t test.masked.txt

    The ivar trim command above trims test.bam and produced test.trimmed.bam with the primer indice data added. The ivar removereads command produces an output file - test.trimmed.masked.bam after removing all the reads corresponding to primer indices - 1,2,7 and 8.

    +

    Command:

    ivar removereads
    +
    +
    Usage: ivar removereads -i <input.trimmed.bam> -p <prefix> -t <text-file-with-primer-indices>
    +
    Note: This step is used only for amplicon-based sequencing.
    +
    +
    Input Options Description
    +
    -i (Required) Input BAM file trimmed with ivar trim. Must be sorted and indexed, which can be done using sort_index_bam.sh
    +
    -t (Required) Text file with primer indices separated by spaces. This is the output of getmasked command.
    +
    +
    Output Options Description
    +
    -p (Required) Prefix for the output filtered BAM file
    +

    Example Usage:

    ivar trim -i test.bam -p test.trimmed
    +
    ivar removereads -i test.trimmed.bam -p test.trimmed.masked.bam -t test.masked.txt
    +

    The ivar trim command above trims test.bam and produced test.trimmed.bam with the primer indice data added. The ivar removereads command produces an output file - test.trimmed.masked.bam after removing all the reads corresponding to primer indices - 1,2,7 and 8.

    (Experimental) trimadapter

    Note: This feature is under active development and not completely validated yet.

    trimadapter in iVar can be used to trim adapter sequences from fastq files using a supplied fasta file.

    + diff --git a/docs/html/menu.js b/docs/html/menu.js index 89aaf575..717761d0 100644 --- a/docs/html/menu.js +++ b/docs/html/menu.js @@ -1,33 +1,41 @@ /* - @licstart The following is the entire license notice for the - JavaScript code in this file. + @licstart The following is the entire license notice for the JavaScript code in this file. - Copyright (C) 1997-2017 by Dimitri van Heesch + The MIT License (MIT) - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. + Copyright (C) 1997-2020 by Dimitri van Heesch - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. + Permission is hereby granted, free of charge, to any person obtaining a copy of this software + and associated documentation files (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, publish, distribute, + sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + The above copyright notice and this permission notice shall be included in all copies or + substantial portions of the Software. - @licend The above is the entire license notice - for the JavaScript code in this file + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING + BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + @licend The above is the entire license notice for the JavaScript code in this file */ function initMenu(relPath,searchEnabled,serverSide,searchPage,search) { function makeTree(data,relPath) { - var result=''; + let result=''; if ('children' in data) { result+='
      '; - for (var i in data.children) { - result+='
    • '+ + for (let i in data.children) { + let url; + const link = data.children[i].url; + if (link.substring(0,1)=='^') { + url = link.substring(1); + } else { + url = relPath+link; + } + result+='
    • '+ data.children[i].text+''+ makeTree(data.children[i],relPath)+'
    • '; } @@ -35,15 +43,91 @@ function initMenu(relPath,searchEnabled,serverSide,searchPage,search) { } return result; } - - $('#main-nav').append(makeTree(menudata,relPath)); - $('#main-nav').children(':first').addClass('sm sm-dox').attr('id','main-menu'); + let searchBoxHtml; if (searchEnabled) { if (serverSide) { - $('#main-menu').append('
    • '); + searchBoxHtml='
      '+ + '
      '+ + '
       '+ + ''+ + '
      '+ + '
      '+ + '
      '+ + '
      '; } else { - $('#main-menu').append('
    • '); + searchBoxHtml='
      '+ + ''+ + ' '+ + ''+ + ''+ + ''+ + ''+ + ''+ + '
      '; + } + } + + $('#main-nav').before('
      '+ + ''+ + ''+ + '
      '); + $('#main-nav').append(makeTree(menudata,relPath)); + $('#main-nav').children(':first').addClass('sm sm-dox').attr('id','main-menu'); + if (searchBoxHtml) { + $('#main-menu').append('
    • '); + } + const $mainMenuState = $('#main-menu-state'); + let prevWidth = 0; + if ($mainMenuState.length) { + const initResizableIfExists = function() { + if (typeof initResizable==='function') initResizable(); + } + // animate mobile menu + $mainMenuState.change(function() { + const $menu = $('#main-menu'); + let options = { duration: 250, step: initResizableIfExists }; + if (this.checked) { + options['complete'] = () => $menu.css('display', 'block'); + $menu.hide().slideDown(options); + } else { + options['complete'] = () => $menu.css('display', 'none'); + $menu.show().slideUp(options); + } + }); + // set default menu visibility + const resetState = function() { + const $menu = $('#main-menu'); + const newWidth = $(window).outerWidth(); + if (newWidth!=prevWidth) { + if ($(window).outerWidth()<768) { + $mainMenuState.prop('checked',false); $menu.hide(); + $('#searchBoxPos1').html(searchBoxHtml); + $('#searchBoxPos2').hide(); + } else { + $menu.show(); + $('#searchBoxPos1').empty(); + $('#searchBoxPos2').html(searchBoxHtml); + $('#searchBoxPos2').show(); + } + if (typeof searchBox!=='undefined') { + searchBox.CloseResultsWindow(); + } + prevWidth = newWidth; + } } + $(window).ready(function() { resetState(); initResizableIfExists(); }); + $(window).resize(resetState); } $('#main-menu').smartmenus(); } diff --git a/docs/html/menudata.js b/docs/html/menudata.js index 64c29f25..752f4f40 100644 --- a/docs/html/menudata.js +++ b/docs/html/menudata.js @@ -1,25 +1,26 @@ /* -@ @licstart The following is the entire license notice for the -JavaScript code in this file. + @licstart The following is the entire license notice for the JavaScript code in this file. -Copyright (C) 1997-2017 by Dimitri van Heesch + The MIT License (MIT) -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. + Copyright (C) 1997-2020 by Dimitri van Heesch -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. + Permission is hereby granted, free of charge, to any person obtaining a copy of this software + and associated documentation files (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, publish, distribute, + sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: -You should have received a copy of the GNU General Public License along -with this program; if not, write to the Free Software Foundation, Inc., -51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + The above copyright notice and this permission notice shall be included in all copies or + substantial portions of the Software. -@licend The above is the entire license notice -for the JavaScript code in this file + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING + BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + @licend The above is the entire license notice for the JavaScript code in this file */ var menudata={children:[ {text:"Main Page",url:"index.html"}, diff --git a/docs/html/nav_fd.png b/docs/html/nav_fd.png new file mode 100644 index 00000000..032fbdd4 Binary files /dev/null and b/docs/html/nav_fd.png differ diff --git a/docs/html/nav_hd.png b/docs/html/nav_hd.png new file mode 100644 index 00000000..de80f18a Binary files /dev/null and b/docs/html/nav_hd.png differ diff --git a/docs/html/pages.html b/docs/html/pages.html index 49ab3888..d4f494f3 100644 --- a/docs/html/pages.html +++ b/docs/html/pages.html @@ -4,7 +4,7 @@ - + @@ -13,6 +13,7 @@ + @@ -33,21 +34,22 @@ - + +/* @license-end */ + @@ -59,20 +61,26 @@
      - +
      +
      +
      +
      +
      Loading...
      +
      Searching...
      +
      No Matches
      +
      +
      +
      -
      -
      Related Pages
      +
      Related Pages
      Here is a list of all related documentation pages:
      @@ -82,7 +90,7 @@ diff --git a/docs/html/search/all_0.js b/docs/html/search/all_0.js index 0ed367d9..f1810f4f 100644 --- a/docs/html/search/all_0.js +++ b/docs/html/search/all_0.js @@ -1,4 +1,9 @@ var searchData= [ - ['cookbook',['Cookbook',['../cookbookpage.html',1,'']]] + ['a_20consensus_20sequences_20from_20an_20aligned_20bam_20file_0',['Generate a consensus sequences from an aligned BAM file',['../manualpage.html#autotoc_md19',1,'']]], + ['across_20replicates_20with_20ivar_1',['Filter variants across replicates with iVar',['../manualpage.html#autotoc_md18',1,'']]], + ['aligned_20bam_20file_2',['Generate a consensus sequences from an aligned BAM file',['../manualpage.html#autotoc_md19',1,'']]], + ['an_20aligned_20bam_20file_3',['Generate a consensus sequences from an aligned BAM file',['../manualpage.html#autotoc_md19',1,'']]], + ['associated_20with_20mismatched_20primer_20indices_4',['Remove reads associated with mismatched primer indices',['../manualpage.html#autotoc_md21',1,'']]], + ['available_20commands_5',['Available Commands',['../manualpage.html#autotoc_md14',1,'']]] ]; diff --git a/docs/html/search/all_1.js b/docs/html/search/all_1.js index 1983e651..5aa36902 100644 --- a/docs/html/search/all_1.js +++ b/docs/html/search/all_1.js @@ -1,4 +1,5 @@ var searchData= [ - ['documentation',['Documentation',['../index.html',1,'']]] + ['bam_20file_0',['Generate a consensus sequences from an aligned BAM file',['../manualpage.html#autotoc_md19',1,'']]], + ['build_20tools_1',['Build tools',['../installpage.html#autotoc_md3',1,'Installing build tools'],['../installpage.html#autotoc_md8',1,'Installing build tools']]] ]; diff --git a/docs/html/search/all_2.js b/docs/html/search/all_2.js index b2d61cf6..c641afc9 100644 --- a/docs/html/search/all_2.js +++ b/docs/html/search/all_2.js @@ -1,4 +1,9 @@ var searchData= [ - ['installation',['Installation',['../installpage.html',1,'']]] + ['call_20variants_20with_20ivar_0',['Call variants with iVar',['../manualpage.html#autotoc_md17',1,'']]], + ['commands_1',['Commands',['../manualpage.html#autotoc_md14',1,'Available Commands'],['../manualpage.html#autotoc_md15',1,'Description of commands']]], + ['conda_2',['Conda',['../installpage.html#autotoc_md4',1,'HTSlib installed using conda'],['../installpage.html#autotoc_md9',1,'HTSlib installed using conda'],['../installpage.html#autotoc_md0',1,'Installing via conda']]], + ['consensus_20sequences_20from_20an_20aligned_20bam_20file_3',['Generate a consensus sequences from an aligned BAM file',['../manualpage.html#autotoc_md19',1,'']]], + ['contact_4',['Contact',['../installpage.html#autotoc_md13',1,'']]], + ['cookbook_5',['Cookbook',['../cookbookpage.html',1,'']]] ]; diff --git a/docs/html/search/all_3.js b/docs/html/search/all_3.js index a8d76c3d..5629779c 100644 --- a/docs/html/search/all_3.js +++ b/docs/html/search/all_3.js @@ -1,4 +1,6 @@ var searchData= [ - ['manual',['Manual',['../manualpage.html',1,'']]] + ['description_20of_20commands_0',['Description of commands',['../manualpage.html#autotoc_md15',1,'']]], + ['docker_1',['Running from Docker',['../installpage.html#autotoc_md12',1,'']]], + ['documentation_2',['Documentation',['../index.html',1,'']]] ]; diff --git a/docs/html/search/all_4.js b/docs/html/search/all_4.js index 0bf7b086..75e3e809 100644 --- a/docs/html/search/all_4.js +++ b/docs/html/search/all_4.js @@ -1,6 +1,4 @@ var searchData= [ - ['main',['main',['../ivar_8cpp.html#a0ddf1224851353fc92bfbff6f499fa97',1,'ivar.cpp']]], - ['maj',['maj',['../structmaj.html',1,'']]], - ['manual',['Manual',['../manualpage.html',1,'']]] + ['experimental_20trimadapter_0',['(Experimental) trimadapter',['../manualpage.html#autotoc_md22',1,'']]] ]; diff --git a/docs/html/search/all_5.js b/docs/html/search/all_5.js index fab5605f..2110a3c9 100644 --- a/docs/html/search/all_5.js +++ b/docs/html/search/all_5.js @@ -1,4 +1,8 @@ var searchData= [ - ['primer',['primer',['../classprimer.html',1,'']]] + ['file_0',['Generate a consensus sequences from an aligned BAM file',['../manualpage.html#autotoc_md19',1,'']]], + ['filter_20variants_20across_20replicates_20with_20ivar_1',['Filter variants across replicates with iVar',['../manualpage.html#autotoc_md18',1,'']]], + ['from_20an_20aligned_20bam_20file_2',['Generate a consensus sequences from an aligned BAM file',['../manualpage.html#autotoc_md19',1,'']]], + ['from_20docker_3',['Running from Docker',['../installpage.html#autotoc_md12',1,'']]], + ['from_20source_4',['From source',['../installpage.html#autotoc_md5',1,'HTSlib installed from source'],['../installpage.html#autotoc_md10',1,'HTSlib installed from source']]] ]; diff --git a/docs/html/search/all_6.js b/docs/html/search/all_6.js index 76373f8a..c84d186a 100644 --- a/docs/html/search/all_6.js +++ b/docs/html/search/all_6.js @@ -1,4 +1,5 @@ var searchData= [ - ['ret_5ft',['ret_t',['../structret__t.html',1,'']]] + ['generate_20a_20consensus_20sequences_20from_20an_20aligned_20bam_20file_0',['Generate a consensus sequences from an aligned BAM file',['../manualpage.html#autotoc_md19',1,'']]], + ['get_20primers_20with_20mismatches_20to_20the_20reference_20sequence_1',['Get primers with mismatches to the reference sequence',['../manualpage.html#autotoc_md20',1,'']]] ]; diff --git a/docs/html/search/all_7.js b/docs/html/search/all_7.js index 15f2403e..2eedeb46 100644 --- a/docs/html/search/all_7.js +++ b/docs/html/search/all_7.js @@ -1,4 +1,6 @@ var searchData= [ - ['suffix_5fnode',['suffix_node',['../classsuffix__node.html',1,'']]] + ['homebrew_0',['Installing via homebrew',['../installpage.html#autotoc_md1',1,'']]], + ['htslib_20installed_20from_20source_1',['HTSlib installed from source',['../installpage.html#autotoc_md5',1,'HTSlib installed from source'],['../installpage.html#autotoc_md10',1,'HTSlib installed from source']]], + ['htslib_20installed_20using_20conda_2',['HTSlib installed using conda',['../installpage.html#autotoc_md4',1,'HTSlib installed using conda'],['../installpage.html#autotoc_md9',1,'HTSlib installed using conda']]] ]; diff --git a/docs/html/search/close.svg b/docs/html/search/close.svg new file mode 100644 index 00000000..337d6cc1 --- /dev/null +++ b/docs/html/search/close.svg @@ -0,0 +1,18 @@ + + + + + + diff --git a/docs/html/search/mag.svg b/docs/html/search/mag.svg new file mode 100644 index 00000000..ffb6cf0d --- /dev/null +++ b/docs/html/search/mag.svg @@ -0,0 +1,24 @@ + + + + + + + diff --git a/docs/html/search/mag_d.svg b/docs/html/search/mag_d.svg new file mode 100644 index 00000000..4122773f --- /dev/null +++ b/docs/html/search/mag_d.svg @@ -0,0 +1,24 @@ + + + + + + + diff --git a/docs/html/search/mag_sel.svg b/docs/html/search/mag_sel.svg new file mode 100644 index 00000000..553dba87 --- /dev/null +++ b/docs/html/search/mag_sel.svg @@ -0,0 +1,31 @@ + + + + + + + + + diff --git a/docs/html/search/mag_seld.svg b/docs/html/search/mag_seld.svg new file mode 100644 index 00000000..c906f84c --- /dev/null +++ b/docs/html/search/mag_seld.svg @@ -0,0 +1,31 @@ + + + + + + + + + diff --git a/docs/html/search/pages_0.js b/docs/html/search/pages_0.js index 0ed367d9..46d32520 100644 --- a/docs/html/search/pages_0.js +++ b/docs/html/search/pages_0.js @@ -1,4 +1,4 @@ var searchData= [ - ['cookbook',['Cookbook',['../cookbookpage.html',1,'']]] + ['cookbook_0',['Cookbook',['../cookbookpage.html',1,'']]] ]; diff --git a/docs/html/search/pages_1.js b/docs/html/search/pages_1.js index 1983e651..c28eacdd 100644 --- a/docs/html/search/pages_1.js +++ b/docs/html/search/pages_1.js @@ -1,4 +1,4 @@ var searchData= [ - ['documentation',['Documentation',['../index.html',1,'']]] + ['documentation_0',['Documentation',['../index.html',1,'']]] ]; diff --git a/docs/html/search/pages_2.js b/docs/html/search/pages_2.js index b2d61cf6..d8851237 100644 --- a/docs/html/search/pages_2.js +++ b/docs/html/search/pages_2.js @@ -1,4 +1,4 @@ var searchData= [ - ['installation',['Installation',['../installpage.html',1,'']]] + ['installation_0',['Installation',['../installpage.html',1,'']]] ]; diff --git a/docs/html/search/pages_3.js b/docs/html/search/pages_3.js index a8d76c3d..6354721d 100644 --- a/docs/html/search/pages_3.js +++ b/docs/html/search/pages_3.js @@ -1,4 +1,4 @@ var searchData= [ - ['manual',['Manual',['../manualpage.html',1,'']]] + ['manual_0',['Manual',['../manualpage.html',1,'']]] ]; diff --git a/docs/html/search/search.css b/docs/html/search/search.css index 3cf9df94..19f76f9d 100644 --- a/docs/html/search/search.css +++ b/docs/html/search/search.css @@ -1,106 +1,124 @@ -/*---------------- Search Box */ +/*---------------- Search Box positioning */ -#FSearchBox { - float: left; +#main-menu > li:last-child { + /* This
    • object is the parent of the search bar */ + display: flex; + justify-content: center; + align-items: center; + height: 36px; + margin-right: 1em; +} + +/*---------------- Search box styling */ + +.SRPage * { + font-weight: normal; + line-height: normal; +} + +dark-mode-toggle { + margin-left: 5px; + display: flex; + float: right; } #MSearchBox { + display: inline-block; white-space : nowrap; - float: none; - margin-top: 8px; - right: 0px; - width: 170px; - height: 24px; + background: var(--search-background-color); + border-radius: 0.65em; + box-shadow: var(--search-box-shadow); z-index: 102; } -#MSearchBox .left -{ - display:block; - position:absolute; - left:10px; - width:20px; - height:19px; - background:url('search_l.png') no-repeat; - background-position:right; +#MSearchBox .left { + display: inline-block; + vertical-align: middle; + height: 1.4em; } #MSearchSelect { - display:block; - position:absolute; - width:20px; - height:19px; + display: inline-block; + vertical-align: middle; + width: 20px; + height: 19px; + background-image: var(--search-magnification-select-image); + margin: 0 0 0 0.3em; + padding: 0; } -.left #MSearchSelect { - left:4px; +#MSearchSelectExt { + display: inline-block; + vertical-align: middle; + width: 10px; + height: 19px; + background-image: var(--search-magnification-image); + margin: 0 0 0 0.5em; + padding: 0; } -.right #MSearchSelect { - right:5px; -} #MSearchField { - display:block; - position:absolute; - height:19px; - background:url('search_m.png') repeat-x; + display: inline-block; + vertical-align: middle; + width: 7.5em; + height: 19px; + margin: 0 0.15em; + padding: 0; + line-height: 1em; border:none; - width:115px; - margin-left:20px; - padding-left:4px; - color: #909090; + color: var(--search-foreground-color); outline: none; - font: 9pt Arial, Verdana, sans-serif; + font-family: var(--font-family-search); -webkit-border-radius: 0px; + border-radius: 0px; + background: none; } -#FSearchBox #MSearchField { - margin-left:15px; +@media(hover: none) { + /* to avoid zooming on iOS */ + #MSearchField { + font-size: 16px; + } } #MSearchBox .right { - display:block; - position:absolute; - right:10px; - top:8px; - width:20px; - height:19px; - background:url('search_r.png') no-repeat; - background-position:left; + display: inline-block; + vertical-align: middle; + width: 1.4em; + height: 1.4em; } #MSearchClose { display: none; - position: absolute; - top: 4px; + font-size: inherit; background : none; border: none; - margin: 0px 4px 0px 0px; - padding: 0px 0px; + margin: 0; + padding: 0; outline: none; -} -.left #MSearchClose { - left: 6px; } -.right #MSearchClose { - right: 2px; +#MSearchCloseImg { + padding: 0.3em; + margin: 0; } .MSearchBoxActive #MSearchField { - color: #000000; + color: var(--search-active-color); } + + /*---------------- Search filter selection */ #MSearchSelectWindow { display: none; position: absolute; left: 0; top: 0; - border: 1px solid #90A5CE; - background-color: #F9FAFC; + border: 1px solid var(--search-filter-border-color); + background-color: var(--search-filter-background-color); z-index: 10001; padding-top: 4px; padding-bottom: 4px; @@ -113,7 +131,7 @@ } .SelectItem { - font: 8pt Arial, Verdana, sans-serif; + font: 8pt var(--font-family-search); padding-left: 2px; padding-right: 12px; border: 0px; @@ -121,7 +139,7 @@ span.SelectionMark { margin-right: 4px; - font-family: monospace; + font-family: var(--font-family-monospace); outline-style: none; text-decoration: none; } @@ -129,7 +147,7 @@ span.SelectionMark { a.SelectItem { display: block; outline-style: none; - color: #000000; + color: var(--search-filter-foreground-color); text-decoration: none; padding-left: 6px; padding-right: 12px; @@ -137,14 +155,14 @@ a.SelectItem { a.SelectItem:focus, a.SelectItem:active { - color: #000000; + color: var(--search-filter-foreground-color); outline-style: none; text-decoration: none; } a.SelectItem:hover { - color: #FFFFFF; - background-color: #3D578C; + color: var(--search-filter-highlight-text-color); + background-color: var(--search-filter-highlight-bg-color); outline-style: none; text-decoration: none; cursor: pointer; @@ -154,7 +172,7 @@ a.SelectItem:hover { /*---------------- Search results window */ iframe#MSearchResults { - width: 60ex; + /*width: 60ex;*/ height: 15em; } @@ -162,9 +180,12 @@ iframe#MSearchResults { display: none; position: absolute; left: 0; top: 0; - border: 1px solid #000; - background-color: #EEF1F7; + border: 1px solid var(--search-results-border-color); + background-color: var(--search-results-background-color); z-index:10000; + width: 300px; + height: 400px; + overflow: auto; } /* ----------------------------------- */ @@ -172,7 +193,6 @@ iframe#MSearchResults { #SRIndex { clear:both; - padding-bottom: 15px; } .SREntry { @@ -185,8 +205,9 @@ iframe#MSearchResults { padding: 1px 5px; } -body.SRPage { +div.SRPage { margin: 5px 2px; + background-color: var(--search-results-background-color); } .SRChildren { @@ -198,17 +219,18 @@ body.SRPage { } .SRSymbol { - font-weight: bold; - color: #425E97; - font-family: Arial, Verdana, sans-serif; + font-weight: bold; + color: var(--search-results-foreground-color); + font-family: var(--font-family-search); text-decoration: none; outline: none; } a.SRScope { display: block; - color: #425E97; - font-family: Arial, Verdana, sans-serif; + color: var(--search-results-foreground-color); + font-family: var(--font-family-search); + font-size: 8pt; text-decoration: none; outline: none; } @@ -220,33 +242,31 @@ a.SRScope:focus, a.SRScope:active { span.SRScope { padding-left: 4px; + font-family: var(--font-family-search); } .SRPage .SRStatus { padding: 2px 5px; font-size: 8pt; font-style: italic; + font-family: var(--font-family-search); } .SRResult { display: none; } -DIV.searchresults { +div.searchresults { margin-left: 10px; margin-right: 10px; } /*---------------- External search page results */ -.searchresult { - background-color: #F0F3F8; -} - .pages b { color: white; padding: 5px 5px 3px 5px; - background-image: url("../tab_a.png"); + background-image: var(--nav-gradient-active-image-parent); background-repeat: repeat-x; text-shadow: 0 1px 1px #000000; } diff --git a/docs/html/search/search.js b/docs/html/search/search.js index a554ab9c..666af01e 100644 --- a/docs/html/search/search.js +++ b/docs/html/search/search.js @@ -1,76 +1,30 @@ /* - @licstart The following is the entire license notice for the - JavaScript code in this file. + @licstart The following is the entire license notice for the JavaScript code in this file. - Copyright (C) 1997-2017 by Dimitri van Heesch + The MIT License (MIT) - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. + Copyright (C) 1997-2020 by Dimitri van Heesch - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. + Permission is hereby granted, free of charge, to any person obtaining a copy of this software + and associated documentation files (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, publish, distribute, + sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + The above copyright notice and this permission notice shall be included in all copies or + substantial portions of the Software. - @licend The above is the entire license notice - for the JavaScript code in this file - */ -function convertToId(search) -{ - var result = ''; - for (i=0;i document.getElementById("MSearchField"); + this.DOMSearchSelect = () => document.getElementById("MSearchSelect"); + this.DOMSearchSelectWindow = () => document.getElementById("MSearchSelectWindow"); + this.DOMPopupSearchResults = () => document.getElementById("MSearchResults"); + this.DOMPopupSearchResultsWindow = () => document.getElementById("MSearchResultsWindow"); + this.DOMSearchClose = () => document.getElementById("MSearchClose"); + this.DOMSearchBox = () => document.getElementById("MSearchBox"); // ------------ Event Handlers // Called when focus is added or removed from the search field. - this.OnSearchFieldFocus = function(isActive) - { + this.OnSearchFieldFocus = function(isActive) { this.Activate(isActive); } - this.OnSearchSelectShow = function() - { - var searchSelectWindow = this.DOMSearchSelectWindow(); - var searchField = this.DOMSearchSelect(); - - if (this.insideFrame) - { - var left = getXPos(searchField); - var top = getYPos(searchField); - left += searchField.offsetWidth + 6; - top += searchField.offsetHeight; - - // show search selection popup - searchSelectWindow.style.display='block'; - left -= searchSelectWindow.offsetWidth; - searchSelectWindow.style.left = left + 'px'; - searchSelectWindow.style.top = top + 'px'; - } - else - { - var left = getXPos(searchField); - var top = getYPos(searchField); - top += searchField.offsetHeight; - - // show search selection popup - searchSelectWindow.style.display='block'; - searchSelectWindow.style.left = left + 'px'; - searchSelectWindow.style.top = top + 'px'; - } + this.OnSearchSelectShow = function() { + const searchSelectWindow = this.DOMSearchSelectWindow(); + const searchField = this.DOMSearchSelect(); + + const left = getXPos(searchField); + const top = getYPos(searchField) + searchField.offsetHeight; + + // show search selection popup + searchSelectWindow.style.display='block'; + searchSelectWindow.style.left = left + 'px'; + searchSelectWindow.style.top = top + 'px'; // stop selection hide timer - if (this.hideTimeout) - { + if (this.hideTimeout) { clearTimeout(this.hideTimeout); this.hideTimeout=0; } return false; // to avoid "image drag" default event } - this.OnSearchSelectHide = function() - { - this.hideTimeout = setTimeout(this.name +".CloseSelectionWindow()", + this.OnSearchSelectHide = function() { + this.hideTimeout = setTimeout(this.CloseSelectionWindow.bind(this), this.closeSelectionTimeout); } // Called when the content of the search field is changed. - this.OnSearchFieldChange = function(evt) - { - if (this.keyTimeout) // kill running timer - { + this.OnSearchFieldChange = function(evt) { + if (this.keyTimeout) { // kill running timer clearTimeout(this.keyTimeout); this.keyTimeout = 0; } - var e = (evt) ? evt : window.event; // for IE - if (e.keyCode==40 || e.keyCode==13) - { - if (e.shiftKey==1) - { + const e = evt ? evt : window.event; // for IE + if (e.keyCode==40 || e.keyCode==13) { + if (e.shiftKey==1) { this.OnSearchSelectShow(); - var win=this.DOMSearchSelectWindow(); - for (i=0;i do a search - { + const searchValue = this.DOMSearchField().value.replace(/ +/g, ""); + if (searchValue!="" && this.searchActive) { // something was found -> do a search this.Search(); } } - this.OnSearchSelectKey = function(evt) - { - var e = (evt) ? evt : window.event; // for IE - if (e.keyCode==40 && this.searchIndex0) // Up - { + } else if (e.keyCode==38 && this.searchIndex>0) { // Up this.searchIndex--; this.OnSelectItem(this.searchIndex); - } - else if (e.keyCode==13 || e.keyCode==27) - { + } else if (e.keyCode==13 || e.keyCode==27) { + e.stopPropagation(); this.OnSelectItem(this.searchIndex); this.CloseSelectionWindow(); this.DOMSearchField().focus(); @@ -312,111 +239,108 @@ function SearchBox(name, resultsPath, inFrame, label) // --------- Actions // Closes the results window. - this.CloseResultsWindow = function() - { + this.CloseResultsWindow = function() { this.DOMPopupSearchResultsWindow().style.display = 'none'; this.DOMSearchClose().style.display = 'none'; this.Activate(false); } - this.CloseSelectionWindow = function() - { + this.CloseSelectionWindow = function() { this.DOMSearchSelectWindow().style.display = 'none'; } // Performs a search. - this.Search = function() - { + this.Search = function() { this.keyTimeout = 0; // strip leading whitespace - var searchValue = this.DOMSearchField().value.replace(/^ +/, ""); + const searchValue = this.DOMSearchField().value.replace(/^ +/, ""); - var code = searchValue.toLowerCase().charCodeAt(0); - var idxChar = searchValue.substr(0, 1).toLowerCase(); - if ( 0xD800 <= code && code <= 0xDBFF && searchValue > 1) // surrogate pair - { + const code = searchValue.toLowerCase().charCodeAt(0); + let idxChar = searchValue.substr(0, 1).toLowerCase(); + if ( 0xD800 <= code && code <= 0xDBFF && searchValue > 1) { // surrogate pair idxChar = searchValue.substr(0, 2); } - var resultsPage; - var resultsPageWithSearch; - var hasResultsPage; - - var idx = indexSectionsWithContent[this.searchIndex].indexOf(idxChar); - if (idx!=-1) - { - var hexCode=idx.toString(16); - resultsPage = this.resultsPath + '/' + indexSectionNames[this.searchIndex] + '_' + hexCode + '.html'; - resultsPageWithSearch = resultsPage+'?'+escape(searchValue); - hasResultsPage = true; + let jsFile; + let idx = indexSectionsWithContent[this.searchIndex].indexOf(idxChar); + if (idx!=-1) { + const hexCode=idx.toString(16); + jsFile = this.resultsPath + indexSectionNames[this.searchIndex] + '_' + hexCode + '.js'; + } + + const loadJS = function(url, impl, loc) { + const scriptTag = document.createElement('script'); + scriptTag.src = url; + scriptTag.onload = impl; + scriptTag.onreadystatechange = impl; + loc.appendChild(scriptTag); } - else // nothing available for this search term - { - resultsPage = this.resultsPath + '/nomatches.html'; - resultsPageWithSearch = resultsPage; - hasResultsPage = false; + + const domPopupSearchResultsWindow = this.DOMPopupSearchResultsWindow(); + const domSearchBox = this.DOMSearchBox(); + const domPopupSearchResults = this.DOMPopupSearchResults(); + const domSearchClose = this.DOMSearchClose(); + const resultsPath = this.resultsPath; + + const handleResults = function() { + document.getElementById("Loading").style.display="none"; + if (typeof searchData !== 'undefined') { + createResults(resultsPath); + document.getElementById("NoMatches").style.display="none"; + } + + if (idx!=-1) { + searchResults.Search(searchValue); + } else { // no file with search results => force empty search results + searchResults.Search('===='); + } + + if (domPopupSearchResultsWindow.style.display!='block') { + domSearchClose.style.display = 'inline-block'; + let left = getXPos(domSearchBox) + 150; + let top = getYPos(domSearchBox) + 20; + domPopupSearchResultsWindow.style.display = 'block'; + left -= domPopupSearchResults.offsetWidth; + const maxWidth = document.body.clientWidth; + const maxHeight = document.body.clientHeight; + let width = 300; + if (left<10) left=10; + if (width+left+8>maxWidth) width=maxWidth-left-8; + let height = 400; + if (height+top+8>maxHeight) height=maxHeight-top-8; + domPopupSearchResultsWindow.style.top = top + 'px'; + domPopupSearchResultsWindow.style.left = left + 'px'; + domPopupSearchResultsWindow.style.width = width + 'px'; + domPopupSearchResultsWindow.style.height = height + 'px'; + } } - window.frames.MSearchResults.location = resultsPageWithSearch; - var domPopupSearchResultsWindow = this.DOMPopupSearchResultsWindow(); - - if (domPopupSearchResultsWindow.style.display!='block') - { - var domSearchBox = this.DOMSearchBox(); - this.DOMSearchClose().style.display = 'inline'; - if (this.insideFrame) - { - var domPopupSearchResults = this.DOMPopupSearchResults(); - domPopupSearchResultsWindow.style.position = 'relative'; - domPopupSearchResultsWindow.style.display = 'block'; - var width = document.body.clientWidth - 8; // the -8 is for IE :-( - domPopupSearchResultsWindow.style.width = width + 'px'; - domPopupSearchResults.style.width = width + 'px'; - } - else - { - var domPopupSearchResults = this.DOMPopupSearchResults(); - var left = getXPos(domSearchBox) + 150; // domSearchBox.offsetWidth; - var top = getYPos(domSearchBox) + 20; // domSearchBox.offsetHeight + 1; - domPopupSearchResultsWindow.style.display = 'block'; - left -= domPopupSearchResults.offsetWidth; - domPopupSearchResultsWindow.style.top = top + 'px'; - domPopupSearchResultsWindow.style.left = left + 'px'; - } + if (jsFile) { + loadJS(jsFile, handleResults, this.DOMPopupSearchResultsWindow()); + } else { + handleResults(); } this.lastSearchValue = searchValue; - this.lastResultsPage = resultsPage; } // -------- Activation Functions // Activates or deactivates the search panel, resetting things to // their default values if necessary. - this.Activate = function(isActive) - { + this.Activate = function(isActive) { if (isActive || // open it - this.DOMPopupSearchResultsWindow().style.display == 'block' - ) - { + this.DOMPopupSearchResultsWindow().style.display == 'block' + ) { this.DOMSearchBox().className = 'MSearchBoxActive'; - - var searchField = this.DOMSearchField(); - - if (searchField.value == this.searchLabel) // clear "Search" term upon entry - { - searchField.value = ''; - this.searchActive = true; - } - } - else if (!isActive) // directly remove the panel - { + this.searchActive = true; + } else if (!isActive) { // directly remove the panel this.DOMSearchBox().className = 'MSearchBoxInactive'; - this.DOMSearchField().value = this.searchLabel; this.searchActive = false; this.lastSearchValue = '' this.lastResultsPage = ''; + this.DOMSearchField().value = ''; } } } @@ -424,391 +348,347 @@ function SearchBox(name, resultsPath, inFrame, label) // ----------------------------------------------------------------------- // The class that handles everything on the search results page. -function SearchResults(name) -{ - // The number of matches from the last run of . - this.lastMatchCount = 0; - this.lastKey = 0; - this.repeatOn = false; - - // Toggles the visibility of the passed element ID. - this.FindChildElement = function(id) - { - var parentElement = document.getElementById(id); - var element = parentElement.firstChild; - - while (element && element!=parentElement) - { - if (element.nodeName == 'DIV' && element.className == 'SRChildren') - { - return element; - } +function SearchResults() { + + function convertToId(search) { + let result = ''; + for (let i=0;i. + this.lastMatchCount = 0; + this.lastKey = 0; + this.repeatOn = false; - if (element && element!=parentElement) - { - element = element.nextSibling; - } - } + // Toggles the visibility of the passed element ID. + this.FindChildElement = function(id) { + const parentElement = document.getElementById(id); + let element = parentElement.firstChild; + + while (element && element!=parentElement) { + if (element.nodeName.toLowerCase() == 'div' && element.className == 'SRChildren') { + return element; } - } - this.Toggle = function(id) - { - var element = this.FindChildElement(id); - if (element) - { - if (element.style.display == 'block') - { - element.style.display = 'none'; + if (element.nodeName.toLowerCase() == 'div' && element.hasChildNodes()) { + element = element.firstChild; + } else if (element.nextSibling) { + element = element.nextSibling; + } else { + do { + element = element.parentNode; } - else - { - element.style.display = 'block'; + while (element && element!=parentElement && !element.nextSibling); + + if (element && element!=parentElement) { + element = element.nextSibling; } } } + } - // Searches for the passed string. If there is no parameter, - // it takes it from the URL query. - // - // Always returns true, since other documents may try to call it - // and that may or may not be possible. - this.Search = function(search) - { - if (!search) // get search word from URL - { - search = window.location.search; - search = search.substring(1); // Remove the leading '?' - search = unescape(search); + this.Toggle = function(id) { + const element = this.FindChildElement(id); + if (element) { + if (element.style.display == 'block') { + element.style.display = 'none'; + } else { + element.style.display = 'block'; } + } + } - search = search.replace(/^ +/, ""); // strip leading spaces - search = search.replace(/ +$/, ""); // strip trailing spaces - search = search.toLowerCase(); - search = convertToId(search); - - var resultRows = document.getElementsByTagName("div"); - var matches = 0; - - var i = 0; - while (i < resultRows.length) - { - var row = resultRows.item(i); - if (row.className == "SRResult") - { - var rowMatchName = row.id.toLowerCase(); - rowMatchName = rowMatchName.replace(/^sr\d*_/, ''); // strip 'sr123_' - - if (search.length<=rowMatchName.length && - rowMatchName.substr(0, search.length)==search) - { - row.style.display = 'block'; - matches++; - } - else - { - row.style.display = 'none'; - } + // Searches for the passed string. If there is no parameter, + // it takes it from the URL query. + // + // Always returns true, since other documents may try to call it + // and that may or may not be possible. + this.Search = function(search) { + if (!search) { // get search word from URL + search = window.location.search; + search = search.substring(1); // Remove the leading '?' + search = unescape(search); + } + + search = search.replace(/^ +/, ""); // strip leading spaces + search = search.replace(/ +$/, ""); // strip trailing spaces + search = search.toLowerCase(); + search = convertToId(search); + + const resultRows = document.getElementsByTagName("div"); + let matches = 0; + + let i = 0; + while (i < resultRows.length) { + const row = resultRows.item(i); + if (row.className == "SRResult") { + let rowMatchName = row.id.toLowerCase(); + rowMatchName = rowMatchName.replace(/^sr\d*_/, ''); // strip 'sr123_' + + if (search.length<=rowMatchName.length && + rowMatchName.substr(0, search.length)==search) { + row.style.display = 'block'; + matches++; + } else { + row.style.display = 'none'; } - i++; - } - document.getElementById("Searching").style.display='none'; - if (matches == 0) // no results - { - document.getElementById("NoMatches").style.display='block'; } - else // at least one result - { - document.getElementById("NoMatches").style.display='none'; - } - this.lastMatchCount = matches; - return true; + i++; } + document.getElementById("Searching").style.display='none'; + if (matches == 0) { // no results + document.getElementById("NoMatches").style.display='block'; + } else { // at least one result + document.getElementById("NoMatches").style.display='none'; + } + this.lastMatchCount = matches; + return true; + } - // return the first item with index index or higher that is visible - this.NavNext = function(index) - { - var focusItem; - while (1) - { - var focusName = 'Item'+index; - focusItem = document.getElementById(focusName); - if (focusItem && focusItem.parentNode.parentNode.style.display=='block') - { - break; - } - else if (!focusItem) // last element - { - break; - } - focusItem=null; - index++; + // return the first item with index index or higher that is visible + this.NavNext = function(index) { + let focusItem; + for (;;) { + const focusName = 'Item'+index; + focusItem = document.getElementById(focusName); + if (focusItem && focusItem.parentNode.parentNode.style.display=='block') { + break; + } else if (!focusItem) { // last element + break; } - return focusItem; + focusItem=null; + index++; } + return focusItem; + } - this.NavPrev = function(index) - { - var focusItem; - while (1) - { - var focusName = 'Item'+index; - focusItem = document.getElementById(focusName); - if (focusItem && focusItem.parentNode.parentNode.style.display=='block') - { - break; - } - else if (!focusItem) // last element - { - break; - } - focusItem=null; - index--; + this.NavPrev = function(index) { + let focusItem; + for (;;) { + const focusName = 'Item'+index; + focusItem = document.getElementById(focusName); + if (focusItem && focusItem.parentNode.parentNode.style.display=='block') { + break; + } else if (!focusItem) { // last element + break; } - return focusItem; + focusItem=null; + index--; } + return focusItem; + } - this.ProcessKeys = function(e) - { - if (e.type == "keydown") - { - this.repeatOn = false; - this.lastKey = e.keyCode; + this.ProcessKeys = function(e) { + if (e.type == "keydown") { + this.repeatOn = false; + this.lastKey = e.keyCode; + } else if (e.type == "keypress") { + if (!this.repeatOn) { + if (this.lastKey) this.repeatOn = true; + return false; // ignore first keypress after keydown } - else if (e.type == "keypress") - { - if (!this.repeatOn) - { - if (this.lastKey) this.repeatOn = true; - return false; // ignore first keypress after keydown - } - } - else if (e.type == "keyup") - { - this.lastKey = 0; - this.repeatOn = false; - } - return this.lastKey!=0; + } else if (e.type == "keyup") { + this.lastKey = 0; + this.repeatOn = false; } + return this.lastKey!=0; + } - this.Nav = function(evt,itemIndex) - { - var e = (evt) ? evt : window.event; // for IE - if (e.keyCode==13) return true; - if (!this.ProcessKeys(e)) return false; - - if (this.lastKey==38) // Up - { - var newIndex = itemIndex-1; - var focusItem = this.NavPrev(newIndex); - if (focusItem) - { - var child = this.FindChildElement(focusItem.parentNode.parentNode.id); - if (child && child.style.display == 'block') // children visible - { - var n=0; - var tmpElem; - while (1) // search for last child - { - tmpElem = document.getElementById('Item'+newIndex+'_c'+n); - if (tmpElem) - { - focusItem = tmpElem; - } - else // found it! - { - break; - } - n++; + this.Nav = function(evt,itemIndex) { + const e = (evt) ? evt : window.event; // for IE + if (e.keyCode==13) return true; + if (!this.ProcessKeys(e)) return false; + + if (this.lastKey==38) { // Up + const newIndex = itemIndex-1; + let focusItem = this.NavPrev(newIndex); + if (focusItem) { + let child = this.FindChildElement(focusItem.parentNode.parentNode.id); + if (child && child.style.display == 'block') { // children visible + let n=0; + let tmpElem; + for (;;) { // search for last child + tmpElem = document.getElementById('Item'+newIndex+'_c'+n); + if (tmpElem) { + focusItem = tmpElem; + } else { // found it! + break; } + n++; } } - if (focusItem) - { - focusItem.focus(); - } - else // return focus to search field - { - parent.document.getElementById("MSearchField").focus(); - } - } - else if (this.lastKey==40) // Down - { - var newIndex = itemIndex+1; - var focusItem; - var item = document.getElementById('Item'+itemIndex); - var elem = this.FindChildElement(item.parentNode.parentNode.id); - if (elem && elem.style.display == 'block') // children visible - { - focusItem = document.getElementById('Item'+itemIndex+'_c0'); - } - if (!focusItem) focusItem = this.NavNext(newIndex); - if (focusItem) focusItem.focus(); } - else if (this.lastKey==39) // Right - { - var item = document.getElementById('Item'+itemIndex); - var elem = this.FindChildElement(item.parentNode.parentNode.id); - if (elem) elem.style.display = 'block'; + if (focusItem) { + focusItem.focus(); + } else { // return focus to search field + document.getElementById("MSearchField").focus(); } - else if (this.lastKey==37) // Left - { - var item = document.getElementById('Item'+itemIndex); - var elem = this.FindChildElement(item.parentNode.parentNode.id); - if (elem) elem.style.display = 'none'; + } else if (this.lastKey==40) { // Down + const newIndex = itemIndex+1; + let focusItem; + const item = document.getElementById('Item'+itemIndex); + const elem = this.FindChildElement(item.parentNode.parentNode.id); + if (elem && elem.style.display == 'block') { // children visible + focusItem = document.getElementById('Item'+itemIndex+'_c0'); } - else if (this.lastKey==27) // Escape - { - parent.searchBox.CloseResultsWindow(); - parent.document.getElementById("MSearchField").focus(); - } - else if (this.lastKey==13) // Enter - { - return true; - } - return false; + if (!focusItem) focusItem = this.NavNext(newIndex); + if (focusItem) focusItem.focus(); + } else if (this.lastKey==39) { // Right + const item = document.getElementById('Item'+itemIndex); + const elem = this.FindChildElement(item.parentNode.parentNode.id); + if (elem) elem.style.display = 'block'; + } else if (this.lastKey==37) { // Left + const item = document.getElementById('Item'+itemIndex); + const elem = this.FindChildElement(item.parentNode.parentNode.id); + if (elem) elem.style.display = 'none'; + } else if (this.lastKey==27) { // Escape + e.stopPropagation(); + searchBox.CloseResultsWindow(); + document.getElementById("MSearchField").focus(); + } else if (this.lastKey==13) { // Enter + return true; } + return false; + } - this.NavChild = function(evt,itemIndex,childIndex) - { - var e = (evt) ? evt : window.event; // for IE - if (e.keyCode==13) return true; - if (!this.ProcessKeys(e)) return false; - - if (this.lastKey==38) // Up - { - if (childIndex>0) - { - var newIndex = childIndex-1; - document.getElementById('Item'+itemIndex+'_c'+newIndex).focus(); - } - else // already at first child, jump to parent - { - document.getElementById('Item'+itemIndex).focus(); - } - } - else if (this.lastKey==40) // Down - { - var newIndex = childIndex+1; - var elem = document.getElementById('Item'+itemIndex+'_c'+newIndex); - if (!elem) // last child, jump to parent next parent - { - elem = this.NavNext(itemIndex+1); - } - if (elem) - { - elem.focus(); - } + this.NavChild = function(evt,itemIndex,childIndex) { + const e = (evt) ? evt : window.event; // for IE + if (e.keyCode==13) return true; + if (!this.ProcessKeys(e)) return false; + + if (this.lastKey==38) { // Up + if (childIndex>0) { + const newIndex = childIndex-1; + document.getElementById('Item'+itemIndex+'_c'+newIndex).focus(); + } else { // already at first child, jump to parent + document.getElementById('Item'+itemIndex).focus(); } - else if (this.lastKey==27) // Escape - { - parent.searchBox.CloseResultsWindow(); - parent.document.getElementById("MSearchField").focus(); + } else if (this.lastKey==40) { // Down + const newIndex = childIndex+1; + let elem = document.getElementById('Item'+itemIndex+'_c'+newIndex); + if (!elem) { // last child, jump to parent next parent + elem = this.NavNext(itemIndex+1); } - else if (this.lastKey==13) // Enter - { - return true; + if (elem) { + elem.focus(); } - return false; + } else if (this.lastKey==27) { // Escape + e.stopPropagation(); + searchBox.CloseResultsWindow(); + document.getElementById("MSearchField").focus(); + } else if (this.lastKey==13) { // Enter + return true; } + return false; + } } -function setKeyActions(elem,action) -{ - elem.setAttribute('onkeydown',action); - elem.setAttribute('onkeypress',action); - elem.setAttribute('onkeyup',action); -} +function createResults(resultsPath) { -function setClassAttr(elem,attr) -{ - elem.setAttribute('class',attr); - elem.setAttribute('className',attr); -} + function setKeyActions(elem,action) { + elem.setAttribute('onkeydown',action); + elem.setAttribute('onkeypress',action); + elem.setAttribute('onkeyup',action); + } + + function setClassAttr(elem,attr) { + elem.setAttribute('class',attr); + elem.setAttribute('className',attr); + } -function createResults() -{ - var results = document.getElementById("SRResults"); - for (var e=0; e { + const id = elem[0]; + const srResult = document.createElement('div'); srResult.setAttribute('id','SR_'+id); setClassAttr(srResult,'SRResult'); - var srEntry = document.createElement('div'); + const srEntry = document.createElement('div'); setClassAttr(srEntry,'SREntry'); - var srLink = document.createElement('a'); - srLink.setAttribute('id','Item'+e); - setKeyActions(srLink,'return searchResults.Nav(event,'+e+')'); + const srLink = document.createElement('a'); + srLink.setAttribute('id','Item'+index); + setKeyActions(srLink,'return searchResults.Nav(event,'+index+')'); setClassAttr(srLink,'SRSymbol'); - srLink.innerHTML = searchData[e][1][0]; + srLink.innerHTML = elem[1][0]; srEntry.appendChild(srLink); - if (searchData[e][1].length==2) // single result - { - srLink.setAttribute('href',searchData[e][1][1][0]); - if (searchData[e][1][1][1]) - { + if (elem[1].length==2) { // single result + srLink.setAttribute('href',resultsPath+elem[1][1][0]); + srLink.setAttribute('onclick','searchBox.CloseResultsWindow()'); + if (elem[1][1][1]) { srLink.setAttribute('target','_parent'); + } else { + srLink.setAttribute('target','_blank'); } - var srScope = document.createElement('span'); + const srScope = document.createElement('span'); setClassAttr(srScope,'SRScope'); - srScope.innerHTML = searchData[e][1][1][2]; + srScope.innerHTML = elem[1][1][2]; srEntry.appendChild(srScope); - } - else // multiple results - { + } else { // multiple results srLink.setAttribute('href','javascript:searchResults.Toggle("SR_'+id+'")'); - var srChildren = document.createElement('div'); + const srChildren = document.createElement('div'); setClassAttr(srChildren,'SRChildren'); - for (var c=0; cli>h1,.sm>li>h2,.sm>li>h3,.sm>li>h4,.sm>li>h5,.sm>li>h6{margin:0;padding:0}.sm ul{display:none}.sm li,.sm a{position:relative}.sm a{display:block}.sm a.disabled{cursor:not-allowed}.sm:after{content:"\00a0";display:block;height:0;font:0/0 serif;clear:both;visibility:hidden;overflow:hidden}.sm,.sm *,.sm *:before,.sm *:after{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}#doc-content{overflow:auto;display:block;padding:0;margin:0;-webkit-overflow-scrolling:touch}.sm-dox{background-image:url("tab_b.png")}.sm-dox a,.sm-dox a:focus,.sm-dox a:hover,.sm-dox a:active{padding:0 12px;padding-right:43px;font-family:"Lucida Grande","Geneva","Helvetica",Arial,sans-serif;font-size:13px;font-weight:bold;line-height:36px;text-decoration:none;text-shadow:0 1px 1px rgba(255,255,255,0.9);color:#283a5d;outline:0}.sm-dox a:hover{background-image:url("tab_a.png");background-repeat:repeat-x;color:white;text-shadow:0 1px 1px black}.sm-dox a.current{color:#d23600}.sm-dox a.disabled{color:#bbb}.sm-dox a span.sub-arrow{position:absolute;top:50%;margin-top:-14px;left:auto;right:3px;width:28px;height:28px;overflow:hidden;font:bold 12px/28px monospace!important;text-align:center;text-shadow:none;background:rgba(255,255,255,0.5);-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px}.sm-dox a.highlighted span.sub-arrow:before{display:block;content:'-'}.sm-dox>li:first-child>a,.sm-dox>li:first-child>:not(ul) a{-moz-border-radius:5px 5px 0 0;-webkit-border-radius:5px;border-radius:5px 5px 0 0}.sm-dox>li:last-child>a,.sm-dox>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul{-moz-border-radius:0 0 5px 5px;-webkit-border-radius:0;border-radius:0 0 5px 5px}.sm-dox>li:last-child>a.highlighted,.sm-dox>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a.highlighted{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0}.sm-dox ul{background:rgba(162,162,162,0.1)}.sm-dox ul a,.sm-dox ul a:focus,.sm-dox ul a:hover,.sm-dox ul a:active{font-size:12px;border-left:8px solid transparent;line-height:36px;text-shadow:none;background-color:white;background-image:none}.sm-dox ul a:hover{background-image:url("tab_a.png");background-repeat:repeat-x;color:white;text-shadow:0 1px 1px black}.sm-dox ul ul a,.sm-dox ul ul a:hover,.sm-dox ul ul a:focus,.sm-dox ul ul a:active{border-left:16px solid transparent}.sm-dox ul ul ul a,.sm-dox ul ul ul a:hover,.sm-dox ul ul ul a:focus,.sm-dox ul ul ul a:active{border-left:24px solid transparent}.sm-dox ul ul ul ul a,.sm-dox ul ul ul ul a:hover,.sm-dox ul ul ul ul a:focus,.sm-dox ul ul ul ul a:active{border-left:32px solid transparent}.sm-dox ul ul ul ul ul a,.sm-dox ul ul ul ul ul a:hover,.sm-dox ul ul ul ul ul a:focus,.sm-dox ul ul ul ul ul a:active{border-left:40px solid transparent}@media(min-width:768px){.sm-dox ul{position:absolute;width:12em}.sm-dox li{float:left}.sm-dox.sm-rtl li{float:right}.sm-dox ul li,.sm-dox.sm-rtl ul li,.sm-dox.sm-vertical li{float:none}.sm-dox a{white-space:nowrap}.sm-dox ul a,.sm-dox.sm-vertical a{white-space:normal}.sm-dox .sm-nowrap>li>a,.sm-dox .sm-nowrap>li>:not(ul) a{white-space:nowrap}.sm-dox{padding:0 10px;background-image:url("tab_b.png");line-height:36px}.sm-dox a span.sub-arrow{top:50%;margin-top:-2px;right:12px;width:0;height:0;border-width:4px;border-style:solid dashed dashed dashed;border-color:#283a5d transparent transparent transparent;background:transparent;-moz-border-radius:0;-webkit-border-radius:0;border-radius:0}.sm-dox a,.sm-dox a:focus,.sm-dox a:active,.sm-dox a:hover,.sm-dox a.highlighted{padding:0 12px;background-image:url("tab_s.png");background-repeat:no-repeat;background-position:right;-moz-border-radius:0!important;-webkit-border-radius:0;border-radius:0!important}.sm-dox a:hover{background-image:url("tab_a.png");background-repeat:repeat-x;color:white;text-shadow:0 1px 1px black}.sm-dox a:hover span.sub-arrow{border-color:white transparent transparent transparent}.sm-dox a.has-submenu{padding-right:24px}.sm-dox li{border-top:0}.sm-dox>li>ul:before,.sm-dox>li>ul:after{content:'';position:absolute;top:-18px;left:30px;width:0;height:0;overflow:hidden;border-width:9px;border-style:dashed dashed solid dashed;border-color:transparent transparent #bbb transparent}.sm-dox>li>ul:after{top:-16px;left:31px;border-width:8px;border-color:transparent transparent #fff transparent}.sm-dox ul{border:1px solid #bbb;padding:5px 0;background:#fff;-moz-border-radius:5px!important;-webkit-border-radius:5px;border-radius:5px!important;-moz-box-shadow:0 5px 9px rgba(0,0,0,0.2);-webkit-box-shadow:0 5px 9px rgba(0,0,0,0.2);box-shadow:0 5px 9px rgba(0,0,0,0.2)}.sm-dox ul a span.sub-arrow{right:8px;top:50%;margin-top:-5px;border-width:5px;border-color:transparent transparent transparent #555;border-style:dashed dashed dashed solid}.sm-dox ul a,.sm-dox ul a:hover,.sm-dox ul a:focus,.sm-dox ul a:active,.sm-dox ul a.highlighted{color:#555;background-image:none;border:0!important;color:#555;background-image:none}.sm-dox ul a:hover{background-image:url("tab_a.png");background-repeat:repeat-x;color:white;text-shadow:0 1px 1px black}.sm-dox ul a:hover span.sub-arrow{border-color:transparent transparent transparent white}.sm-dox span.scroll-up,.sm-dox span.scroll-down{position:absolute;display:none;visibility:hidden;overflow:hidden;background:#fff;height:36px}.sm-dox span.scroll-up:hover,.sm-dox span.scroll-down:hover{background:#eee}.sm-dox span.scroll-up:hover span.scroll-up-arrow,.sm-dox span.scroll-up:hover span.scroll-down-arrow{border-color:transparent transparent #d23600 transparent}.sm-dox span.scroll-down:hover span.scroll-down-arrow{border-color:#d23600 transparent transparent transparent}.sm-dox span.scroll-up-arrow,.sm-dox span.scroll-down-arrow{position:absolute;top:0;left:50%;margin-left:-6px;width:0;height:0;overflow:hidden;border-width:6px;border-style:dashed dashed solid dashed;border-color:transparent transparent #555 transparent}.sm-dox span.scroll-down-arrow{top:8px;border-style:solid dashed dashed dashed;border-color:#555 transparent transparent transparent}.sm-dox.sm-rtl a.has-submenu{padding-right:12px;padding-left:24px}.sm-dox.sm-rtl a span.sub-arrow{right:auto;left:12px}.sm-dox.sm-rtl.sm-vertical a.has-submenu{padding:10px 20px}.sm-dox.sm-rtl.sm-vertical a span.sub-arrow{right:auto;left:8px;border-style:dashed solid dashed dashed;border-color:transparent #555 transparent transparent}.sm-dox.sm-rtl>li>ul:before{left:auto;right:30px}.sm-dox.sm-rtl>li>ul:after{left:auto;right:31px}.sm-dox.sm-rtl ul a.has-submenu{padding:10px 20px!important}.sm-dox.sm-rtl ul a span.sub-arrow{right:auto;left:8px;border-style:dashed solid dashed dashed;border-color:transparent #555 transparent transparent}.sm-dox.sm-vertical{padding:10px 0;-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px}.sm-dox.sm-vertical a{padding:10px 20px}.sm-dox.sm-vertical a:hover,.sm-dox.sm-vertical a:focus,.sm-dox.sm-vertical a:active,.sm-dox.sm-vertical a.highlighted{background:#fff}.sm-dox.sm-vertical a.disabled{background-image:url("tab_b.png")}.sm-dox.sm-vertical a span.sub-arrow{right:8px;top:50%;margin-top:-5px;border-width:5px;border-style:dashed dashed dashed solid;border-color:transparent transparent transparent #555}.sm-dox.sm-vertical>li>ul:before,.sm-dox.sm-vertical>li>ul:after{display:none}.sm-dox.sm-vertical ul a{padding:10px 20px}.sm-dox.sm-vertical ul a:hover,.sm-dox.sm-vertical ul a:focus,.sm-dox.sm-vertical ul a:active,.sm-dox.sm-vertical ul a.highlighted{background:#eee}.sm-dox.sm-vertical ul a.disabled{background:#fff}} \ No newline at end of file +.sm{position:relative;z-index:9999}.sm,.sm ul,.sm li{display:block;list-style:none;margin:0;padding:0;line-height:normal;direction:ltr;text-align:left;-webkit-tap-highlight-color:rgba(0,0,0,0)}.sm-rtl,.sm-rtl ul,.sm-rtl li{direction:rtl;text-align:right}.sm>li>h1,.sm>li>h2,.sm>li>h3,.sm>li>h4,.sm>li>h5,.sm>li>h6{margin:0;padding:0}.sm ul{display:none}.sm li,.sm a{position:relative}.sm a{display:block}.sm a.disabled{cursor:not-allowed}.sm:after{content:"\00a0";display:block;height:0;font:0/0 serif;clear:both;visibility:hidden;overflow:hidden}.sm,.sm *,.sm *:before,.sm *:after{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.main-menu-btn{position:relative;display:inline-block;width:36px;height:36px;text-indent:36px;margin-left:8px;white-space:nowrap;overflow:hidden;cursor:pointer;-webkit-tap-highlight-color:rgba(0,0,0,0)}.main-menu-btn-icon,.main-menu-btn-icon:before,.main-menu-btn-icon:after{position:absolute;top:50%;left:2px;height:2px;width:24px;background:var(--nav-menu-button-color);-webkit-transition:all .25s;transition:all .25s}.main-menu-btn-icon:before{content:'';top:-7px;left:0}.main-menu-btn-icon:after{content:'';top:7px;left:0}#main-menu-state:checked ~ .main-menu-btn .main-menu-btn-icon{height:0}#main-menu-state:checked ~ .main-menu-btn .main-menu-btn-icon:before{top:0;-webkit-transform:rotate(-45deg);transform:rotate(-45deg)}#main-menu-state:checked ~ .main-menu-btn .main-menu-btn-icon:after{top:0;-webkit-transform:rotate(45deg);transform:rotate(45deg)}#main-menu-state{position:absolute;width:1px;height:1px;margin:-1px;border:0;padding:0;overflow:hidden;clip:rect(1px,1px,1px,1px)}#main-menu-state:not(:checked) ~ #main-menu{display:none}#main-menu-state:checked ~ #main-menu{display:block}@media(min-width:768px){.main-menu-btn{position:absolute;top:-99999px}#main-menu-state:not(:checked) ~ #main-menu{display:block}}.sm-dox{background-image:var(--nav-gradient-image)}.sm-dox a,.sm-dox a:focus,.sm-dox a:hover,.sm-dox a:active{padding:0 12px;padding-right:43px;font-family:var(--font-family-nav);font-size:13px;font-weight:bold;line-height:36px;text-decoration:none;text-shadow:var(--nav-text-normal-shadow);color:var(--nav-text-normal-color);outline:0}.sm-dox a:hover{background-image:var(--nav-gradient-active-image);background-repeat:repeat-x;color:var(--nav-text-hover-color);text-shadow:var(--nav-text-hover-shadow)}.sm-dox a.current{color:#d23600}.sm-dox a.disabled{color:#bbb}.sm-dox a span.sub-arrow{position:absolute;top:50%;margin-top:-14px;left:auto;right:3px;width:28px;height:28px;overflow:hidden;font:bold 12px/28px monospace !important;text-align:center;text-shadow:none;background:var(--nav-menu-toggle-color);-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px}.sm-dox a span.sub-arrow:before{display:block;content:'+'}.sm-dox a.highlighted span.sub-arrow:before{display:block;content:'-'}.sm-dox>li:first-child>a,.sm-dox>li:first-child>:not(ul) a{-moz-border-radius:5px 5px 0 0;-webkit-border-radius:5px;border-radius:5px 5px 0 0}.sm-dox>li:last-child>a,.sm-dox>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul{-moz-border-radius:0 0 5px 5px;-webkit-border-radius:0;border-radius:0 0 5px 5px}.sm-dox>li:last-child>a.highlighted,.sm-dox>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a.highlighted{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0}.sm-dox ul{background:var(--nav-menu-background-color)}.sm-dox ul a,.sm-dox ul a:focus,.sm-dox ul a:hover,.sm-dox ul a:active{font-size:12px;border-left:8px solid transparent;line-height:36px;text-shadow:none;background-color:var(--nav-menu-background-color);background-image:none}.sm-dox ul a:hover{background-image:var(--nav-gradient-active-image);background-repeat:repeat-x;color:var(--nav-text-hover-color);text-shadow:0 1px 1px black}.sm-dox ul ul a,.sm-dox ul ul a:hover,.sm-dox ul ul a:focus,.sm-dox ul ul a:active{border-left:16px solid transparent}.sm-dox ul ul ul a,.sm-dox ul ul ul a:hover,.sm-dox ul ul ul a:focus,.sm-dox ul ul ul a:active{border-left:24px solid transparent}.sm-dox ul ul ul ul a,.sm-dox ul ul ul ul a:hover,.sm-dox ul ul ul ul a:focus,.sm-dox ul ul ul ul a:active{border-left:32px solid transparent}.sm-dox ul ul ul ul ul a,.sm-dox ul ul ul ul ul a:hover,.sm-dox ul ul ul ul ul a:focus,.sm-dox ul ul ul ul ul a:active{border-left:40px solid transparent}@media(min-width:768px){.sm-dox ul{position:absolute;width:12em}.sm-dox li{float:left}.sm-dox.sm-rtl li{float:right}.sm-dox ul li,.sm-dox.sm-rtl ul li,.sm-dox.sm-vertical li{float:none}.sm-dox a{white-space:nowrap}.sm-dox ul a,.sm-dox.sm-vertical a{white-space:normal}.sm-dox .sm-nowrap>li>a,.sm-dox .sm-nowrap>li>:not(ul) a{white-space:nowrap}.sm-dox{padding:0 10px;background-image:var(--nav-gradient-image);line-height:36px}.sm-dox a span.sub-arrow{top:50%;margin-top:-2px;right:12px;width:0;height:0;border-width:4px;border-style:solid dashed dashed dashed;border-color:var(--nav-text-normal-color) transparent transparent transparent;background:transparent;-moz-border-radius:0;-webkit-border-radius:0;border-radius:0}.sm-dox a,.sm-dox a:focus,.sm-dox a:active,.sm-dox a:hover,.sm-dox a.highlighted{padding:0 12px;background-image:var(--nav-separator-image);background-repeat:no-repeat;background-position:right;-moz-border-radius:0 !important;-webkit-border-radius:0;border-radius:0 !important}.sm-dox a:hover{background-image:var(--nav-gradient-active-image);background-repeat:repeat-x;color:var(--nav-text-hover-color);text-shadow:var(--nav-text-hover-shadow)}.sm-dox a:hover span.sub-arrow{border-color:var(--nav-text-hover-color) transparent transparent transparent}.sm-dox a.has-submenu{padding-right:24px}.sm-dox li{border-top:0}.sm-dox>li>ul:before,.sm-dox>li>ul:after{content:'';position:absolute;top:-18px;left:30px;width:0;height:0;overflow:hidden;border-width:9px;border-style:dashed dashed solid dashed;border-color:transparent transparent #bbb transparent}.sm-dox>li>ul:after{top:-16px;left:31px;border-width:8px;border-color:transparent transparent var(--nav-menu-background-color) transparent}.sm-dox ul{border:1px solid #bbb;padding:5px 0;background:var(--nav-menu-background-color);-moz-border-radius:5px !important;-webkit-border-radius:5px;border-radius:5px !important;-moz-box-shadow:0 5px 9px rgba(0,0,0,0.2);-webkit-box-shadow:0 5px 9px rgba(0,0,0,0.2);box-shadow:0 5px 9px rgba(0,0,0,0.2)}.sm-dox ul a span.sub-arrow{right:8px;top:50%;margin-top:-5px;border-width:5px;border-color:transparent transparent transparent var(--nav-menu-foreground-color);border-style:dashed dashed dashed solid}.sm-dox ul a,.sm-dox ul a:hover,.sm-dox ul a:focus,.sm-dox ul a:active,.sm-dox ul a.highlighted{color:var(--nav-menu-foreground-color);background-image:none;border:0 !important}.sm-dox ul a:hover{background-image:var(--nav-gradient-active-image);background-repeat:repeat-x;color:var(--nav-text-hover-color);text-shadow:var(--nav-text-hover-shadow)}.sm-dox ul a:hover span.sub-arrow{border-color:transparent transparent transparent var(--nav-text-hover-color)}.sm-dox span.scroll-up,.sm-dox span.scroll-down{position:absolute;display:none;visibility:hidden;overflow:hidden;background:var(--nav-menu-background-color);height:36px}.sm-dox span.scroll-up:hover,.sm-dox span.scroll-down:hover{background:#eee}.sm-dox span.scroll-up:hover span.scroll-up-arrow,.sm-dox span.scroll-up:hover span.scroll-down-arrow{border-color:transparent transparent #d23600 transparent}.sm-dox span.scroll-down:hover span.scroll-down-arrow{border-color:#d23600 transparent transparent transparent}.sm-dox span.scroll-up-arrow,.sm-dox span.scroll-down-arrow{position:absolute;top:0;left:50%;margin-left:-6px;width:0;height:0;overflow:hidden;border-width:6px;border-style:dashed dashed solid dashed;border-color:transparent transparent var(--nav-menu-foreground-color) transparent}.sm-dox span.scroll-down-arrow{top:8px;border-style:solid dashed dashed dashed;border-color:var(--nav-menu-foreground-color) transparent transparent transparent}.sm-dox.sm-rtl a.has-submenu{padding-right:12px;padding-left:24px}.sm-dox.sm-rtl a span.sub-arrow{right:auto;left:12px}.sm-dox.sm-rtl.sm-vertical a.has-submenu{padding:10px 20px}.sm-dox.sm-rtl.sm-vertical a span.sub-arrow{right:auto;left:8px;border-style:dashed solid dashed dashed;border-color:transparent #555 transparent transparent}.sm-dox.sm-rtl>li>ul:before{left:auto;right:30px}.sm-dox.sm-rtl>li>ul:after{left:auto;right:31px}.sm-dox.sm-rtl ul a.has-submenu{padding:10px 20px !important}.sm-dox.sm-rtl ul a span.sub-arrow{right:auto;left:8px;border-style:dashed solid dashed dashed;border-color:transparent #555 transparent transparent}.sm-dox.sm-vertical{padding:10px 0;-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px}.sm-dox.sm-vertical a{padding:10px 20px}.sm-dox.sm-vertical a:hover,.sm-dox.sm-vertical a:focus,.sm-dox.sm-vertical a:active,.sm-dox.sm-vertical a.highlighted{background:#fff}.sm-dox.sm-vertical a.disabled{background-image:var(--nav-gradient-image)}.sm-dox.sm-vertical a span.sub-arrow{right:8px;top:50%;margin-top:-5px;border-width:5px;border-style:dashed dashed dashed solid;border-color:transparent transparent transparent #555}.sm-dox.sm-vertical>li>ul:before,.sm-dox.sm-vertical>li>ul:after{display:none}.sm-dox.sm-vertical ul a{padding:10px 20px}.sm-dox.sm-vertical ul a:hover,.sm-dox.sm-vertical ul a:focus,.sm-dox.sm-vertical ul a:active,.sm-dox.sm-vertical ul a.highlighted{background:#eee}.sm-dox.sm-vertical ul a.disabled{background:var(--nav-menu-background-color)}} \ No newline at end of file diff --git a/docs/latex/cookbookpage.tex b/docs/latex/cookbookpage.tex index 5fc4b159..330eb229 100644 --- a/docs/latex/cookbookpage.tex +++ b/docs/latex/cookbookpage.tex @@ -1,46 +1,53 @@ -Two pipelines to call i\+S\+N\+Vs from known and unknown reference sequences have been written in \href{https://snakemake.readthedocs.io/en/stable/}{\tt snakemake}. +\chapter{Cookbook} +\hypertarget{cookbookpage}{}\label{cookbookpage}\index{Cookbook@{Cookbook}} +\label{cookbookpage_md_docs_2_c_o_o_k_b_o_o_k}% +\Hypertarget{cookbookpage_md_docs_2_c_o_o_k_b_o_o_k}% -The two pipelines are distributed along with i\+Var and are present in the\href{https://github.com/andersen-lab/ivar/tree/master/pipeline}{\tt pipeline/} and \href{https://github.com/andersen-lab/ivar/tree/master/pipeline_field}{\tt pipeline\+\_\+field/} fodlers respectively. + +Two pipelines to call i\+SNVs from known and unknown reference sequences have been written in \href{https://snakemake.readthedocs.io/en/stable/}{\texttt{ snakemake}}. + +The two pipelines are distributed along with i\+Var and are present in the\href{https://github.com/andersen-lab/ivar/tree/master/pipeline}{\texttt{ pipeline/}} and \href{https://github.com/andersen-lab/ivar/tree/master/pipeline_field}{\texttt{ pipeline\+\_\+field/}} fodlers respectively. For both pipelines, there are four parameters that will have to be set in beginning of the Snakefile. -\begin{DoxyCode} -in\_dir = "" -out\_dir = "" -bed = "" -ref="" +\begin{DoxyCode}{0} +\DoxyCodeLine{in\_dir\ =\ "{}"{}} +\DoxyCodeLine{out\_dir\ =\ "{}"{}} +\DoxyCodeLine{bed\ =\ "{}"{}} +\DoxyCodeLine{ref="{}"{}} + \end{DoxyCode} -\subsubsection*{Call i\+S\+N\+Vs from samples with known reference sequence} +\doxysubsection*{Call i\+SNVs from samples with known reference sequence} -\href{https://github.com/andersen-lab/paper_2018_primalseq-ivar/blob/master/cookbook/CookBook.ipynb}{\tt Link to Jupyter Notebook} +\href{https://github.com/andersen-lab/paper_2018_primalseq-ivar/blob/master/cookbook/CookBook.ipynb}{\texttt{ Link to Jupyter Notebook}} -\href{https://github.com/andersen-lab/ivar/tree/master/pipeline}{\tt Link to pipeline} +\href{https://github.com/andersen-lab/ivar/tree/master/pipeline}{\texttt{ Link to pipeline}} -\paragraph*{Dependencies\+:} +\doxysubsubsection*{Dependencies\+:} \begin{DoxyItemize} -\item \href{https://github.com/andersen-lab/ivar}{\tt i\+Var} -\item \href{https://htslib.org/}{\tt samtools} -\item \href{https://github.com/lh3/bwa}{\tt bwa} -\item \href{https://bedtools.readthedocs.io/en/latest/}{\tt bedtools} +\item \href{https://github.com/andersen-lab/ivar}{\texttt{ i\+Var}} +\item \href{https://htslib.org/}{\texttt{ samtools}} +\item \href{https://github.com/lh3/bwa}{\texttt{ bwa}} +\item \href{https://bedtools.readthedocs.io/en/latest/}{\texttt{ bedtools}} \end{DoxyItemize} -\subsubsection*{Call i\+S\+N\+Vs from samples with unknown reference sequence} +\doxysubsection*{Call i\+SNVs from samples with unknown reference sequence} -\href{https://github.com/andersen-lab/ivar/tree/master/pipeline_field/}{\tt Link to pipeline} +\href{https://github.com/andersen-lab/ivar/tree/master/pipeline_field/}{\texttt{ Link to pipeline}} -\paragraph*{Dependencies\+:} +\doxysubsubsection*{Dependencies\+:} \begin{DoxyItemize} -\item \href{https://github.com/andersen-lab/ivar}{\tt i\+Var} -\item \href{https://htslib.org/}{\tt samtools} -\item \href{https://github.com/lh3/bwa}{\tt bwa} -\item \href{https://bedtools.readthedocs.io/en/latest/}{\tt bedtools} +\item \href{https://github.com/andersen-lab/ivar}{\texttt{ i\+Var}} +\item \href{https://htslib.org/}{\texttt{ samtools}} +\item \href{https://github.com/lh3/bwa}{\texttt{ bwa}} +\item \href{https://bedtools.readthedocs.io/en/latest/}{\texttt{ bedtools}} \end{DoxyItemize} \ No newline at end of file diff --git a/docs/latex/doxygen.sty b/docs/latex/doxygen.sty index e457acc1..4bfc17fa 100644 --- a/docs/latex/doxygen.sty +++ b/docs/latex/doxygen.sty @@ -3,16 +3,26 @@ % Packages used by this style file \RequirePackage{alltt} -\RequirePackage{array} +%%\RequirePackage{array} %% moved to refman.tex due to workaround for LaTex 2019 version and unmaintained tabu package \RequirePackage{calc} \RequirePackage{float} -\RequirePackage{ifthen} +%%\RequirePackage{ifthen} %% moved to refman.tex due to workaround for LaTex 2019 version and unmaintained tabu package \RequirePackage{verbatim} \RequirePackage[table]{xcolor} -\RequirePackage{longtable} -\RequirePackage{tabu} +\RequirePackage{longtable_doxygen} +\RequirePackage{tabu_doxygen} +\RequirePackage{fancyvrb} \RequirePackage{tabularx} +\RequirePackage{multicol} \RequirePackage{multirow} +\RequirePackage{hanging} +\RequirePackage{ifpdf} +\RequirePackage{adjustbox} +\RequirePackage{amssymb} +\RequirePackage{stackengine} +\RequirePackage{enumitem} +\RequirePackage{alphalph} +\RequirePackage[normalem]{ulem} % for strikeout, but don't modify emphasis %---------- Internal commands used in this style file ---------------- @@ -28,6 +38,16 @@ \endgroup% } +\newcommand{\DoxyHorRuler}[1]{% + \setlength{\parskip}{0ex plus 0ex minus 0ex}% + \ifthenelse{#1=0}% + {% + \hrule% + }% + {% + \hrulefilll% + }% +} \newcommand{\DoxyLabelFont}{} \newcommand{\entrylabel}[1]{% {% @@ -42,7 +62,7 @@ \ensurespace{4\baselineskip}% \begin{list}{}{% \settowidth{\labelwidth}{20pt}% - \setlength{\parsep}{0pt}% + %\setlength{\parsep}{0pt}% \setlength{\itemsep}{0pt}% \setlength{\leftmargin}{\labelwidth+\labelsep}% \renewcommand{\makelabel}{\entrylabel}% @@ -77,26 +97,68 @@ \end{alltt}% \normalsize% } +% Necessary for redefining not defined characters, i.e. "Replacement Character" in tex output. +\newlength{\CodeWidthChar} +\newlength{\CodeHeightChar} +\settowidth{\CodeWidthChar}{?} +\settoheight{\CodeHeightChar}{?} +% Necessary for hanging indent +\newlength{\DoxyCodeWidth} + +\newcommand\DoxyCodeLine[1]{ + \ifthenelse{\equal{\detokenize{#1}}{}} + { + \vspace*{\baselineskip} + } + { + \hangpara{\DoxyCodeWidth}{1}{#1}\par + } +} + +\newcommand\NiceSpace{% + \discretionary{}{\kern\fontdimen2\font}{\kern\fontdimen2\font}% +} % Used by @code ... @endcode -\newenvironment{DoxyCode}{% +\newenvironment{DoxyCode}[1]{% \par% \scriptsize% - \begin{alltt}% + \normalfont\ttfamily% + \rightskip0pt plus 1fil% + \settowidth{\DoxyCodeWidth}{000000}% + \settowidth{\CodeWidthChar}{?}% + \settoheight{\CodeHeightChar}{?}% + \setlength{\parskip}{0ex plus 0ex minus 0ex}% + \ifthenelse{\equal{#1}{0}} + { + {\lccode`~32 \lowercase{\global\let~}\NiceSpace}\obeyspaces% + } + { + {\lccode`~32 \lowercase{\global\let~}}\obeyspaces% + } + }{% - \end{alltt}% + \normalfont% \normalsize% + \settowidth{\CodeWidthChar}{?}% + \settoheight{\CodeHeightChar}{?}% } +% Redefining not defined characters, i.e. "Replacement Character" in tex output. +\def\ucr{\adjustbox{width=\CodeWidthChar,height=\CodeHeightChar}{\stackinset{c}{}{c}{-.2pt}{% + \textcolor{white}{\sffamily\bfseries\small ?}}{% + \rotatebox{45}{$\blacksquare$}}}} + % Used by @example, @include, @includelineno and @dontinclude -\newenvironment{DoxyCodeInclude}{% - \DoxyCode% +\newenvironment{DoxyCodeInclude}[1]{% + \DoxyCode{#1}% }{% \endDoxyCode% } % Used by @verbatim ... @endverbatim \newenvironment{DoxyVerb}{% + \par% \footnotesize% \verbatim% }{% @@ -112,18 +174,30 @@ } % Used by numbered lists (using '-#' or
        ...
      ) -\newenvironment{DoxyEnumerate}{% - \enumerate% -}{% - \endenumerate% -} +\setlistdepth{12} +\newlist{DoxyEnumerate}{enumerate}{12} +\setlist[DoxyEnumerate,1]{label=\arabic*.} +\setlist[DoxyEnumerate,2]{label=(\enumalphalphcnt*)} +\setlist[DoxyEnumerate,3]{label=\roman*.} +\setlist[DoxyEnumerate,4]{label=\enumAlphAlphcnt*.} +\setlist[DoxyEnumerate,5]{label=\arabic*.} +\setlist[DoxyEnumerate,6]{label=(\enumalphalphcnt*)} +\setlist[DoxyEnumerate,7]{label=\roman*.} +\setlist[DoxyEnumerate,8]{label=\enumAlphAlphcnt*.} +\setlist[DoxyEnumerate,9]{label=\arabic*.} +\setlist[DoxyEnumerate,10]{label=(\enumalphalphcnt*)} +\setlist[DoxyEnumerate,11]{label=\roman*.} +\setlist[DoxyEnumerate,12]{label=\enumAlphAlphcnt*.} % Used by bullet lists (using '-', @li, @arg, or
        ...
      ) -\newenvironment{DoxyItemize}{% - \itemize% -}{% - \enditemize% -} +\setlistdepth{12} +\newlist{DoxyItemize}{itemize}{12} +\setlist[DoxyItemize]{label=\textperiodcentered} + +\setlist[DoxyItemize,1]{label=\textbullet} +\setlist[DoxyItemize,2]{label=\normalfont\bfseries \textendash} +\setlist[DoxyItemize,3]{label=\textasteriskcentered} +\setlist[DoxyItemize,4]{label=\textperiodcentered} % Used by description lists (using
      ...
      ) \newenvironment{DoxyDescription}{% @@ -136,9 +210,8 @@ % (only if caption is specified) \newenvironment{DoxyImage}{% \begin{figure}[H]% - \begin{center}% + \centering% }{% - \end{center}% \end{figure}% } @@ -150,6 +223,12 @@ \end{center}% } +% Used by @image +% (only if inline is specified) +\newenvironment{DoxyInlineImage}{% +}{% +} + % Used by @attention \newenvironment{DoxyAttention}[1]{% \begin{DoxyDesc}{#1}% @@ -248,24 +327,11 @@ \end{DoxyDesc}% } -% Used by @internal -\newenvironment{DoxyInternal}[1]{% - \paragraph*{#1}% -}{% -} - % Used by @par and @paragraph \newenvironment{DoxyParagraph}[1]{% - \begin{list}{}{% - \settowidth{\labelwidth}{40pt}% - \setlength{\leftmargin}{\labelwidth}% - \setlength{\parsep}{0pt}% - \setlength{\itemsep}{-4pt}% - \renewcommand{\makelabel}{\entrylabel}% - }% - \item[#1]% + \begin{DoxyDesc}{#1}% }{% - \end{list}% + \end{DoxyDesc}% } % Used by parameter lists @@ -273,10 +339,10 @@ \tabulinesep=1mm% \par% \ifthenelse{\equal{#1}{}}% - {\begin{longtabu} spread 0pt [l]{|X[-1,l]|X[-1,l]|}}% name + description + {\begin{longtabu*}spread 0pt [l]{|X[-1,l]|X[-1,l]|}}% name + description {\ifthenelse{\equal{#1}{1}}% - {\begin{longtabu} spread 0pt [l]{|X[-1,l]|X[-1,l]|X[-1,l]|}}% in/out + name + desc - {\begin{longtabu} spread 0pt [l]{|X[-1,l]|X[-1,l]|X[-1,l]|X[-1,l]|}}% in/out + type + name + desc + {\begin{longtabu*}spread 0pt [l]{|X[-1,l]|X[-1,l]|X[-1,l]|}}% in/out + name + desc + {\begin{longtabu*}spread 0pt [l]{|X[-1,l]|X[-1,l]|X[-1,l]|X[-1,l]|}}% in/out + type + name + desc } \multicolumn{2}{l}{\hspace{-6pt}\bfseries\fontseries{bc}\selectfont\color{darkgray} #2}\\[1ex]% \hline% @@ -285,7 +351,7 @@ \hline% \endhead% }{% - \end{longtabu}% + \end{longtabu*}% \vspace{6pt}% } @@ -293,7 +359,7 @@ \newenvironment{DoxyFields}[1]{% \tabulinesep=1mm% \par% - \begin{longtabu} spread 0pt [l]{|X[-1,r]|X[-1,l]|X[-1,l]|}% + \begin{longtabu*}spread 0pt [l]{|X[-1,r]|X[-1,l]|X[-1,l]|}% \multicolumn{3}{l}{\hspace{-6pt}\bfseries\fontseries{bc}\selectfont\color{darkgray} #1}\\[1ex]% \hline% \endfirsthead% @@ -301,7 +367,7 @@ \hline% \endhead% }{% - \end{longtabu}% + \end{longtabu*}% \vspace{6pt}% } @@ -309,7 +375,7 @@ \newenvironment{DoxyEnumFields}[1]{% \tabulinesep=1mm% \par% - \begin{longtabu} spread 0pt [l]{|X[-1,r]|X[-1,l]|}% + \begin{longtabu*}spread 0pt [l]{|X[-1,r]|X[-1,l]|}% \multicolumn{2}{l}{\hspace{-6pt}\bfseries\fontseries{bc}\selectfont\color{darkgray} #1}\\[1ex]% \hline% \endfirsthead% @@ -317,7 +383,7 @@ \hline% \endhead% }{% - \end{longtabu}% + \end{longtabu*}% \vspace{6pt}% } @@ -331,7 +397,7 @@ \newenvironment{DoxyRetVals}[1]{% \tabulinesep=1mm% \par% - \begin{longtabu} spread 0pt [l]{|X[-1,r]|X[-1,l]|}% + \begin{longtabu*}spread 0pt [l]{|X[-1,r]|X[-1,l]|}% \multicolumn{2}{l}{\hspace{-6pt}\bfseries\fontseries{bc}\selectfont\color{darkgray} #1}\\[1ex]% \hline% \endfirsthead% @@ -339,7 +405,7 @@ \hline% \endhead% }{% - \end{longtabu}% + \end{longtabu*}% \vspace{6pt}% } @@ -347,7 +413,7 @@ \newenvironment{DoxyExceptions}[1]{% \tabulinesep=1mm% \par% - \begin{longtabu} spread 0pt [l]{|X[-1,r]|X[-1,l]|}% + \begin{longtabu*}spread 0pt [l]{|X[-1,r]|X[-1,l]|}% \multicolumn{2}{l}{\hspace{-6pt}\bfseries\fontseries{bc}\selectfont\color{darkgray} #1}\\[1ex]% \hline% \endfirsthead% @@ -355,7 +421,7 @@ \hline% \endhead% }{% - \end{longtabu}% + \end{longtabu*}% \vspace{6pt}% } @@ -363,7 +429,7 @@ \newenvironment{DoxyTemplParams}[1]{% \tabulinesep=1mm% \par% - \begin{longtabu} spread 0pt [l]{|X[-1,r]|X[-1,l]|}% + \begin{longtabu*}spread 0pt [l]{|X[-1,r]|X[-1,l]|}% \multicolumn{2}{l}{\hspace{-6pt}\bfseries\fontseries{bc}\selectfont\color{darkgray} #1}\\[1ex]% \hline% \endfirsthead% @@ -371,7 +437,7 @@ \hline% \endhead% }{% - \end{longtabu}% + \end{longtabu*}% \vspace{6pt}% } @@ -439,11 +505,11 @@ \newcommand{\PBS}[1]{\let\temp=\\#1\let\\=\temp}% \newenvironment{TabularC}[1]% {\tabulinesep=1mm -\begin{longtabu} spread 0pt [c]{*#1{|X[-1]}|}}% -{\end{longtabu}\par}% +\begin{longtabu*}spread 0pt [c]{*#1{|X[-1]}|}}% +{\end{longtabu*}\par}% \newenvironment{TabularNC}[1]% -{\begin{tabu} spread 0pt [l]{*#1{|X[-1]}|}}% +{\begin{tabu}spread 0pt [l]{*#1{|X[-1]}|}}% {\end{tabu}\par}% % Used for member group headers @@ -457,11 +523,29 @@ \end{list}% } +% Used when hyperlinks are turned on +\newcommand{\doxylink}[2]{% + \mbox{\hyperlink{#1}{#2}}% +} + +% Used when hyperlinks are turned on +% Third argument is the SectionType, see the doxygen internal +% documentation for the values (relevant: Page ... Subsubsection). +\newcommand{\doxysectlink}[3]{% + \mbox{\hyperlink{#1}{#2}}% +} % Used when hyperlinks are turned off \newcommand{\doxyref}[3]{% \textbf{#1} (\textnormal{#2}\,\pageref{#3})% } +% Used when hyperlinks are turned off +% Fourth argument is the SectionType, see the doxygen internal +% documentation for the values (relevant: Page ... Subsubsection). +\newcommand{\doxysectref}[4]{% + \textbf{#1} (\textnormal{#2}\,\pageref{#3})% +} + % Used to link to a table when hyperlinks are turned on \newcommand{\doxytablelink}[2]{% \ref{#1}% @@ -484,6 +568,7 @@ \definecolor{preprocessor}{rgb}{0.5,0.38,0.125} \definecolor{stringliteral}{rgb}{0.0,0.125,0.25} \definecolor{charliteral}{rgb}{0.0,0.5,0.5} +\definecolor{xmlcdata}{rgb}{0.0,0.0,0.0} \definecolor{vhdldigit}{rgb}{1.0,0.0,1.0} \definecolor{vhdlkeyword}{rgb}{0.43,0.0,0.43} \definecolor{vhdllogic}{rgb}{1.0,0.0,0.0} @@ -495,9 +580,115 @@ % Version of hypertarget with correct landing location \newcommand{\Hypertarget}[1]{\Hy@raisedlink{\hypertarget{#1}{}}} +% possibility to have sections etc. be within the margins +% unfortunately had to copy part of book.cls and add \raggedright +\makeatletter +\newcounter{subsubsubsection}[subsubsection] +\newcounter{subsubsubsubsection}[subsubsubsection] +\newcounter{subsubsubsubsubsection}[subsubsubsubsection] +\newcounter{subsubsubsubsubsubsection}[subsubsubsubsubsection] +\renewcommand{\thesubsubsubsection}{\thesubsubsection.\arabic{subsubsubsection}} +\renewcommand{\thesubsubsubsubsection}{\thesubsubsubsection.\arabic{subsubsubsubsection}} +\renewcommand{\thesubsubsubsubsubsection}{\thesubsubsubsubsection.\arabic{subsubsubsubsubsection}} +\renewcommand{\thesubsubsubsubsubsubsection}{\thesubsubsubsubsubsection.\arabic{subsubsubsubsubsubsection}} +\newcommand{\subsubsubsectionmark}[1]{} +\newcommand{\subsubsubsubsectionmark}[1]{} +\newcommand{\subsubsubsubsubsectionmark}[1]{} +\newcommand{\subsubsubsubsubsubsectionmark}[1]{} +\def\toclevel@subsubsubsection{4} +\def\toclevel@subsubsubsubsection{5} +\def\toclevel@subsubsubsubsubsection{6} +\def\toclevel@subsubsubsubsubsubsection{7} +\def\toclevel@paragraph{8} +\def\toclevel@subparagraph{9} + +\newcommand\doxysection{\@startsection {section}{1}{\z@}% + {-3.5ex \@plus -1ex \@minus -.2ex}% + {2.3ex \@plus.2ex}% + {\raggedright\normalfont\Large\bfseries}} +\newcommand\doxysubsection{\@startsection{subsection}{2}{\z@}% + {-3.25ex\@plus -1ex \@minus -.2ex}% + {1.5ex \@plus .2ex}% + {\raggedright\normalfont\large\bfseries}} +\newcommand\doxysubsubsection{\@startsection{subsubsection}{3}{\z@}% + {-3.25ex\@plus -1ex \@minus -.2ex}% + {1.5ex \@plus .2ex}% + {\raggedright\normalfont\normalsize\bfseries}} +\newcommand\doxysubsubsubsection{\@startsection{subsubsubsection}{4}{\z@}% + {-3.25ex\@plus -1ex \@minus -.2ex}% + {1.5ex \@plus .2ex}% + {\raggedright\normalfont\normalsize\bfseries}} +\newcommand\doxysubsubsubsubsection{\@startsection{subsubsubsubsection}{5}{\z@}% + {-3.25ex\@plus -1ex \@minus -.2ex}% + {1.5ex \@plus .2ex}% + {\raggedright\normalfont\normalsize\bfseries}} +\newcommand\doxysubsubsubsubsubsection{\@startsection{subsubsubsubsubsection}{6}{\z@}% + {-3.25ex\@plus -1ex \@minus -.2ex}% + {1.5ex \@plus .2ex}% + {\raggedright\normalfont\normalsize\bfseries}} +\newcommand\doxysubsubsubsubsubsubsection{\@startsection{subsubsubsubsubsubsection}{7}{\z@}% + {-3.25ex\@plus -1ex \@minus -.2ex}% + {1.5ex \@plus .2ex}% + {\raggedright\normalfont\normalsize\bfseries}} +\newcommand\doxyparagraph{\@startsection{paragraph}{8}{\z@}% + {-3.25ex\@plus -1ex \@minus -.2ex}% + {1.5ex \@plus .2ex}% + {\raggedright\normalfont\normalsize\bfseries}} +\newcommand\doxysubparagraph{\@startsection{subparagraph}{9}{\parindent}% + {-3.25ex\@plus -1ex \@minus -.2ex}% + {1.5ex \@plus .2ex}% + {\raggedright\normalfont\normalsize\bfseries}} + +\newcommand\l@subsubsubsection{\@dottedtocline{4}{6.1em}{7.8em}} +\newcommand\l@subsubsubsubsection{\@dottedtocline{5}{6.1em}{9.4em}} +\newcommand\l@subsubsubsubsubsection{\@dottedtocline{6}{6.1em}{11em}} +\newcommand\l@subsubsubsubsubsubsection{\@dottedtocline{7}{6.1em}{12.6em}} +\renewcommand\l@paragraph{\@dottedtocline{8}{6.1em}{14.2em}} +\renewcommand\l@subparagraph{\@dottedtocline{9}{6.1em}{15.8em}} +\makeatother +% the sectsty doesn't look to be maintained but gives, in our case, some warning like: +% LaTeX Warning: Command \underline has changed. +% Check if current package is valid. +% unfortunately had to copy the relevant part +\newcommand*{\doxypartfont} [1] + {\gdef\SS@partnumberfont{\SS@sectid{0}\SS@nopart\SS@makeulinepartchap#1} + \gdef\SS@parttitlefont{\SS@sectid{0}\SS@titlepart\SS@makeulinepartchap#1}} +\newcommand*{\doxychapterfont} [1] + {\gdef\SS@chapnumfont{\SS@sectid{1}\SS@nopart\SS@makeulinepartchap#1} + \gdef\SS@chaptitlefont{\SS@sectid{1}\SS@titlepart\SS@makeulinepartchap#1}} +\newcommand*{\doxysectionfont} [1] + {\gdef\SS@sectfont{\SS@sectid{2}\SS@rr\SS@makeulinesect#1}} +\newcommand*{\doxysubsectionfont} [1] + {\gdef\SS@subsectfont{\SS@sectid{3}\SS@rr\SS@makeulinesect#1}} +\newcommand*{\doxysubsubsectionfont} [1] + {\gdef\SS@subsubsectfont{\SS@sectid{4}\SS@rr\SS@makeulinesect#1}} +\newcommand*{\doxyparagraphfont} [1] + {\gdef\SS@parafont{\SS@sectid{5}\SS@rr\SS@makeulinesect#1}} +\newcommand*{\doxysubparagraphfont} [1] + {\gdef\SS@subparafont{\SS@sectid{6}\SS@rr\SS@makeulinesect#1}} +\newcommand*{\doxyminisecfont} [1] + {\gdef\SS@minisecfont{\SS@sectid{7}\SS@rr\SS@makeulinepartchap#1}} +\newcommand*{\doxyallsectionsfont} [1] {\doxypartfont{#1}% + \doxychapterfont{#1}% + \doxysectionfont{#1}% + \doxysubsectionfont{#1}% + \doxysubsubsectionfont{#1}% + \doxyparagraphfont{#1}% + \doxysubparagraphfont{#1}% + \doxyminisecfont{#1}}% % Define caption that is also suitable in a table \makeatletter \def\doxyfigcaption{% -\refstepcounter{figure}% +\H@refstepcounter{figure}% \@dblarg{\@caption{figure}}} \makeatother + +% Define alpha enumarative names for counters > 26 +\makeatletter +\def\enumalphalphcnt#1{\expandafter\@enumalphalphcnt\csname c@#1\endcsname} +\def\@enumalphalphcnt#1{\alphalph{#1}} +\def\enumAlphAlphcnt#1{\expandafter\@enumAlphAlphcnt\csname c@#1\endcsname} +\def\@enumAlphAlphcnt#1{\AlphAlph{#1}} +\makeatother +\AddEnumerateCounter{\enumalphalphcnt}{\@enumalphalphcnt}{aa} +\AddEnumerateCounter{\enumAlphAlphcnt}{\@enumAlphAlphcnt}{AA} diff --git a/docs/latex/index.tex b/docs/latex/index.tex index 0e89c718..6b906090 100644 --- a/docs/latex/index.tex +++ b/docs/latex/index.tex @@ -1,13 +1,19 @@ +\chapter{Documentation} +\hypertarget{index}{}\label{index}\index{Documentation@{Documentation}} +\label{index_mainpage}% +\Hypertarget{index_mainpage}% + + \begin{DoxyItemize} -\item \mbox{\hyperlink{installpage}{Installation}} -\item \mbox{\hyperlink{manualpage}{Manual}} -\item \mbox{\hyperlink{cookbookpage}{Cookbook}} -\end{DoxyItemize}\hypertarget{index_autotoc_md23}{}\section{Publication}\label{index_autotoc_md23} -\href{https://doi.org/10.1186/s13059-018-1618-7}{\tt An amplicon-\/based sequencing framework for accurately measuring intrahost virus diversity using Primal\+Seq and i\+Var} +\item \doxysectlink{installpage}{Installation}{0} +\item \doxysectlink{manualpage}{Manual}{0} +\item \doxysectlink{cookbookpage}{Cookbook}{0} +\end{DoxyItemize}\hypertarget{index_autotoc_md23}{}\doxysection{\texorpdfstring{Publication}{Publication}}\label{index_autotoc_md23} +\href{https://doi.org/10.1186/s13059-018-1618-7}{\texttt{ An amplicon-\/based sequencing framework for accurately measuring intrahost virus diversity using Primal\+Seq and i\+Var}} -{\itshape Genome Biology} 2019 {\bfseries 20}\+:8 +{\itshape Genome Biology} 2019 {\bfseries{20}}\+:8 Nathan D Grubaugh, Karthik Gangavarapu, Joshua Quick, Nathaniel L Matteson, Jaqueline Goes De Jesus, Bradley J Main, Amanda L Tan, Lauren M Paul, Doug E Brackney, Saran Grewal, Nikos Gurfield, Koen KA Van Rompay, Sharon Isern, Scott F Michael, Lark L Coffey, Nicholas J Loman, Kristian G Andersen -bio\+Rxiv doi\+: \href{https://doi.org/10.1101/383513}{\tt https\+://doi.\+org/10.\+1101/383513} \ No newline at end of file +bio\+Rxiv doi\+: \href{https://doi.org/10.1101/383513}{\texttt{ https\+://doi.\+org/10.\+1101/383513}} \ No newline at end of file diff --git a/docs/latex/installpage.tex b/docs/latex/installpage.tex index d6160898..b678cd37 100644 --- a/docs/latex/installpage.tex +++ b/docs/latex/installpage.tex @@ -1,232 +1,261 @@ -\subsubsection*{Dependencies} +\chapter{Installation} +\hypertarget{installpage}{}\label{installpage}\index{Installation@{Installation}} +\label{installpage_md_docs_2_i_n_s_t_a_l_l_a_t_i_o_n}% +\Hypertarget{installpage_md_docs_2_i_n_s_t_a_l_l_a_t_i_o_n}% + + +\doxysubsection*{Dependencies} \begin{DoxyItemize} -\item \href{http://www.htslib.org/download/}{\tt H\+T\+Slib} -\item \href{https://gcc.gnu.org/}{\tt G\+CC} any version after v5.\+0. Support for c++11 standard required. +\item \href{http://www.htslib.org/download/}{\texttt{ HTSlib}} +\item \href{https://gcc.gnu.org/}{\texttt{ GCC}} any version after v5.\+0. Support for c++11 standard required. \end{DoxyItemize} Note\+: \begin{DoxyItemize} -\item It is highly recommended that \href{https://github.com/samtools/samtools}{\tt samtools} also be installed alongside i\+Var. i\+Var uses the output of samtools mpileup to call variants and generate consensus sequences. In addition, samtools {\ttfamily sort} and {\ttfamily index} commands are very useful to setup a pipeline using i\+Var. -\end{DoxyItemize}\hypertarget{installpage_autotoc_md0}{}\section{Installing via conda}\label{installpage_autotoc_md0} -i\+Var is available on bioconda. To install conda, please use the \href{https://conda.io/miniconda.html}{\tt miniconda} package. After intalling conda please add the following channels, +\item It is highly recommended that \href{https://github.com/samtools/samtools}{\texttt{ samtools}} also be installed alongside i\+Var. i\+Var uses the output of samtools mpileup to call variants and generate consensus sequences. In addition, samtools {\ttfamily sort} and {\ttfamily index} commands are very useful to setup a pipeline using i\+Var. +\end{DoxyItemize}\hypertarget{installpage_autotoc_md0}{}\doxysection{\texorpdfstring{Installing via conda}{Installing via conda}}\label{installpage_autotoc_md0} +i\+Var is available on bioconda. To install conda, please use the \href{https://conda.io/miniconda.html}{\texttt{ miniconda}} package. After intalling conda please add the following channels, + +\begin{DoxyCode}{0} +\DoxyCodeLine{conda\ config\ -\/-\/add\ channels\ defaults} +\DoxyCodeLine{conda\ config\ -\/-\/add\ channels\ bioconda} +\DoxyCodeLine{conda\ config\ -\/-\/add\ channels\ conda-\/forge} -\begin{DoxyCode} -conda config --add channels defaults -conda config --add channels bioconda -conda config --add channels conda-forge \end{DoxyCode} To install i\+Var, -\begin{DoxyCode} -conda install ivar +\begin{DoxyCode}{0} +\DoxyCodeLine{conda\ install\ ivar} + \end{DoxyCode} -\hypertarget{installpage_autotoc_md1}{}\subsection{Installing via homebrew}\label{installpage_autotoc_md1} -i\+Var can be installed using \href{https://brew.sh/}{\tt Homebrew}. +\hypertarget{installpage_autotoc_md1}{}\doxysubsection{\texorpdfstring{Installing via homebrew}{Installing via homebrew}}\label{installpage_autotoc_md1} +i\+Var can be installed using \href{https://brew.sh/}{\texttt{ Homebrew}}. + +\begin{DoxyCode}{0} +\DoxyCodeLine{brew\ install\ brewsci/bio/ivar} -\begin{DoxyCode} -brew install brewsci/bio/ivar \end{DoxyCode} -\hypertarget{installpage_autotoc_md2}{}\section{Installing on Mac}\label{installpage_autotoc_md2} -\hypertarget{installpage_autotoc_md3}{}\subsection{Installing build tools}\label{installpage_autotoc_md3} -\href{https://developer.apple.com/xcode/}{\tt Xcode} from Apple is required to compile i\+Var (and other tools) from source. If you don\textquotesingle{}t want to install the full Xcode package from the App\+Store, you can install the Xcode command line tools, +\hypertarget{installpage_autotoc_md2}{}\doxysection{\texorpdfstring{Installing on Mac}{Installing on Mac}}\label{installpage_autotoc_md2} +\hypertarget{installpage_autotoc_md3}{}\doxysubsection{\texorpdfstring{Installing build tools}{Installing build tools}}\label{installpage_autotoc_md3} +\href{https://developer.apple.com/xcode/}{\texttt{ Xcode}} from Apple is required to compile i\+Var (and other tools) from source. If you don\textquotesingle{}t want to install the full Xcode package from the App\+Store, you can install the Xcode command line tools, + +\begin{DoxyCode}{0} +\DoxyCodeLine{xcode-\/select\ -\/-\/install} -\begin{DoxyCode} -xcode-select --install \end{DoxyCode} -\href{https://www.gnu.org/software/automake/manual/html_node/Autotools-Introduction.html#Autotools-Introduction}{\tt G\+NU Autotools} is required to compile i\+Var from source. +\href{https://www.gnu.org/software/automake/manual/html_node/Autotools-Introduction.html\#Autotools-Introduction}{\texttt{ GNU Autotools}} is required to compile i\+Var from source. -To install Autotools using \href{https://brew.sh/}{\tt homebrew} please use the command below, +To install Autotools using \href{https://brew.sh/}{\texttt{ homebrew}} please use the command below, -\begin{DoxyCode} -brew install autoconf automake libtool +\begin{DoxyCode}{0} +\DoxyCodeLine{brew\ install\ autoconf\ automake\ libtool} + \end{DoxyCode} -\hypertarget{installpage_autotoc_md4}{}\subsection{H\+T\+Slib installed using conda}\label{installpage_autotoc_md4} -H\+T\+Slib can be installed with \href{https://conda.io/docs/}{\tt conda} using the command, +\hypertarget{installpage_autotoc_md4}{}\doxysubsection{\texorpdfstring{HTSlib installed using conda}{HTSlib installed using conda}}\label{installpage_autotoc_md4} +HTSlib can be installed with \href{https://conda.io/docs/}{\texttt{ conda}} using the command, + +\begin{DoxyCode}{0} +\DoxyCodeLine{conda\ install\ -\/c\ bioconda\ htslib} -\begin{DoxyCode} -conda install -c bioconda htslib \end{DoxyCode} The conda binary is by default installed at /opt/. You can check the installation location by running the following command, -\begin{DoxyCode} -which conda +\begin{DoxyCode}{0} +\DoxyCodeLine{which\ conda} + \end{DoxyCode} The output of the command will be in this format -\/ /opt/conda/bin/conda or /opt/anaconda2/bin/conda or /opt/anaconda3/bin/conda depending on whether you installed miniconda or anaconda. -If the output is for example, /opt/conda/bin/conda, then you can add the path to the lib folder to \$\+L\+D\+\_\+\+L\+I\+B\+R\+A\+R\+Y\+\_\+\+P\+A\+TH using the command below. You can add this to your $\sim$/.bash\+\_\+profile or $\sim$/.bashrc to avoid rerunning the command everytime a new bash session starts. +If the output is for example, /opt/conda/bin/conda, then you can add the path to the lib folder to \$\+LD\+\_\+\+LIBRARY\+\_\+\+PATH using the command below. You can add this to your \texorpdfstring{$\sim$}{\string~}/.bash\+\_\+profile or \texorpdfstring{$\sim$}{\string~}/.bashrc to avoid rerunning the command everytime a new bash session starts. -\begin{DoxyCode} -export LD\_LIBRARY\_PATH=$LD\_LIBRARY\_PATH:/opt/conda/lib +\begin{DoxyCode}{0} +\DoxyCodeLine{export\ LD\_LIBRARY\_PATH=\$LD\_LIBRARY\_PATH:/opt/conda/lib} + \end{DoxyCode} -\hypertarget{installpage_autotoc_md5}{}\subsection{H\+T\+Slib installed from source}\label{installpage_autotoc_md5} -Installation instructions and downloads for H\+T\+Slib can be found at \href{http://www.htslib.org/download/}{\tt http\+://www.\+htslib.\+org/download/}. +\hypertarget{installpage_autotoc_md5}{}\doxysubsection{\texorpdfstring{HTSlib installed from source}{HTSlib installed from source}}\label{installpage_autotoc_md5} +Installation instructions and downloads for HTSlib can be found at \href{http://www.htslib.org/download/}{\texttt{ http\+://www.\+htslib.\+org/download/}}. + +If HTSlib is installed in a non standard location, please add the following to your .bash\+\_\+profile so that i\+Var can find HTSlib dynamic libraries during runtime. -If H\+T\+Slib is installed in a non standard location, please add the following to your .bash\+\_\+profile so that i\+Var can find H\+T\+Slib dynamic libraries during runtime. +\begin{DoxyCode}{0} +\DoxyCodeLine{export\ LD\_LIBRARY\_PATH=\$LD\_LIBRARY\_PATH:/path/to/hts/lib/folder} -\begin{DoxyCode} -export LD\_LIBRARY\_PATH=$LD\_LIBRARY\_PATH:/path/to/hts/lib/folder \end{DoxyCode} -\hypertarget{installpage_autotoc_md6}{}\subsection{Installing i\+Var}\label{installpage_autotoc_md6} +\hypertarget{installpage_autotoc_md6}{}\doxysubsection{\texorpdfstring{Installing i\+Var}{Installing i\+Var}}\label{installpage_autotoc_md6} To install i\+Var, run the following commands. -\begin{DoxyCode} -./autogen.sh -./configure -make -make install +\begin{DoxyCode}{0} +\DoxyCodeLine{./autogen.sh} +\DoxyCodeLine{./configure} +\DoxyCodeLine{make} +\DoxyCodeLine{make\ install} + \end{DoxyCode} -If H\+T\+Slib was installed using conda, please run the following commands by supplying the prefix to the bin folder of the conda binary. +If HTSlib was installed using conda, please run the following commands by supplying the prefix to the bin folder of the conda binary. The prefix to the bin folder can be found using the command {\ttfamily which conda}. The output of the command will be in this format -\/ /opt/conda/bin/conda or /opt/anaconda2/bin/conda or /opt/anaconda3/bin/conda depending on whether you installed miniconda or anaconda. For example, if the output of the command is /opt/conda/bin/conda, the prefix to the htslib bin folder will be /opt/conda. This can be supplied to ./configure --with-\/hts=/opt/conda. -\begin{DoxyCode} -./autogen.sh -./configure --with-hts=/prefix/to/bin/folder/with/HTSlib -make -make install +\begin{DoxyCode}{0} +\DoxyCodeLine{./autogen.sh} +\DoxyCodeLine{./configure\ -\/-\/with-\/hts=/prefix/to/bin/folder/with/HTSlib} +\DoxyCodeLine{make} +\DoxyCodeLine{make\ install} + \end{DoxyCode} -If H\+T\+Slib was installed in a non standard location, please run the following commands, +If HTSlib was installed in a non standard location, please run the following commands, + +\begin{DoxyCode}{0} +\DoxyCodeLine{./autogen.sh} +\DoxyCodeLine{./configure\ -\/-\/with-\/hts=/prefix/to/bin/folder/with/HTSlib} +\DoxyCodeLine{make} +\DoxyCodeLine{make\ install} -\begin{DoxyCode} -./autogen.sh -./configure --with-hts=/prefix/to/bin/folder/with/HTSlib -make -make install \end{DoxyCode} To test installation just run, {\ttfamily ivar version} and you should get the following output, -\begin{DoxyCode} -iVar version 1.0 +\begin{DoxyCode}{0} +\DoxyCodeLine{iVar\ version\ 1.0} +\DoxyCodeLine{} +\DoxyCodeLine{Please\ raise\ issues\ and\ bug\ reports\ at\ https://github.com/andersen-\/lab/ivar/} -Please raise issues and bug reports at https://github.com/andersen-lab/ivar/ \end{DoxyCode} -\hypertarget{installpage_autotoc_md7}{}\section{Installing on Linux}\label{installpage_autotoc_md7} -\hypertarget{installpage_autotoc_md8}{}\subsection{Installing build tools}\label{installpage_autotoc_md8} -\href{https://www.gnu.org/software/automake/manual/html_node/Autotools-Introduction.html#Autotools-Introduction}{\tt G\+NU Autotools} is required to compile i\+Var from source. +\hypertarget{installpage_autotoc_md7}{}\doxysection{\texorpdfstring{Installing on Linux}{Installing on Linux}}\label{installpage_autotoc_md7} +\hypertarget{installpage_autotoc_md8}{}\doxysubsection{\texorpdfstring{Installing build tools}{Installing build tools}}\label{installpage_autotoc_md8} +\href{https://www.gnu.org/software/automake/manual/html_node/Autotools-Introduction.html\#Autotools-Introduction}{\texttt{ GNU Autotools}} is required to compile i\+Var from source. + +To install Autotools using \href{https://help.ubuntu.com/lts/serverguide/apt.html}{\texttt{ APT}} please use the command below, -To install Autotools using \href{https://help.ubuntu.com/lts/serverguide/apt.html}{\tt A\+PT} please use the command below, +\begin{DoxyCode}{0} +\DoxyCodeLine{apt-\/get\ install\ autotools-\/dev} -\begin{DoxyCode} -apt-get install autotools-dev \end{DoxyCode} -\hypertarget{installpage_autotoc_md9}{}\subsection{H\+T\+Slib installed using conda}\label{installpage_autotoc_md9} -H\+T\+Slib can be installed with \href{https://conda.io/docs/}{\tt conda} using the command, +\hypertarget{installpage_autotoc_md9}{}\doxysubsection{\texorpdfstring{HTSlib installed using conda}{HTSlib installed using conda}}\label{installpage_autotoc_md9} +HTSlib can be installed with \href{https://conda.io/docs/}{\texttt{ conda}} using the command, -\begin{DoxyCode} -conda install -c bioconda htslib +\begin{DoxyCode}{0} +\DoxyCodeLine{conda\ install\ -\/c\ bioconda\ htslib} + \end{DoxyCode} The conda binary is by default installed at /opt/. You can check the installation location by running the following command, -\begin{DoxyCode} -which conda +\begin{DoxyCode}{0} +\DoxyCodeLine{which\ conda} + \end{DoxyCode} The output of the command will be in this format -\/ /opt/conda/bin/conda or /opt/anaconda2/bin/conda or /opt/anaconda3/bin/conda depending on whether you installed miniconda or anaconda. -If the output is for example, /opt/conda/bin/conda, then you can add the path to the lib folder to \$\+L\+D\+\_\+\+L\+I\+B\+R\+A\+R\+Y\+\_\+\+P\+A\+TH using the command below. You can add this to your $\sim$/.bash\+\_\+profile or $\sim$/.bashrc to avoid rerunning the command everytime a new bash session starts. +If the output is for example, /opt/conda/bin/conda, then you can add the path to the lib folder to \$\+LD\+\_\+\+LIBRARY\+\_\+\+PATH using the command below. You can add this to your \texorpdfstring{$\sim$}{\string~}/.bash\+\_\+profile or \texorpdfstring{$\sim$}{\string~}/.bashrc to avoid rerunning the command everytime a new bash session starts. + +\begin{DoxyCode}{0} +\DoxyCodeLine{export\ LD\_LIBRARY\_PATH=\$LD\_LIBRARY\_PATH:/opt/conda/lib} -\begin{DoxyCode} -export LD\_LIBRARY\_PATH=$LD\_LIBRARY\_PATH:/opt/conda/lib \end{DoxyCode} -\hypertarget{installpage_autotoc_md10}{}\subsection{H\+T\+Slib installed from source}\label{installpage_autotoc_md10} -Installation instructions and downloads for H\+T\+Slib can be found at \href{http://www.htslib.org/download/}{\tt http\+://www.\+htslib.\+org/download/}. +\hypertarget{installpage_autotoc_md10}{}\doxysubsection{\texorpdfstring{HTSlib installed from source}{HTSlib installed from source}}\label{installpage_autotoc_md10} +Installation instructions and downloads for HTSlib can be found at \href{http://www.htslib.org/download/}{\texttt{ http\+://www.\+htslib.\+org/download/}}. -If H\+T\+Slib is installed in a non standard location, please add the following to your .bash\+\_\+profile so that i\+Var can find H\+T\+Slib dynamic libraries during runtime. +If HTSlib is installed in a non standard location, please add the following to your .bash\+\_\+profile so that i\+Var can find HTSlib dynamic libraries during runtime. -\begin{DoxyCode} -export LD\_LIBRARY\_PATH=$LD\_LIBRARY\_PATH:/path/to/hts/lib/folder +\begin{DoxyCode}{0} +\DoxyCodeLine{export\ LD\_LIBRARY\_PATH=\$LD\_LIBRARY\_PATH:/path/to/hts/lib/folder} + \end{DoxyCode} -\hypertarget{installpage_autotoc_md11}{}\subsection{Installing i\+Var}\label{installpage_autotoc_md11} +\hypertarget{installpage_autotoc_md11}{}\doxysubsection{\texorpdfstring{Installing i\+Var}{Installing i\+Var}}\label{installpage_autotoc_md11} To install i\+Var, run the following commands. -\begin{DoxyCode} -./autogen.sh -./configure -make -make install +\begin{DoxyCode}{0} +\DoxyCodeLine{./autogen.sh} +\DoxyCodeLine{./configure} +\DoxyCodeLine{make} +\DoxyCodeLine{make\ install} + \end{DoxyCode} -If H\+T\+Slib was installed using conda, please run the following commands by supplying the prefix to the bin folder of the conda binary. +If HTSlib was installed using conda, please run the following commands by supplying the prefix to the bin folder of the conda binary. The prefix to the bin folder can be found using the command {\ttfamily which conda}. The output of the command will be in this format -\/ /opt/conda/bin/conda or /opt/anaconda2/bin/conda or /opt/anaconda3/bin/conda depending on whether you installed miniconda or anaconda. For example, if the output of the command is /opt/conda/bin/conda, the prefix to the htslib bin folder will be /opt/conda. This can be supplied to ./configure --with-\/hts=/opt/conda. -\begin{DoxyCode} -./autogen.sh -./configure --with-hts=/prefix/to/bin/folder/with/HTSlib -make -make install +\begin{DoxyCode}{0} +\DoxyCodeLine{./autogen.sh} +\DoxyCodeLine{./configure\ -\/-\/with-\/hts=/prefix/to/bin/folder/with/HTSlib} +\DoxyCodeLine{make} +\DoxyCodeLine{make\ install} + \end{DoxyCode} -If H\+T\+Slib was installed in a non standard location, please run the following commands, +If HTSlib was installed in a non standard location, please run the following commands, -\begin{DoxyCode} -./autogen.sh -./configure --with-hts=/prefix/to/bin/folder/with/HTSlib -make -make install +\begin{DoxyCode}{0} +\DoxyCodeLine{./autogen.sh} +\DoxyCodeLine{./configure\ -\/-\/with-\/hts=/prefix/to/bin/folder/with/HTSlib} +\DoxyCodeLine{make} +\DoxyCodeLine{make\ install} + \end{DoxyCode} To test installation just run, {\ttfamily ivar version} and you should get the following output, -\begin{DoxyCode} -iVar version 1.0 +\begin{DoxyCode}{0} +\DoxyCodeLine{iVar\ version\ 1.0} +\DoxyCodeLine{} +\DoxyCodeLine{Please\ raise\ issues\ and\ bug\ reports\ at\ https://github.com/andersen-\/lab/ivar/} -Please raise issues and bug reports at https://github.com/andersen-lab/ivar/ \end{DoxyCode} -\hypertarget{installpage_autotoc_md12}{}\section{Running from Docker}\label{installpage_autotoc_md12} -i\+Var can also be run via \href{https://www.docker.com/}{\tt Docker}. Pull the docker image from \href{https://hub.docker.com/}{\tt Docker Hub} using the following command, +\hypertarget{installpage_autotoc_md12}{}\doxysection{\texorpdfstring{Running from Docker}{Running from Docker}}\label{installpage_autotoc_md12} +i\+Var can also be run via \href{https://www.docker.com/}{\texttt{ Docker}}. Pull the docker image from \href{https://hub.docker.com/}{\texttt{ Docker Hub}} using the following command, + +\begin{DoxyCode}{0} +\DoxyCodeLine{docker\ pull\ andersenlabapps/ivar} -\begin{DoxyCode} -docker pull andersenlabapps/ivar \end{DoxyCode} -This docker image contains all the required dependencies to run i\+Var and the \mbox{\hyperlink{cookbookpage}{pipelines}} developed using i\+Var. You will have to attach a docker volume to get data into the docker container. Instructions to do so are in the \href{https://docs.docker.com/storage/volumes/}{\tt Docker docs}. +This docker image contains all the required dependencies to run i\+Var and the \doxysectlink{cookbookpage}{pipelines}{0} developed using i\+Var. You will have to attach a docker volume to get data into the docker container. Instructions to do so are in the \href{https://docs.docker.com/storage/volumes/}{\texttt{ Docker docs}}. -\href{https://hub.docker.com/r/andersenlabapps/ivar/}{\tt i\+Var on Docker Hub}\hypertarget{installpage_autotoc_md13}{}\section{Contact}\label{installpage_autotoc_md13} +\href{https://hub.docker.com/r/andersenlabapps/ivar/}{\texttt{ i\+Var on Docker Hub}}\hypertarget{installpage_autotoc_md13}{}\doxysection{\texorpdfstring{Contact}{Contact}}\label{installpage_autotoc_md13} For bug reports please email gkarthik\mbox{[}at\mbox{]}scripps.\+edu or raise an issue on Github. \ No newline at end of file diff --git a/docs/latex/longtable_doxygen.sty b/docs/latex/longtable_doxygen.sty new file mode 100644 index 00000000..e94b78b6 --- /dev/null +++ b/docs/latex/longtable_doxygen.sty @@ -0,0 +1,456 @@ +%% +%% This is file `longtable.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% longtable.dtx (with options: `package') +%% +%% This is a generated file. +%% +%% The source is maintained by the LaTeX Project team and bug +%% reports for it can be opened at http://latex-project.org/bugs.html +%% (but please observe conditions on bug reports sent to that address!) +%% +%% Copyright 1993-2016 +%% The LaTeX3 Project and any individual authors listed elsewhere +%% in this file. +%% +%% This file was generated from file(s) of the Standard LaTeX `Tools Bundle'. +%% -------------------------------------------------------------------------- +%% +%% It may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3c +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3c or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. +%% +%% This file may only be distributed together with a copy of the LaTeX +%% `Tools Bundle'. You may however distribute the LaTeX `Tools Bundle' +%% without such generated files. +%% +%% The list of all files belonging to the LaTeX `Tools Bundle' is +%% given in the file `manifest.txt'. +%% +%% File: longtable.dtx Copyright (C) 1990-2001 David Carlisle +\NeedsTeXFormat{LaTeX2e}[1995/06/01] +\ProvidesPackage{longtable_doxygen} + [2014/10/28 v4.11 Multi-page Table package (DPC) - frozen version for doxygen] +\def\LT@err{\PackageError{longtable}} +\def\LT@warn{\PackageWarning{longtable}} +\def\LT@final@warn{% + \AtEndDocument{% + \LT@warn{Table \@width s have changed. Rerun LaTeX.\@gobbletwo}}% + \global\let\LT@final@warn\relax} +\DeclareOption{errorshow}{% + \def\LT@warn{\PackageInfo{longtable}}} +\DeclareOption{pausing}{% + \def\LT@warn#1{% + \LT@err{#1}{This is not really an error}}} +\DeclareOption{set}{} +\DeclareOption{final}{} +\ProcessOptions +\newskip\LTleft \LTleft=\fill +\newskip\LTright \LTright=\fill +\newskip\LTpre \LTpre=\bigskipamount +\newskip\LTpost \LTpost=\bigskipamount +\newcount\LTchunksize \LTchunksize=20 +\let\c@LTchunksize\LTchunksize +\newdimen\LTcapwidth \LTcapwidth=4in +\newbox\LT@head +\newbox\LT@firsthead +\newbox\LT@foot +\newbox\LT@lastfoot +\newcount\LT@cols +\newcount\LT@rows +\newcounter{LT@tables} +\newcounter{LT@chunks}[LT@tables] +\ifx\c@table\undefined + \newcounter{table} + \def\fnum@table{\tablename~\thetable} +\fi +\ifx\tablename\undefined + \def\tablename{Table} +\fi +\newtoks\LT@p@ftn +\mathchardef\LT@end@pen=30000 +\def\longtable{% + \par + \ifx\multicols\@undefined + \else + \ifnum\col@number>\@ne + \@twocolumntrue + \fi + \fi + \if@twocolumn + \LT@err{longtable not in 1-column mode}\@ehc + \fi + \begingroup + \@ifnextchar[\LT@array{\LT@array[x]}} +\def\LT@array[#1]#2{% + \refstepcounter{table}\stepcounter{LT@tables}% + \if l#1% + \LTleft\z@ \LTright\fill + \else\if r#1% + \LTleft\fill \LTright\z@ + \else\if c#1% + \LTleft\fill \LTright\fill + \fi\fi\fi + \let\LT@mcol\multicolumn + \let\LT@@tabarray\@tabarray + \let\LT@@hl\hline + \def\@tabarray{% + \let\hline\LT@@hl + \LT@@tabarray}% + \let\\\LT@tabularcr\let\tabularnewline\\% + \def\newpage{\noalign{\break}}% + \def\pagebreak{\noalign{\ifnum`}=0\fi\@testopt{\LT@no@pgbk-}4}% + \def\nopagebreak{\noalign{\ifnum`}=0\fi\@testopt\LT@no@pgbk4}% + \let\hline\LT@hline \let\kill\LT@kill\let\caption\LT@caption + \@tempdima\ht\strutbox + \let\@endpbox\LT@endpbox + \ifx\extrarowheight\@undefined + \let\@acol\@tabacol + \let\@classz\@tabclassz \let\@classiv\@tabclassiv + \def\@startpbox{\vtop\LT@startpbox}% + \let\@@startpbox\@startpbox + \let\@@endpbox\@endpbox + \let\LT@LL@FM@cr\@tabularcr + \else + \advance\@tempdima\extrarowheight + \col@sep\tabcolsep + \let\@startpbox\LT@startpbox\let\LT@LL@FM@cr\@arraycr + \fi + \setbox\@arstrutbox\hbox{\vrule + \@height \arraystretch \@tempdima + \@depth \arraystretch \dp \strutbox + \@width \z@}% + \let\@sharp##\let\protect\relax + \begingroup + \@mkpream{#2}% + \xdef\LT@bchunk{% + \global\advance\c@LT@chunks\@ne + \global\LT@rows\z@\setbox\z@\vbox\bgroup + \LT@setprevdepth + \tabskip\LTleft \noexpand\halign to\hsize\bgroup + \tabskip\z@ \@arstrut \@preamble \tabskip\LTright \cr}% + \endgroup + \expandafter\LT@nofcols\LT@bchunk&\LT@nofcols + \LT@make@row + \m@th\let\par\@empty + \everycr{}\lineskip\z@\baselineskip\z@ + \LT@bchunk} +\def\LT@no@pgbk#1[#2]{\penalty #1\@getpen{#2}\ifnum`{=0\fi}} +\def\LT@start{% + \let\LT@start\endgraf + \endgraf\penalty\z@\vskip\LTpre + \dimen@\pagetotal + \advance\dimen@ \ht\ifvoid\LT@firsthead\LT@head\else\LT@firsthead\fi + \advance\dimen@ \dp\ifvoid\LT@firsthead\LT@head\else\LT@firsthead\fi + \advance\dimen@ \ht\LT@foot + \dimen@ii\vfuzz + \vfuzz\maxdimen + \setbox\tw@\copy\z@ + \setbox\tw@\vsplit\tw@ to \ht\@arstrutbox + \setbox\tw@\vbox{\unvbox\tw@}% + \vfuzz\dimen@ii + \advance\dimen@ \ht + \ifdim\ht\@arstrutbox>\ht\tw@\@arstrutbox\else\tw@\fi + \advance\dimen@\dp + \ifdim\dp\@arstrutbox>\dp\tw@\@arstrutbox\else\tw@\fi + \advance\dimen@ -\pagegoal + \ifdim \dimen@>\z@\vfil\break\fi + \global\@colroom\@colht + \ifvoid\LT@foot\else + \advance\vsize-\ht\LT@foot + \global\advance\@colroom-\ht\LT@foot + \dimen@\pagegoal\advance\dimen@-\ht\LT@foot\pagegoal\dimen@ + \maxdepth\z@ + \fi + \ifvoid\LT@firsthead\copy\LT@head\else\box\LT@firsthead\fi\nobreak + \output{\LT@output}} +\def\endlongtable{% + \crcr + \noalign{% + \let\LT@entry\LT@entry@chop + \xdef\LT@save@row{\LT@save@row}}% + \LT@echunk + \LT@start + \unvbox\z@ + \LT@get@widths + \if@filesw + {\let\LT@entry\LT@entry@write\immediate\write\@auxout{% + \gdef\expandafter\noexpand + \csname LT@\romannumeral\c@LT@tables\endcsname + {\LT@save@row}}}% + \fi + \ifx\LT@save@row\LT@@save@row + \else + \LT@warn{Column \@width s have changed\MessageBreak + in table \thetable}% + \LT@final@warn + \fi + \endgraf\penalty -\LT@end@pen + \endgroup + \global\@mparbottom\z@ + \pagegoal\vsize + \endgraf\penalty\z@\addvspace\LTpost + \ifvoid\footins\else\insert\footins{}\fi} +\def\LT@nofcols#1&{% + \futurelet\@let@token\LT@n@fcols} +\def\LT@n@fcols{% + \advance\LT@cols\@ne + \ifx\@let@token\LT@nofcols + \expandafter\@gobble + \else + \expandafter\LT@nofcols + \fi} +\def\LT@tabularcr{% + \relax\iffalse{\fi\ifnum0=`}\fi + \@ifstar + {\def\crcr{\LT@crcr\noalign{\nobreak}}\let\cr\crcr + \LT@t@bularcr}% + {\LT@t@bularcr}} +\let\LT@crcr\crcr +\let\LT@setprevdepth\relax +\def\LT@t@bularcr{% + \global\advance\LT@rows\@ne + \ifnum\LT@rows=\LTchunksize + \gdef\LT@setprevdepth{% + \prevdepth\z@\global + \global\let\LT@setprevdepth\relax}% + \expandafter\LT@xtabularcr + \else + \ifnum0=`{}\fi + \expandafter\LT@LL@FM@cr + \fi} +\def\LT@xtabularcr{% + \@ifnextchar[\LT@argtabularcr\LT@ntabularcr} +\def\LT@ntabularcr{% + \ifnum0=`{}\fi + \LT@echunk + \LT@start + \unvbox\z@ + \LT@get@widths + \LT@bchunk} +\def\LT@argtabularcr[#1]{% + \ifnum0=`{}\fi + \ifdim #1>\z@ + \unskip\@xargarraycr{#1}% + \else + \@yargarraycr{#1}% + \fi + \LT@echunk + \LT@start + \unvbox\z@ + \LT@get@widths + \LT@bchunk} +\def\LT@echunk{% + \crcr\LT@save@row\cr\egroup + \global\setbox\@ne\lastbox + \unskip + \egroup} +\def\LT@entry#1#2{% + \ifhmode\@firstofone{&}\fi\omit + \ifnum#1=\c@LT@chunks + \else + \kern#2\relax + \fi} +\def\LT@entry@chop#1#2{% + \noexpand\LT@entry + {\ifnum#1>\c@LT@chunks + 1}{0pt% + \else + #1}{#2% + \fi}} +\def\LT@entry@write{% + \noexpand\LT@entry^^J% + \@spaces} +\def\LT@kill{% + \LT@echunk + \LT@get@widths + \expandafter\LT@rebox\LT@bchunk} +\def\LT@rebox#1\bgroup{% + #1\bgroup + \unvbox\z@ + \unskip + \setbox\z@\lastbox} +\def\LT@blank@row{% + \xdef\LT@save@row{\expandafter\LT@build@blank + \romannumeral\number\LT@cols 001 }} +\def\LT@build@blank#1{% + \if#1m% + \noexpand\LT@entry{1}{0pt}% + \expandafter\LT@build@blank + \fi} +\def\LT@make@row{% + \global\expandafter\let\expandafter\LT@save@row + \csname LT@\romannumeral\c@LT@tables\endcsname + \ifx\LT@save@row\relax + \LT@blank@row + \else + {\let\LT@entry\or + \if!% + \ifcase\expandafter\expandafter\expandafter\LT@cols + \expandafter\@gobble\LT@save@row + \or + \else + \relax + \fi + !% + \else + \aftergroup\LT@blank@row + \fi}% + \fi} +\let\setlongtables\relax +\def\LT@get@widths{% + \setbox\tw@\hbox{% + \unhbox\@ne + \let\LT@old@row\LT@save@row + \global\let\LT@save@row\@empty + \count@\LT@cols + \loop + \unskip + \setbox\tw@\lastbox + \ifhbox\tw@ + \LT@def@row + \advance\count@\m@ne + \repeat}% + \ifx\LT@@save@row\@undefined + \let\LT@@save@row\LT@save@row + \fi} +\def\LT@def@row{% + \let\LT@entry\or + \edef\@tempa{% + \ifcase\expandafter\count@\LT@old@row + \else + {1}{0pt}% + \fi}% + \let\LT@entry\relax + \xdef\LT@save@row{% + \LT@entry + \expandafter\LT@max@sel\@tempa + \LT@save@row}} +\def\LT@max@sel#1#2{% + {\ifdim#2=\wd\tw@ + #1% + \else + \number\c@LT@chunks + \fi}% + {\the\wd\tw@}} +\def\LT@hline{% + \noalign{\ifnum0=`}\fi + \penalty\@M + \futurelet\@let@token\LT@@hline} +\def\LT@@hline{% + \ifx\@let@token\hline + \global\let\@gtempa\@gobble + \gdef\LT@sep{\penalty-\@medpenalty\vskip\doublerulesep}% + \else + \global\let\@gtempa\@empty + \gdef\LT@sep{\penalty-\@lowpenalty\vskip-\arrayrulewidth}% + \fi + \ifnum0=`{\fi}% + \multispan\LT@cols + \unskip\leaders\hrule\@height\arrayrulewidth\hfill\cr + \noalign{\LT@sep}% + \multispan\LT@cols + \unskip\leaders\hrule\@height\arrayrulewidth\hfill\cr + \noalign{\penalty\@M}% + \@gtempa} +\def\LT@caption{% + \noalign\bgroup + \@ifnextchar[{\egroup\LT@c@ption\@firstofone}\LT@capti@n} +\def\LT@c@ption#1[#2]#3{% + \LT@makecaption#1\fnum@table{#3}% + \def\@tempa{#2}% + \ifx\@tempa\@empty\else + {\let\\\space + \addcontentsline{lot}{table}{\protect\numberline{\thetable}{#2}}}% + \fi} +\def\LT@capti@n{% + \@ifstar + {\egroup\LT@c@ption\@gobble[]}% + {\egroup\@xdblarg{\LT@c@ption\@firstofone}}} +\def\LT@makecaption#1#2#3{% + \LT@mcol\LT@cols c{\hbox to\z@{\hss\parbox[t]\LTcapwidth{% + \sbox\@tempboxa{#1{#2: }#3}% + \ifdim\wd\@tempboxa>\hsize + #1{#2: }#3% + \else + \hbox to\hsize{\hfil\box\@tempboxa\hfil}% + \fi + \endgraf\vskip\baselineskip}% + \hss}}} +\def\LT@output{% + \ifnum\outputpenalty <-\@Mi + \ifnum\outputpenalty > -\LT@end@pen + \LT@err{floats and marginpars not allowed in a longtable}\@ehc + \else + \setbox\z@\vbox{\unvbox\@cclv}% + \ifdim \ht\LT@lastfoot>\ht\LT@foot + \dimen@\pagegoal + \advance\dimen@-\ht\LT@lastfoot + \ifdim\dimen@<\ht\z@ + \setbox\@cclv\vbox{\unvbox\z@\copy\LT@foot\vss}% + \@makecol + \@outputpage + \setbox\z@\vbox{\box\LT@head}% + \fi + \fi + \global\@colroom\@colht + \global\vsize\@colht + \vbox + {\unvbox\z@\box\ifvoid\LT@lastfoot\LT@foot\else\LT@lastfoot\fi}% + \fi + \else + \setbox\@cclv\vbox{\unvbox\@cclv\copy\LT@foot\vss}% + \@makecol + \@outputpage + \global\vsize\@colroom + \copy\LT@head\nobreak + \fi} +\def\LT@end@hd@ft#1{% + \LT@echunk + \ifx\LT@start\endgraf + \LT@err + {Longtable head or foot not at start of table}% + {Increase LTchunksize}% + \fi + \setbox#1\box\z@ + \LT@get@widths + \LT@bchunk} +\def\endfirsthead{\LT@end@hd@ft\LT@firsthead} +\def\endhead{\LT@end@hd@ft\LT@head} +\def\endfoot{\LT@end@hd@ft\LT@foot} +\def\endlastfoot{\LT@end@hd@ft\LT@lastfoot} +\def\LT@startpbox#1{% + \bgroup + \let\@footnotetext\LT@p@ftntext + \setlength\hsize{#1}% + \@arrayparboxrestore + \vrule \@height \ht\@arstrutbox \@width \z@} +\def\LT@endpbox{% + \@finalstrut\@arstrutbox + \egroup + \the\LT@p@ftn + \global\LT@p@ftn{}% + \hfil} +%% added \long to prevent: +% LaTeX Warning: Command \LT@p@ftntext has changed. +% +% from the original repository (https://github.com/latex3/latex2e/blob/develop/required/tools/longtable.dtx): +% \changes{v4.15}{2021/03/28} +% {make long for gh/364} +% Inside the `p' column, just save up the footnote text in a token +% register. +\long\def\LT@p@ftntext#1{% + \edef\@tempa{\the\LT@p@ftn\noexpand\footnotetext[\the\c@footnote]}% + \global\LT@p@ftn\expandafter{\@tempa{#1}}}% + +\@namedef{ver@longtable.sty}{2014/10/28 v4.11 Multi-page Table package (DPC) - frozen version for doxygen} +\endinput +%% +%% End of file `longtable.sty'. diff --git a/docs/latex/manualpage.tex b/docs/latex/manualpage.tex index 7387a4c4..a3125141 100644 --- a/docs/latex/manualpage.tex +++ b/docs/latex/manualpage.tex @@ -1,132 +1,151 @@ -\hypertarget{manualpage_autotoc_md14}{}\section{Available Commands}\label{manualpage_autotoc_md14} +\chapter{Manual} +\hypertarget{manualpage}{}\label{manualpage}\index{Manual@{Manual}} +\label{manualpage_md_docs_2_m_a_n_u_a_l}% +\Hypertarget{manualpage_md_docs_2_m_a_n_u_a_l}% +\hypertarget{manualpage_autotoc_md14}{}\doxysection{\texorpdfstring{Available Commands}{Available Commands}}\label{manualpage_autotoc_md14} \tabulinesep=1mm -\begin{longtabu} spread 0pt [c]{*{2}{|X[-1]}|} +\begin{longtabu}spread 0pt [c]{*{2}{|X[-1]}|} \hline -\rowcolor{\tableheadbgcolor}\textbf{ Command }&\textbf{ Description }\\\cline{1-2} +\cellcolor{\tableheadbgcolor}\textbf{ Command }&\cellcolor{\tableheadbgcolor}\textbf{ Description }\\\cline{1-2} \endfirsthead \hline \endfoot \hline -\rowcolor{\tableheadbgcolor}\textbf{ Command }&\textbf{ Description }\\\cline{1-2} +\cellcolor{\tableheadbgcolor}\textbf{ Command }&\cellcolor{\tableheadbgcolor}\textbf{ Description }\\\cline{1-2} \endhead -trim &Trim reads in aligned B\+AM \\\cline{1-2} -variants &Call variants from aligned B\+AM file \\\cline{1-2} -filtervariants &Filter variants across replicates or multiple samples aligned using the same reference \\\cline{1-2} -consensus &Call consensus from aligned B\+AM file \\\cline{1-2} -getmasked &Detect primer mismatches and get primer indices for the amplicon to be masked \\\cline{1-2} -removereads &Remove reads from trimmed B\+AM file \\\cline{1-2} -version &Show version information \\\cline{1-2} -trimadapter &(E\+X\+P\+E\+R\+I\+M\+E\+N\+T\+AL) Trim adapter sequences from reads \\\cline{1-2} +trim &Trim reads in aligned BAM \\\cline{1-2} +variants &Call variants from aligned BAM file \\\cline{1-2} +filtervariants &Filter variants across replicates or multiple samples aligned using the same reference \\\cline{1-2} +consensus &Call consensus from aligned BAM file \\\cline{1-2} +getmasked &Detect primer mismatches and get primer indices for the amplicon to be masked \\\cline{1-2} +removereads &Remove reads from trimmed BAM file \\\cline{1-2} +version &Show version information \\\cline{1-2} +trimadapter &(EXPERIMENTAL) Trim adapter sequences from reads \\\cline{1-2} \end{longtabu} -To view detailed usage for each command type {\ttfamily ivar $<$command$>$} Note \+: Commands maked (E\+X\+P\+E\+R\+I\+M\+E\+N\+T\+AL) are still under active development.\hypertarget{manualpage_autotoc_md15}{}\section{Description of commands}\label{manualpage_autotoc_md15} -\hypertarget{manualpage_autotoc_md16}{}\subsection{Trim primer sequences with i\+Var}\label{manualpage_autotoc_md16} -i\+Var uses primer positions supplied in a B\+ED file to soft clip primer sequences from an aligned and sorted B\+AM file. Following this, the reads are trimmed based on a quality threshold(\+Default\+: 20). To do the quality trimming, i\+Var uses a sliding window approach(\+Default\+: 4). The windows slides from the 5\textquotesingle{} end to the 3\textquotesingle{} end and if at any point the average base quality in the window falls below the threshold, the remaining read is soft clipped. If after trimming, the length of the read is greater than the minimum length specified(\+Default\+: 30), the read is written to the new trimmed B\+AM file. +To view detailed usage for each command type {\ttfamily ivar \texorpdfstring{$<$}{<}command\texorpdfstring{$>$}{>}} Note \+: Commands maked (EXPERIMENTAL) are still under active development.\hypertarget{manualpage_autotoc_md15}{}\doxysection{\texorpdfstring{Description of commands}{Description of commands}}\label{manualpage_autotoc_md15} +\hypertarget{manualpage_autotoc_md16}{}\doxysubsection{\texorpdfstring{Trim primer sequences with i\+Var}{Trim primer sequences with i\+Var}}\label{manualpage_autotoc_md16} +i\+Var uses primer positions supplied in a BED file to soft clip primer sequences from an aligned and sorted BAM file. Following this, the reads are trimmed based on a quality threshold(\+Default\+: 20). To do the quality trimming, i\+Var uses a sliding window approach(\+Default\+: 4). The windows slides from the 5\textquotesingle{} end to the 3\textquotesingle{} end and if at any point the average base quality in the window falls below the threshold, the remaining read is soft clipped. If after trimming, the length of the read is greater than the minimum length specified(\+Default\+: 30), the read is written to the new trimmed BAM file. Please note that the strand is taken into account while doing the trimming so forward primers are trimmed only from forward strand and reverse primers are trimmed from reverse strand. -To sort and index an aligned B\+AM file (O\+P\+T\+I\+O\+N\+AL, if index is not present i\+Var will create one), the following command can be used, +To sort and index an aligned BAM file (OPTIONAL, if index is not present i\+Var will create one), the following command can be used, -\begin{DoxyCode} -# Input file - test.bam -samtools sort -o test.sorted.bam test.bam && samtools index test.sorted.bam. +\begin{DoxyCode}{0} +\DoxyCodeLine{\#\ Input\ file\ -\/\ test.bam} +\DoxyCodeLine{samtools\ sort\ -\/o\ test.sorted.bam\ test.bam\ \&\&\ samtools\ index\ test.sorted.bam.} + \end{DoxyCode} -{\bfseries Note}\+: All the trimming in i\+Var is done by soft-\/clipping reads in an aligned B\+AM file. This information is lost if reads are extracted in fastq or fasta format from the trimmed B\+AM file. +{\bfseries{Note}}\+: All the trimming in i\+Var is done by soft-\/clipping reads in an aligned BAM file. This information is lost if reads are extracted in fastq or fasta format from the trimmed BAM file. Command\+: -\begin{DoxyCode} -ivar trim - -Usage: ivar trim -i -b -p [-m ] [-q ] [-s - ] - -Input Options Description - -i (Required) Sorted bam file, with aligned reads, to trim primers and quality - -b (Required) BED file with primer sequences and positions - -m Minimum length of read to retain after trimming (Default: 30) - -q Minimum quality threshold for sliding window to pass (Default: 20) - -s Width of sliding window (Default: 4) - -e Include reads with no primers. By default, reads with no primers are excluded - -Output Options Description - -p (Required) Prefix for the output BAM file +\begin{DoxyCode}{0} +\DoxyCodeLine{ivar\ trim} +\DoxyCodeLine{} +\DoxyCodeLine{Usage:\ ivar\ trim\ -\/i\ []\ -\/b\ \ [-\/p\ ]\ [-\/m\ ]\ [-\/q\ ]\ [-\/s\ ]} +\DoxyCodeLine{} +\DoxyCodeLine{Input\ Options\ \ \ \ Description} +\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ -\/i\ \ \ \ Sorted\ bam\ file,\ with\ aligned\ reads,\ to\ trim\ primers\ and\ quality.\ If\ not\ specified\ will\ read\ from\ standard\ in} +\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ -\/b\ \ \ \ (Required)\ BED\ file\ with\ primer\ sequences\ and\ positions} +\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ -\/f\ \ \ \ Primer\ pair\ information\ file\ containing\ left\ and\ right\ primer\ names\ for\ the\ same\ amplicon\ separated\ by\ a\ tab} +\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ If\ provided,\ reads\ will\ be\ filtered\ based\ on\ their\ overlap\ with\ amplicons\ prior\ to\ trimming} +\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ -\/m\ \ \ \ Minimum\ length\ of\ read\ to\ retain\ after\ trimming\ (Default:\ 50\%\ the\ average\ length\ of\ the\ first\ 1000\ reads)} +\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ -\/q\ \ \ \ Minimum\ quality\ threshold\ for\ sliding\ window\ to\ pass\ (Default:\ 20)} +\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ -\/s\ \ \ \ Width\ of\ sliding\ window\ (Default:\ 4)} +\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ -\/e\ \ \ \ Include\ reads\ with\ no\ primers.\ By\ default,\ reads\ with\ no\ primers\ are\ excluded} +\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ -\/k\ \ \ \ Keep\ reads\ to\ allow\ for\ reanalysis:\ keep\ reads\ which\ would\ be\ dropped\ by} +\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ alignment\ length\ filter\ or\ primer\ requirements,\ but\ mark\ them\ QCFAIL} +\DoxyCodeLine{} +\DoxyCodeLine{Output\ Options\ \ \ Description} +\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ -\/p\ \ \ \ Prefix\ for\ the\ output\ BAM\ file.\ If\ none\ is\ specified\ the\ output\ will\ write\ to\ standard\ out.} + \end{DoxyCode} Example Usage\+: -\begin{DoxyCode} -ivar trim -b test\_primers.bed -p test.trimmed -i test.bam -q 15 -m 50 -s 4 +\begin{DoxyCode}{0} +\DoxyCodeLine{ivar\ trim\ -\/b\ test\_primers.bed\ -\/p\ test.trimmed\ -\/i\ test.bam\ -\/q\ 15\ -\/m\ 50\ -\/s\ 4} +\DoxyCodeLine{samtools\ view\ -\/h\ test.bam\ |\ ivar\ trim\ -\/b\ test\_primers.bed\ -\/p\ test.trimmed\ } + \end{DoxyCode} -The command above will produce a trimmed B\+AM file test.\+trimmed.\+bam after trimming the aligned reads in test.\+bam using the primer positions specified in test\+\_\+primers.\+bed and a minimum quality threshold of {\bfseries 15}, minimum read length of {\bfseries 50} and a sliding window of {\bfseries 4}. +The command above will produce a trimmed BAM file test.\+trimmed.\+bam after trimming the aligned reads in test.\+bam using the primer positions specified in test\+\_\+primers.\+bed and a minimum quality threshold of {\bfseries{15}}, minimum read length of {\bfseries{50}} and a sliding window of {\bfseries{4}}. + +Example Usage\+: +\begin{DoxyCode}{0} +\DoxyCodeLine{bwa\ mem\ -\/t\ 32\ reference.fa\ 1.fq\ 2.fq\ |\ ivar\ trim\ -\/b\ test\_primers.bed\ -\/x\ 3\ -\/m\ 30\ |\ samtools\ sort\ -\/\ |\ samtools\ mpileup\ -\/aa\ -\/A\ -\/Q\ 0\ -\/d\ 0\ -\/\ |\ ivar\ consensus\ -\/p\ test\_consensus\ -\/m\ 10\ -\/n\ N\ -\/t\ 0.5} + +\end{DoxyCode} + -Example B\+ED file +The command above will allow you to go from alignment to consensus sequence in a single command using the bwa aligner. +Example BED file + + +\begin{DoxyCode}{0} +\DoxyCodeLine{Puerto\ \ 28\ \ 52\ \ 400\_1\_out\_L\ 60\ \ +} +\DoxyCodeLine{Puerto\ \ 482\ 504\ 400\_1\_out\_R\ 60\ \ -\/} +\DoxyCodeLine{Puerto\ \ 359\ 381\ 400\_2\_out\_L\ 60\ \ +} +\DoxyCodeLine{Puerto\ \ 796\ 818\ 400\_2\_out\_R\ 60\ \ -\/} +\DoxyCodeLine{Puerto\ \ 658\ 680\ 400\_3\_out\_L*\ \ \ \ 60\ \ +} +\DoxyCodeLine{Puerto\ \ 1054\ \ \ \ 1076\ \ \ \ 400\_3\_out\_R*\ \ \ \ 60\ \ -\/} +\DoxyCodeLine{.} +\DoxyCodeLine{.} +\DoxyCodeLine{.} +\DoxyCodeLine{.} -\begin{DoxyCode} -Puerto 28 52 400\_1\_out\_L 60 + -Puerto 482 504 400\_1\_out\_R 60 - -Puerto 359 381 400\_2\_out\_L 60 + -Puerto 796 818 400\_2\_out\_R 60 - -Puerto 658 680 400\_3\_out\_L* 60 + -Puerto 1054 1076 400\_3\_out\_R* 60 - -. -. -. -. \end{DoxyCode} -\hypertarget{manualpage_autotoc_md17}{}\subsection{Call variants with i\+Var}\label{manualpage_autotoc_md17} -i\+Var uses the output of the {\ttfamily samtools mpileup} command to call variants -\/ single nucleotide variants(\+S\+N\+Vs) and indels. In order to call variants correctly, the reference file used for alignment must be passed to i\+Var using the {\ttfamily -\/r} flag. The output of {\ttfamily samtools pileup} is piped into {\ttfamily ivar variants} to generate a .tsv file with the variants. There are two parameters that can be set for variant calling using i\+Var -\/ minimum quality(\+Default\+: 20) and minimum frequency(Default\+: 0.\+03). Minimum quality is the minimum quality for a base to be counted towards the ungapped depth to canculate i\+S\+NV frequency at a given position. For insertions, the quality metric is discarded and the mpileup depth is used directly. Minimum frequency is the minimum frequency required for a S\+NV or indel to be reported. +\hypertarget{manualpage_autotoc_md17}{}\doxysubsection{\texorpdfstring{Call variants with i\+Var}{Call variants with i\+Var}}\label{manualpage_autotoc_md17} +i\+Var uses the output of the {\ttfamily samtools mpileup} command to call variants -\/ single nucleotide variants(\+SNVs) and indels. In order to call variants correctly, the reference file used for alignment must be passed to i\+Var using the {\ttfamily -\/r} flag. The output of {\ttfamily samtools pileup} is piped into {\ttfamily ivar variants} to generate a .tsv file with the variants. There are two parameters that can be set for variant calling using i\+Var -\/ minimum quality(\+Default\+: 20) and minimum frequency(Default\+: 0.\+03). Minimum quality is the minimum quality for a base to be counted towards the ungapped depth to canculate i\+SNV frequency at a given position. For insertions, the quality metric is discarded and the mpileup depth is used directly. Minimum frequency is the minimum frequency required for a SNV or indel to be reported. -\paragraph*{Amino acid translation of i\+S\+N\+Vs} +\doxyparagraph*{Amino acid translation of i\+SNVs} -i\+Var can identify codons and translate variants into amino acids using a G\+FF file in the https\+://github.com/\+The-\/\+Sequence-\/\+Ontology/\+Specifications/blob/master/gff3.\+md \char`\"{}\+G\+F\+F3\char`\"{} format containing the required coding regions (C\+DS). In absence of a G\+FF file, i\+Var will not perform the translation and \char`\"{}\+N\+A\char`\"{} will be added to the output file in place of the reference and alternate codons and amino acids. The G\+FF file in the G\+F\+F3 format can be downloaded via ftp from N\+C\+BI Ref\+Seq/\+Genbank. They are usually the files with the extension \char`\"{}.\+gff.\+gz\char`\"{}. For example, the G\+FF file for Zaire Ebolavirus can be found \href{ftp://ftp.ncbi.nlm.nih.gov/genomes/refseq/viral/Zaire_ebolavirus/all_assembly_versions/GCF_000848505.1_ViralProj14703}{\tt here}. More details on G\+F\+F3 files hosted by N\+C\+BI can be found in their ftp \href{https://www.ncbi.nlm.nih.gov/genome/doc/ftpfaq/}{\tt F\+A\+Qs}. +i\+Var can identify codons and translate variants into amino acids using a GFF file in the \href{https://github.com/The-Sequence-Ontology/Specifications/blob/master/gff3.md}{\texttt{ GFF3}} format containing the required coding regions (CDS). In absence of a GFF file, i\+Var will not perform the translation and "{}\+NA"{} will be added to the output file in place of the reference and alternate codons and amino acids. The GFF file in the GFF3 format can be downloaded via ftp from NCBI Ref\+Seq/\+Genbank. They are usually the files with the extension "{}.\+gff.\+gz"{}. For example, the GFF file for Zaire Ebolavirus can be found \href{ftp://ftp.ncbi.nlm.nih.gov/genomes/refseq/viral/Zaire_ebolavirus/all_assembly_versions/GCF_000848505.1_ViralProj14703}{\texttt{ here}}. More details on GFF3 files hosted by NCBI can be found in their ftp \href{https://www.ncbi.nlm.nih.gov/genome/doc/ftpfaq/}{\texttt{ FAQs}}. -\paragraph*{Account for R\+NA editing through polymerase slippage} +\doxyparagraph*{Account for RNA editing through polymerase slippage} -Some R\+NA viruses such as Ebola virus, might have polymerase slippage causing the insertion of a couple of nucleotides. More details can be found \href{https://viralzone.expasy.org/857?outline=all_by_protein}{\tt here}. i\+Var can account for this editing and identify the correct open reading frames. The user will have to specify two additional parameters, {\bfseries Edit\+Position}\+: Position at which edit occurs and {\bfseries Edit\+Sequence}\+: The sequence tht is inserted at the given positon, in the \char`\"{}attributes\char`\"{} column of the G\+FF file to account for this. A test example is given below, +Some RNA viruses such as Ebola virus, might have polymerase slippage causing the insertion of a couple of nucleotides. More details can be found \href{https://viralzone.expasy.org/857?outline=all_by_protein}{\texttt{ here}}. i\+Var can account for this editing and identify the correct open reading frames. The user will have to specify two additional parameters, {\bfseries{Edit\+Position}}\+: Position at which edit occurs and {\bfseries{Edit\+Sequence}}\+: The sequence tht is inserted at the given positon, in the "{}attributes"{} column of the GFF file to account for this. A test example is given below, -\begin{DoxyCode} -test Genbank CDS 2 292 . + . ID=id-testedit1;Note=PinkFloyd;EditPosition=100;EditSequence=A -test Genbank CDS 2 292 . + . - ID=id-testedit2;Note=AnotherBrickInTheWall;EditPosition=102;EditSequence=AA +\begin{DoxyCode}{0} +\DoxyCodeLine{test\ \ \ \ Genbank\ CDS\ 2\ \ \ 292\ .\ \ \ +\ \ \ .\ \ \ ID=id-\/testedit1;Note=PinkFloyd;EditPosition=100;EditSequence=A} +\DoxyCodeLine{test\ \ \ \ Genbank\ CDS\ 2\ \ \ 292\ .\ \ \ +\ \ \ .\ \ \ ID=id-\/testedit2;Note=AnotherBrickInTheWall;EditPosition=102;EditSequence=AA} + \end{DoxyCode} -If a certain base is present in multiple C\+D\+Ss, i\+Var will add a new row for each C\+DS frame and distinguish the rows by adding the ID (specified in attributes of G\+FF) of the G\+FF feature used for the translation. This is shown for position 42 in the example output below. There are two rows with two different G\+FF features\+: id-\/test3 and id-\/test4. +If a certain base is present in multiple CDSs, i\+Var will add a new row for each CDS frame and distinguish the rows by adding the ID (specified in attributes of GFF) of the GFF feature used for the translation. This is shown for position 42 in the example output below. There are two rows with two different GFF features\+: id-\/test3 and id-\/test4. Command\+: -\begin{DoxyCode} -Usage: samtools mpileup -aa -A -d 0 -B -Q 0 --reference [ | ivar variants -p - [-q ] [-t ] [-m ] [-r ] [-g - GFF file] - -Note : samtools mpileup output must be piped into ivar variants - -Input Options Description - -q Minimum quality score threshold to count base (Default: 20) - -t Minimum frequency threshold(0 - 1) to call variants (Default: 0.03) - -m Minimum read depth to call variants (Default: 0) - -r Reference file used for alignment. This is used to translate the nucleotide sequences and - identify intra host single nucleotide variants - -g A GFF file in the GFF3 format can be supplied to specify coordinates of open reading - frames (ORFs). In absence of GFF file, amino acid translation will not be done. - -Output Options Description - -p (Required) Prefix for the output tsv variant file +\begin{DoxyCode}{0} +\DoxyCodeLine{Usage:\ samtools\ mpileup\ -\/aa\ -\/A\ -\/d\ 0\ -\/B\ -\/Q\ 0\ -\/-\/reference\ [\ |\ ivar\ variants\ -\/p\ \ [-\/q\ ]\ [-\/t\ ]\ [-\/m\ ]\ [-\/r\ ]\ [-\/g\ GFF\ file]} +\DoxyCodeLine{} +\DoxyCodeLine{Note\ :\ samtools\ mpileup\ output\ must\ be\ piped\ into\ ivar\ variants} +\DoxyCodeLine{} +\DoxyCodeLine{Input\ Options\ \ \ \ Description} +\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ -\/q\ \ \ \ Minimum\ quality\ score\ threshold\ to\ count\ base\ (Default:\ 20)} +\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ -\/t\ \ \ \ Minimum\ frequency\ threshold(0\ -\/\ 1)\ to\ call\ variants\ (Default:\ 0.03)} +\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ -\/m\ \ \ \ Minimum\ read\ depth\ to\ call\ variants\ (Default:\ 0)} +\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ -\/G\ \ \ \ Count\ gaps\ towards\ depth.\ By\ default,\ gaps\ are\ not\ counted\ \ \ \ \ \ \ \ \ \ \ } +\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ -\/r\ \ \ \ Reference\ file\ used\ for\ alignment.\ This\ is\ used\ to\ translate\ the\ nucleotide\ sequences\ and\ identify\ intra\ host\ single\ nucleotide\ variants} +\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ -\/g\ \ \ \ A\ GFF\ file\ in\ the\ GFF3\ format\ can\ be\ supplied\ to\ specify\ coordinates\ of\ open\ reading\ frames\ (ORFs).\ In\ absence\ of\ GFF\ file,\ amino\ acid\ translation\ will\ not\ be\ done.} +\DoxyCodeLine{} +\DoxyCodeLine{Output\ Options\ \ \ Description} +\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ -\/p\ \ \ \ (Required)\ Prefix\ for\ the\ output\ tsv\ variant\ file} + \end{DoxyCode} Example Usage\+: -\begin{DoxyCode} -samtools mpileup -aa -A -d 600000 -B -Q 0 test.trimmed.bam | ivar variants -p test -q 20 -t 0.03 -r - test\_reference.fa -g test.gff +\begin{DoxyCode}{0} +\DoxyCodeLine{samtools\ mpileup\ -\/aa\ -\/A\ -\/d\ 600000\ -\/B\ -\/Q\ 0\ test.trimmed.bam\ |\ ivar\ variants\ -\/p\ test\ -\/q\ 20\ -\/t\ 0.03\ -\/r\ test\_reference.fa\ -\/g\ test.gff} + \end{DoxyCode} @@ -135,88 +154,90 @@ Example of output .tsv file. -\begin{DoxyCode} -REGION POS REF ALT REF\_DP REF\_RV REF\_QUAL ALT\_DP ALT\_RV ALT\_QUAL ALT\_FREQ TOTAL\_DP PVAL - PASS GFF\_FEATURE REF\_CODON REF\_AA ALT\_CODON ALT\_AA -test 42 G T 0 0 0 1 0 49 1 1 1 FALSE id-test3 AGG R ATG M -test 42 G T 0 0 0 1 0 49 1 1 1 FALSE id-test4 CAG Q CAT H -test 320 A T 1 1 35 1 1 46 0.5 2 0.666667 FALSE NA NA NA NA NA -test 365 A T 0 0 0 1 1 27 1 1 1 FALSE NA NA NA NA NA +\begin{DoxyCode}{0} +\DoxyCodeLine{REGION\ \ POS\ REF\ ALT\ REF\_DP\ \ REF\_RV\ \ REF\_QUAL\ \ \ \ ALT\_DP\ \ ALT\_RV\ \ ALT\_QUAL\ \ \ \ ALT\_FREQ\ \ \ \ TOTAL\_DP\ \ \ \ PVAL\ \ \ \ PASS\ \ \ \ GFF\_FEATURE\ REF\_CODON\ \ \ REF\_AA\ \ ALT\_CODON\ \ \ ALT\_AA} +\DoxyCodeLine{test\ \ \ \ 42\ \ G\ \ \ T\ \ \ 0\ \ \ 0\ \ \ 0\ \ \ 1\ \ \ 0\ \ \ 49\ \ 1\ \ \ 1\ \ \ 1\ \ \ FALSE\ \ \ id-\/test3\ \ \ \ AGG\ R\ \ \ ATG\ M} +\DoxyCodeLine{test\ \ \ \ 42\ \ G\ \ \ T\ \ \ 0\ \ \ 0\ \ \ 0\ \ \ 1\ \ \ 0\ \ \ 49\ \ 1\ \ \ 1\ \ \ 1\ \ \ FALSE\ \ \ id-\/test4\ \ \ \ CAG\ Q\ \ \ CAT\ H} +\DoxyCodeLine{test\ \ \ \ 320\ A\ \ \ T\ \ \ 1\ \ \ 1\ \ \ 35\ \ 1\ \ \ 1\ \ \ 46\ \ 0.5\ 2\ \ \ 0.666667\ \ \ \ FALSE\ \ \ NA\ \ NA\ \ NA\ \ NA\ \ NA} +\DoxyCodeLine{test\ \ \ \ 365\ A\ \ \ T\ \ \ 0\ \ \ 0\ \ \ 0\ \ \ 1\ \ \ 1\ \ \ 27\ \ 1\ \ \ 1\ \ \ 1\ \ \ FALSE\ \ \ NA\ \ NA\ \ NA\ \ NA\ \ NA} + \end{DoxyCode} Description \tabulinesep=1mm -\begin{longtabu} spread 0pt [c]{*{2}{|X[-1]}|} +\begin{longtabu}spread 0pt [c]{*{2}{|X[-1]}|} \hline -\rowcolor{\tableheadbgcolor}\textbf{ Field }&\textbf{ Description }\\\cline{1-2} +\cellcolor{\tableheadbgcolor}\textbf{ Field }&\cellcolor{\tableheadbgcolor}\textbf{ Description }\\\cline{1-2} \endfirsthead \hline \endfoot \hline -\rowcolor{\tableheadbgcolor}\textbf{ Field }&\textbf{ Description }\\\cline{1-2} +\cellcolor{\tableheadbgcolor}\textbf{ Field }&\cellcolor{\tableheadbgcolor}\textbf{ Description }\\\cline{1-2} \endhead -R\+E\+G\+I\+ON &Region from B\+AM file \\\cline{1-2} -P\+OS &Position on reference sequence \\\cline{1-2} -R\+EF &Reference base \\\cline{1-2} -A\+LT &Alternate Base \\\cline{1-2} -R\+E\+F\+\_\+\+DP &Ungapped depth of reference base \\\cline{1-2} -R\+E\+F\+\_\+\+RV &Ungapped depth of reference base on reverse reads \\\cline{1-2} -R\+E\+F\+\_\+\+Q\+U\+AL &Mean quality of reference base \\\cline{1-2} -A\+L\+T\+\_\+\+DP &Ungapped depth of alternate base. \\\cline{1-2} -A\+L\+T\+\_\+\+RV &Ungapped deapth of alternate base on reverse reads \\\cline{1-2} -A\+L\+T\+\_\+\+Q\+U\+AL &Mean quality of alternate base \\\cline{1-2} -A\+L\+T\+\_\+\+F\+R\+EQ &Frequency of alternate base \\\cline{1-2} -T\+O\+T\+A\+L\+\_\+\+DP &Total depth at position \\\cline{1-2} -P\+V\+AL &p-\/value of fisher\textquotesingle{}s exact test \\\cline{1-2} -P\+A\+SS &Result of p-\/value $<$= 0.\+05 \\\cline{1-2} -G\+F\+F\+\_\+\+F\+E\+A\+T\+U\+RE &ID of the G\+FF feature used for the translation \\\cline{1-2} -R\+E\+F\+\_\+\+C\+O\+D\+ON &Codong using the reference base \\\cline{1-2} -R\+E\+F\+\_\+\+AA &Amino acid translated from reference codon \\\cline{1-2} -A\+L\+T\+\_\+\+C\+O\+D\+ON &Codon using the alternate base \\\cline{1-2} -A\+L\+T\+\_\+\+AA &Amino acid translated from the alternate codon \\\cline{1-2} +REGION &Region from BAM file \\\cline{1-2} +POS &Position on reference sequence \\\cline{1-2} +REF &Reference base \\\cline{1-2} +ALT &Alternate Base \\\cline{1-2} +REF\+\_\+\+DP &Ungapped depth of reference base \\\cline{1-2} +REF\+\_\+\+RV &Ungapped depth of reference base on reverse reads \\\cline{1-2} +REF\+\_\+\+QUAL &Mean quality of reference base \\\cline{1-2} +ALT\+\_\+\+DP &Ungapped depth of alternate base. \\\cline{1-2} +ALT\+\_\+\+RV &Ungapped deapth of alternate base on reverse reads \\\cline{1-2} +ALT\+\_\+\+QUAL &Mean quality of alternate base \\\cline{1-2} +ALT\+\_\+\+FREQ &Frequency of alternate base \\\cline{1-2} +TOTAL\+\_\+\+DP &Total depth at position \\\cline{1-2} +PVAL &p-\/value of fisher\textquotesingle{}s exact test \\\cline{1-2} +PASS &Result of p-\/value \texorpdfstring{$<$}{<}= 0.\+05 \\\cline{1-2} +GFF\+\_\+\+FEATURE &ID of the GFF feature used for the translation \\\cline{1-2} +REF\+\_\+\+CODON &Codong using the reference base \\\cline{1-2} +REF\+\_\+\+AA &Amino acid translated from reference codon \\\cline{1-2} +ALT\+\_\+\+CODON &Codon using the alternate base \\\cline{1-2} +ALT\+\_\+\+AA &Amino acid translated from the alternate codon \\\cline{1-2} \end{longtabu} -{\bfseries Note}\+: Please use the -\/B options with {\ttfamily samtools mpileup} to call variants and generate consensus. When a reference sequence is supplied, the quality of the reference base is reduced to 0 (A\+S\+C\+II\+: !) in the mpileup output. Disabling B\+AQ with -\/B seems to fix this. This was tested in samtools 1.\+7 and 1.\+8.\hypertarget{manualpage_autotoc_md18}{}\subsection{Filter variants across replicates with i\+Var}\label{manualpage_autotoc_md18} -i\+Var can be used to get an intersection of variants(in .tsv files) called from any number of replicates or from different samples using the same reference sequence. This intersection will filter out any i\+S\+N\+Vs that do not occur in a minimum fraction of the files supplied. This parameter can be changed using the {\ttfamily -\/t} flag which range from 0 to 1 (default). Fields that are different across replicates(fields apart from R\+E\+G\+I\+O\+N, P\+O\+S, R\+E\+F, A\+L\+T, R\+E\+F\+\_\+\+C\+O\+D\+O\+N, R\+E\+F\+\_\+\+A\+A, A\+L\+T\+\_\+\+C\+O\+D\+O\+N, A\+L\+T\+\_\+\+A\+A) will have the filename added as a suffix. If there are a large number of files to be filtered, the {\ttfamily -\/f} flag can be used to supply a text file with one sample/replicate variant .tsv file per line. +{\bfseries{Note}}\+: Please use the -\/B options with {\ttfamily samtools mpileup} to call variants and generate consensus. When a reference sequence is supplied, the quality of the reference base is reduced to 0 (ASCII\+: !) in the mpileup output. Disabling BAQ with -\/B seems to fix this. This was tested in samtools 1.\+7 and 1.\+8.\hypertarget{manualpage_autotoc_md18}{}\doxysubsection{\texorpdfstring{Filter variants across replicates with i\+Var}{Filter variants across replicates with i\+Var}}\label{manualpage_autotoc_md18} +i\+Var can be used to get an intersection of variants(in .tsv files) called from any number of replicates or from different samples using the same reference sequence. This intersection will filter out any i\+SNVs that do not occur in a minimum fraction of the files supplied. This parameter can be changed using the {\ttfamily -\/t} flag which range from 0 to 1 (default). Fields that are different across replicates(fields apart from REGION, POS, REF, ALT, REF\+\_\+\+CODON, REF\+\_\+\+AA, ALT\+\_\+\+CODON, ALT\+\_\+\+AA) will have the filename added as a suffix. If there are a large number of files to be filtered, the {\ttfamily -\/f} flag can be used to supply a text file with one sample/replicate variant .tsv file per line. Command\+: -\begin{DoxyCode} -Usage: ivar filtervariants -p replicate-one.tsv replicate-two.tsv ... OR ivar filtervariants -p - -f -Input: Variant tsv files for each replicate/sample - -Input Options Description - -t Minimum fration of files required to contain the same variant. Specify value within [0,1]. - (Default: 1) - -f A text file with one variant file per line. - -Output Options Description - -p (Required) Prefix for the output filtered tsv file +\begin{DoxyCode}{0} +\DoxyCodeLine{Usage:\ ivar\ filtervariants\ -\/p\ \ replicate-\/one.tsv\ replicate-\/two.tsv\ ...\ OR\ ivar\ filtervariants\ -\/p\ \ -\/f\ \ } +\DoxyCodeLine{Input:\ Variant\ tsv\ files\ for\ each\ replicate/sample} +\DoxyCodeLine{} +\DoxyCodeLine{Input\ Options\ \ \ \ Description} +\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ -\/t\ \ \ \ Minimum\ fration\ of\ files\ required\ to\ contain\ the\ same\ variant.\ Specify\ value\ within\ [0,1].\ (Default:\ 1)} +\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ -\/f\ \ \ \ A\ text\ file\ with\ one\ variant\ file\ per\ line.} +\DoxyCodeLine{} +\DoxyCodeLine{Output\ Options\ \ \ Description} +\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ -\/p\ \ \ \ (Required)\ Prefix\ for\ the\ output\ filtered\ tsv\ file} + \end{DoxyCode} Example Usage\+: The command below only retains those variants that are found in atleast 50\% of the fiels supplied -\begin{DoxyCode} -ivar filtervariants -t 0.5 -p test.filtered test.1.tsv test.2.tsv test.3.tsv +\begin{DoxyCode}{0} +\DoxyCodeLine{ivar\ filtervariants\ -\/t\ 0.5\ -\/p\ test.filtered\ test.1.tsv\ test.2.tsv\ test.3.tsv} + \end{DoxyCode} The three replicates can also be supplied using a text file as shown below -\begin{DoxyCode} -ivar filtervariants -t 0.5 -p test.filtered -f filter\_files.txt +\begin{DoxyCode}{0} +\DoxyCodeLine{ivar\ filtervariants\ -\/t\ 0.5\ -\/p\ test.filtered\ -\/f\ filter\_files.txt} + \end{DoxyCode} filter\+\_\+files.\+txt -\begin{DoxyCode} -./path/to/test.1.tsv -./path/to/test.2.tsv -./path/to/test.3.tsv +\begin{DoxyCode}{0} +\DoxyCodeLine{./path/to/test.1.tsv} +\DoxyCodeLine{./path/to/test.2.tsv} +\DoxyCodeLine{./path/to/test.3.tsv} + \end{DoxyCode} @@ -225,104 +246,93 @@ Example output of filtered .tsv file from three files test\+\_\+rep1.\+tsv and test\+\_\+rep2.\+tsv -\begin{DoxyCode} -REGION POS REF ALT GFF\_FEATURE REF\_CODON REF\_AA ALT\_CODON ALT\_AA REF\_DP\_test.1.tsv - REF\_RV\_test.1.tsv REF\_QUAL\_test.1.tsv ALT\_DP\_test.1.tsv ALT\_RV\_test.1.tsv ALT\_QUAL\_test.1.tsv ALT\_FREQ\_test.1.tsv - TOTAL\_DP\_test.1.tsv PVAL\_test.1.tsv PASS\_test.1.tsv REF\_DP\_test.2.tsv REF\_RV\_test.2.tsv REF\_QUAL\_test.2.tsv - ALT\_DP\_test.2.tsv ALT\_RV\_test.2.tsv ALT\_QUAL\_test.2.tsv ALT\_FREQ\_test.2.tsv TOTAL\_DP\_test.2.tsv - PVAL\_test.2.tsv PASS\_test.2.tsv REF\_DP\_test.3.tsv REF\_RV\_test.3.tsv REF\_QUAL\_test.3.tsv ALT\_DP\_test.3.tsv - ALT\_RV\_test.3.tsv ALT\_QUAL\_test.3.tsv ALT\_FREQ\_test.3.tsv TOTAL\_DP\_test.3.tsv PVAL\_test.3.tsv PASS\_test.3.tsv - -test 139 T A id-test3 GCT A GCA A 1 0 32 1 0 55 0.5 2 0.666667 FALSE 1 0 - 32 1 0 55 0.5 2 0.666667 FALSE NA NA NA NA NA NA NA NA NA NA -test 320 A T NA NA NA NA NA 1 1 35 1 1 46 0.5 2 0.666667 FALSE NA NA NA NA - NA NA NA NA NA NA 1 1 35 1 1 46 0.5 2 0.666667 FALSE -test 365 A T NA NA NA NA NA 0 0 0 1 1 27 1 1 1 FALSE 0 0 0 1 1 27 - 1 1 1 FALSE 0 0 0 1 1 27 1 1 1 FALSE -test 42 G T id-test4 CAG Q CAT H 0 0 0 1 0 49 1 1 1 FALSE 0 0 0 1 - 0 49 1 1 1 FALSE NA NA NA NA NA NA NA NA NA NA -test 42 G T id-testedit1 AGG R ATG M 0 0 0 1 0 49 1 1 1 FALSE 0 0 0 - 1 0 49 1 1 1 FALSE 0 0 0 1 0 49 1 1 1 FALSE -test 69 T G id-testedit2 TTG L TGG W 1 0 57 1 0 53 0.5 2 0.666667 FALSE 1 - 0 57 1 0 53 0.5 2 0.666667 FALSE 1 0 57 1 0 53 0.5 2 0.666667 FALSE +\begin{DoxyCode}{0} +\DoxyCodeLine{REGION\ \ POS\ REF\ ALT\ GFF\_FEATURE\ REF\_CODON\ \ \ REF\_AA\ \ ALT\_CODON\ \ \ ALT\_AA\ \ REF\_DP\_test.1.tsv\ \ \ REF\_RV\_test.1.tsv\ \ \ REF\_QUAL\_test.1.tsv\ ALT\_DP\_test.1.tsv\ \ \ ALT\_RV\_test.1.tsv\ \ \ ALT\_QUAL\_test.1.tsv\ ALT\_FREQ\_test.1.tsv\ TOTAL\_DP\_test.1.tsv\ PVAL\_test.1.tsv\ PASS\_test.1.tsv\ REF\_DP\_test.2.tsv\ \ \ REF\_RV\_test.2.tsv\ \ \ REF\_QUAL\_test.2.tsv\ ALT\_DP\_test.2.tsv\ \ \ ALT\_RV\_test.2.tsv\ \ \ ALT\_QUAL\_test.2.tsv\ ALT\_FREQ\_test.2.tsv\ TOTAL\_DP\_test.2.tsv\ PVAL\_test.2.tsv\ PASS\_test.2.tsv\ REF\_DP\_test.3.tsv\ \ \ REF\_RV\_test.3.tsv\ \ \ REF\_QUAL\_test.3.tsv\ ALT\_DP\_test.3.tsv\ \ \ ALT\_RV\_test.3.tsv\ \ \ ALT\_QUAL\_test.3.tsv\ ALT\_FREQ\_test.3.tsv\ TOTAL\_DP\_test.3.tsv\ PVAL\_test.3.tsv\ PASS\_test.3.tsv\ } +\DoxyCodeLine{test\ \ \ \ 139\ T\ \ \ A\ \ \ id-\/test3\ \ \ \ GCT\ A\ \ \ GCA\ A\ \ \ 1\ \ \ 0\ \ \ 32\ \ 1\ \ \ 0\ \ \ 55\ \ 0.5\ 2\ \ \ 0.666667\ \ \ \ FALSE\ \ \ 1\ \ \ 0\ \ \ 32\ \ 1\ \ \ 0\ \ \ 55\ \ 0.5\ 2\ \ \ 0.666667\ \ \ \ FALSE\ \ \ NA\ \ NA\ \ NA\ \ NA\ \ NA\ \ NA\ \ NA\ \ NA\ \ NA\ \ NA} +\DoxyCodeLine{test\ \ \ \ 320\ A\ \ \ T\ \ \ NA\ \ NA\ \ NA\ \ NA\ \ NA\ \ 1\ \ \ 1\ \ \ 35\ \ 1\ \ \ 1\ \ \ 46\ \ 0.5\ 2\ \ \ 0.666667\ \ \ \ FALSE\ \ \ NA\ \ NA\ \ NA\ \ NA\ \ NA\ \ NA\ \ NA\ \ NA\ \ NA\ \ NA\ \ 1\ \ \ 1\ \ \ 35\ \ 1\ \ \ 1\ \ \ 46\ \ 0.5\ 2\ \ \ 0.666667\ \ \ \ FALSE} +\DoxyCodeLine{test\ \ \ \ 365\ A\ \ \ T\ \ \ NA\ \ NA\ \ NA\ \ NA\ \ NA\ \ 0\ \ \ 0\ \ \ 0\ \ \ 1\ \ \ 1\ \ \ 27\ \ 1\ \ \ 1\ \ \ 1\ \ \ FALSE\ \ \ 0\ \ \ 0\ \ \ 0\ \ \ 1\ \ \ 1\ \ \ 27\ \ 1\ \ \ 1\ \ \ 1\ \ \ FALSE\ \ \ 0\ \ \ 0\ \ \ 0\ \ \ 1\ \ \ 1\ \ \ 27\ \ 1\ \ \ 1\ \ \ 1\ \ \ FALSE} +\DoxyCodeLine{test\ \ \ \ 42\ \ G\ \ \ T\ \ \ id-\/test4\ \ \ \ CAG\ Q\ \ \ CAT\ H\ \ \ 0\ \ \ 0\ \ \ 0\ \ \ 1\ \ \ 0\ \ \ 49\ \ 1\ \ \ 1\ \ \ 1\ \ \ FALSE\ \ \ 0\ \ \ 0\ \ \ 0\ \ \ 1\ \ \ 0\ \ \ 49\ \ 1\ \ \ 1\ \ \ 1\ \ \ FALSE\ \ \ NA\ \ NA\ \ NA\ \ NA\ \ NA\ \ NA\ \ NA\ \ NA\ \ NA\ \ NA} +\DoxyCodeLine{test\ \ \ \ 42\ \ G\ \ \ T\ \ \ id-\/testedit1\ \ \ \ AGG\ R\ \ \ ATG\ M\ \ \ 0\ \ \ 0\ \ \ 0\ \ \ 1\ \ \ 0\ \ \ 49\ \ 1\ \ \ 1\ \ \ 1\ \ \ FALSE\ \ \ 0\ \ \ 0\ \ \ 0\ \ \ 1\ \ \ 0\ \ \ 49\ \ 1\ \ \ 1\ \ \ 1\ \ \ FALSE\ \ \ 0\ \ \ 0\ \ \ 0\ \ \ 1\ \ \ 0\ \ \ 49\ \ 1\ \ \ 1\ \ \ 1\ \ \ FALSE} +\DoxyCodeLine{test\ \ \ \ 69\ \ T\ \ \ G\ \ \ id-\/testedit2\ \ \ \ TTG\ L\ \ \ TGG\ W\ \ \ 1\ \ \ 0\ \ \ 57\ \ 1\ \ \ 0\ \ \ 53\ \ 0.5\ 2\ \ \ 0.666667\ \ \ \ FALSE\ \ \ 1\ \ \ 0\ \ \ 57\ \ 1\ \ \ 0\ \ \ 53\ \ 0.5\ 2\ \ \ 0.666667\ \ \ \ FALSE\ \ \ 1\ \ \ 0\ \ \ 57\ \ 1\ \ \ 0\ \ \ 53\ \ 0.5\ 2\ \ \ 0.666667\ \ \ \ FALSE} + \end{DoxyCode} Description of fields \tabulinesep=1mm -\begin{longtabu} spread 0pt [c]{*{3}{|X[-1]}|} +\begin{longtabu}spread 0pt [c]{*{3}{|X[-1]}|} \hline -\rowcolor{\tableheadbgcolor}\textbf{ No }&\textbf{ Field }&\textbf{ Description }\\\cline{1-3} +\cellcolor{\tableheadbgcolor}\textbf{ No }&\cellcolor{\tableheadbgcolor}\textbf{ Field }&\PBS\centering \cellcolor{\tableheadbgcolor}\textbf{ Description }\\\cline{1-3} \endfirsthead \hline \endfoot \hline -\rowcolor{\tableheadbgcolor}\textbf{ No }&\textbf{ Field }&\textbf{ Description }\\\cline{1-3} +\cellcolor{\tableheadbgcolor}\textbf{ No }&\cellcolor{\tableheadbgcolor}\textbf{ Field }&\PBS\centering \cellcolor{\tableheadbgcolor}\textbf{ Description }\\\cline{1-3} \endhead -1 &R\+E\+G\+I\+ON &Common region across all replicate variant tsv files \\\cline{1-3} -2 &P\+OS &Common position across all variant tsv files \\\cline{1-3} -3 &R\+EF &Common reference base across all variant tsv files \\\cline{1-3} -4 &A\+LT &Common alternate base across all variant tsv files \\\cline{1-3} -5 &G\+F\+F\+\_\+\+F\+E\+A\+T\+U\+RE &G\+FF feature used for the translation \\\cline{1-3} -6 &R\+E\+F\+\_\+\+C\+O\+D\+ON &The codon using the reference base \\\cline{1-3} -7 &R\+E\+F\+\_\+\+AA &Reference codon translated into amino acid \\\cline{1-3} -8 &A\+L\+T\+\_\+\+C\+O\+D\+ON &Codon using the alternate base \\\cline{1-3} -9 &A\+L\+T\+\_\+\+AA &Alternate codon translated into amino acid \\\cline{1-3} -10 &R\+E\+F\+\_\+\+D\+P\+\_\+$<$rep1-\/tsv-\/file-\/name$>$ &Depth of reference base in replicate 1 \\\cline{1-3} -11 &R\+E\+F\+\_\+\+R\+V\+\_\+$<$rep1-\/tsv-\/file-\/name$>$ &Depth of reference base on reverse reads in replicate 1 \\\cline{1-3} -12 &R\+E\+F\+\_\+\+Q\+U\+A\+L\+\_\+$<$rep1-\/tsv-\/file-\/name$>$ &Mean quality of reference base in replicate 1 \\\cline{1-3} -13 &A\+L\+T\+\_\+\+D\+P\+\_\+$<$rep1-\/tsv-\/file-\/name$>$ &Depth of alternate base in replicate 1 \\\cline{1-3} -14 &A\+L\+T\+\_\+\+R\+V\+\_\+$<$rep1-\/tsv-\/file-\/name$>$ &Deapth of alternate base on reverse reads in replicate 1 \\\cline{1-3} -15 &A\+L\+T\+\_\+\+Q\+U\+A\+L\+\_\+$<$rep1-\/tsv-\/file-\/name$>$ &Mean quality of alternate base in replicate 1 \\\cline{1-3} -16 &A\+L\+T\+\_\+\+F\+R\+E\+Q\+\_\+$<$rep1-\/tsv-\/file-\/name$>$ &Frequency of alternate base in replicate 1 \\\cline{1-3} -17 &T\+O\+T\+A\+L\+\_\+\+D\+P\+\_\+$<$rep1-\/tsv-\/file-\/name$>$ &Total depth at position in replicate 1 \\\cline{1-3} -18 &P\+V\+A\+L\+\_\+$<$rep1-\/tsv-\/file-\/name$>$ &p-\/value of fisher\textquotesingle{}s exact test in replicate 1 \\\cline{1-3} -19 &P\+A\+S\+S\+\_\+$<$rep1-\/tsv-\/file-\/name$>$ &Result of p-\/value $<$= 0.\+05 in replicate 1 \\\cline{1-3} -20 &Continue rows 10 -\/ 19 for every replicate provided &\\\cline{1-3} +1 ®ION &Common region across all replicate variant tsv files \\\cline{1-3} +2 &POS &Common position across all variant tsv files \\\cline{1-3} +3 &REF &Common reference base across all variant tsv files \\\cline{1-3} +4 &ALT &Common alternate base across all variant tsv files \\\cline{1-3} +5 &GFF\+\_\+\+FEATURE &GFF feature used for the translation \\\cline{1-3} +6 &REF\+\_\+\+CODON &The codon using the reference base \\\cline{1-3} +7 &REF\+\_\+\+AA &Reference codon translated into amino acid \\\cline{1-3} +8 &ALT\+\_\+\+CODON &Codon using the alternate base \\\cline{1-3} +9 &ALT\+\_\+\+AA &Alternate codon translated into amino acid \\\cline{1-3} +10 &REF\+\_\+\+DP\+\_\+\texorpdfstring{$<$}{<}rep1-\/tsv-\/file-\/name\texorpdfstring{$>$}{>} &Depth of reference base in replicate 1 \\\cline{1-3} +11 &REF\+\_\+\+RV\+\_\+\texorpdfstring{$<$}{<}rep1-\/tsv-\/file-\/name\texorpdfstring{$>$}{>} &Depth of reference base on reverse reads in replicate 1 \\\cline{1-3} +12 &REF\+\_\+\+QUAL\+\_\+\texorpdfstring{$<$}{<}rep1-\/tsv-\/file-\/name\texorpdfstring{$>$}{>} &Mean quality of reference base in replicate 1 \\\cline{1-3} +13 &ALT\+\_\+\+DP\+\_\+\texorpdfstring{$<$}{<}rep1-\/tsv-\/file-\/name\texorpdfstring{$>$}{>} &Depth of alternate base in replicate 1 \\\cline{1-3} +14 &ALT\+\_\+\+RV\+\_\+\texorpdfstring{$<$}{<}rep1-\/tsv-\/file-\/name\texorpdfstring{$>$}{>} &Deapth of alternate base on reverse reads in replicate 1 \\\cline{1-3} +15 &ALT\+\_\+\+QUAL\+\_\+\texorpdfstring{$<$}{<}rep1-\/tsv-\/file-\/name\texorpdfstring{$>$}{>} &Mean quality of alternate base in replicate 1 \\\cline{1-3} +16 &ALT\+\_\+\+FREQ\+\_\+\texorpdfstring{$<$}{<}rep1-\/tsv-\/file-\/name\texorpdfstring{$>$}{>} &Frequency of alternate base in replicate 1 \\\cline{1-3} +17 &TOTAL\+\_\+\+DP\+\_\+\texorpdfstring{$<$}{<}rep1-\/tsv-\/file-\/name\texorpdfstring{$>$}{>} &Total depth at position in replicate 1 \\\cline{1-3} +18 &PVAL\+\_\+\texorpdfstring{$<$}{<}rep1-\/tsv-\/file-\/name\texorpdfstring{$>$}{>} &p-\/value of fisher\textquotesingle{}s exact test in replicate 1 \\\cline{1-3} +19 &PASS\+\_\+\texorpdfstring{$<$}{<}rep1-\/tsv-\/file-\/name\texorpdfstring{$>$}{>} &Result of p-\/value \texorpdfstring{$<$}{<}= 0.\+05 in replicate 1 \\\cline{1-3} +20 &Continue rows 10 -\/ 19 for every replicate provided &\\\cline{1-3} \end{longtabu} -\hypertarget{manualpage_autotoc_md19}{}\subsection{Generate a consensus sequences from an aligned B\+A\+M file}\label{manualpage_autotoc_md19} +\hypertarget{manualpage_autotoc_md19}{}\doxysubsection{\texorpdfstring{Generate a consensus sequences from an aligned BAM file}{Generate a consensus sequences from an aligned BAM file}}\label{manualpage_autotoc_md19} To generate a consensus sequence i\+Var uses the output of {\ttfamily samtools mpileup} command. The mpileup output must be piped into {\ttfamily ivar consensus}. There are five parameters that can be set -\/ minimum quality(\+Default\+: 20), minimum frequency threshold(\+Default\+: 0), minimum depth to call a consensus(\+Default\+: 10), a flag to exclude nucleotides from regions with depth less than the minimum depth and a character to call in regions with coverage lower than the speicifed minimum depth(Default\+: \textquotesingle{}N\textquotesingle{}). Minimum quality is the minimum quality of a base to be considered in calculations of variant frequencies at a given position. Minimum frequency threshold is the minimum frequency that a base must match to be called as the consensus base at a position. If one base is not enough to match a given frequency, then an ambigious nucleotide is called at that position. Minimum depth is the minimum required depth to call a consensus. If \textquotesingle{}-\/k\textquotesingle{} flag is set then these regions are not included in the consensus sequence. If \textquotesingle{}-\/k\textquotesingle{} is not set then by default, a \textquotesingle{}N\textquotesingle{} is called in these regions. You can also specfy which character you want to add to the consensus to cover regions with depth less than the minimum depth. This can be done using -\/n option. It takes one of two values\+: \textquotesingle{}-\/\textquotesingle{} or \textquotesingle{}N\textquotesingle{}. -As an example, consider a position with 6\+As, 3\+Ts and 1C. The table below shows the consensus nucleotide called at different frequencies. +As an example, consider a position with 6As, 3Ts and 1C. The table below shows the consensus nucleotide called at different frequencies. \tabulinesep=1mm -\begin{longtabu} spread 0pt [c]{*{2}{|X[-1]}|} +\begin{longtabu}spread 0pt [c]{*{2}{|X[-1]}|} \hline -\rowcolor{\tableheadbgcolor}\textbf{ Minimum frequency threshold }&\textbf{ Consensus }\\\cline{1-2} +\cellcolor{\tableheadbgcolor}\textbf{ Minimum frequency threshold }&\PBS\centering \cellcolor{\tableheadbgcolor}\textbf{ Consensus }\\\cline{1-2} \endfirsthead \hline \endfoot \hline -\rowcolor{\tableheadbgcolor}\textbf{ Minimum frequency threshold }&\textbf{ Consensus }\\\cline{1-2} +\cellcolor{\tableheadbgcolor}\textbf{ Minimum frequency threshold }&\PBS\centering \cellcolor{\tableheadbgcolor}\textbf{ Consensus }\\\cline{1-2} \endhead -0 &A \\\cline{1-2} -0.\+5 &A \\\cline{1-2} -0.\+6 &A \\\cline{1-2} -0.\+7 &W(\+A or T) \\\cline{1-2} -0.\+9 &W (A or T) \\\cline{1-2} -1 &H (A or T or C) \\\cline{1-2} +0 &A \\\cline{1-2} +0.\+5 &A \\\cline{1-2} +0.\+6 &A \\\cline{1-2} +0.\+7 &W(\+A or T) \\\cline{1-2} +0.\+9 &W (A or T) \\\cline{1-2} +1 &H (A or T or C) \\\cline{1-2} \end{longtabu} -If there are two nucleotides at the same frequency, both nucleotides are used to call an ambigious base as the consensus. As an example, consider a position wiht 6 Ts, 2\+As and 2 Gs. The table below shows the consensus nucleotide called at different frequencies. +If there are two nucleotides at the same frequency, both nucleotides are used to call an ambigious base as the consensus. As an example, consider a position wiht 6 Ts, 2As and 2 Gs. The table below shows the consensus nucleotide called at different frequencies. \tabulinesep=1mm -\begin{longtabu} spread 0pt [c]{*{2}{|X[-1]}|} +\begin{longtabu}spread 0pt [c]{*{2}{|X[-1]}|} \hline -\rowcolor{\tableheadbgcolor}\textbf{ Minimum frequency threshold }&\textbf{ Consensus }\\\cline{1-2} +\cellcolor{\tableheadbgcolor}\textbf{ Minimum frequency threshold }&\PBS\centering \cellcolor{\tableheadbgcolor}\textbf{ Consensus }\\\cline{1-2} \endfirsthead \hline \endfoot \hline -\rowcolor{\tableheadbgcolor}\textbf{ Minimum frequency threshold }&\textbf{ Consensus }\\\cline{1-2} +\cellcolor{\tableheadbgcolor}\textbf{ Minimum frequency threshold }&\PBS\centering \cellcolor{\tableheadbgcolor}\textbf{ Consensus }\\\cline{1-2} \endhead -0 &T \\\cline{1-2} -0.\+5 &T \\\cline{1-2} -0.\+6 &T \\\cline{1-2} -0.\+7 &D(\+A or T or G) \\\cline{1-2} -0.\+9 &D(\+A or T or G) \\\cline{1-2} -1 &D(\+A or T or G) \\\cline{1-2} +0 &T \\\cline{1-2} +0.\+5 &T \\\cline{1-2} +0.\+6 &T \\\cline{1-2} +0.\+7 &D(\+A or T or G) \\\cline{1-2} +0.\+9 &D(\+A or T or G) \\\cline{1-2} +1 &D(\+A or T or G) \\\cline{1-2} \end{longtabu} @@ -331,93 +341,95 @@ Command\+: -\begin{DoxyCode} -ivar consensus - -Usage: samtools mpileup -aa -A -d 0 -Q 0 | ivar consensus -p - -Note : samtools mpileup output must be piped into ivar consensus - -Input Options Description - -q Minimum quality score threshold to count base (Default: 20) - -t Minimum frequency threshold(0 - 1) to call consensus. (Default: 0) - Frequently used thresholds | Description - ---------------------------|------------ - 0 | Majority or most common base - 0.2 | Bases that make up atleast 20% of the depth at a position - 0.5 | Strict or bases that make up atleast 50% of the depth at a - position - 0.9 | Strict or bases that make up atleast 90% of the depth at a - position - 1 | Identical or bases that make up 100% of the depth at a - position. Will have highest ambiguities - -m Minimum depth to call consensus(Default: 10) - -k If '-k' flag is added, regions with depth less than minimum depth will not be added to the - consensus sequence. Using '-k' will override any option specified using -n - -n (N/-) Character to print in regions with less than minimum coverage(Default: N) - -Output Options Description - -p (Required) Prefix for the output fasta file and quality file +\begin{DoxyCode}{0} +\DoxyCodeLine{ivar\ consensus} +\DoxyCodeLine{} +\DoxyCodeLine{Usage:\ samtools\ mpileup\ -\/aa\ -\/A\ -\/d\ 0\ -\/Q\ 0\ \ |\ ivar\ consensus\ -\/p\ \ } +\DoxyCodeLine{} +\DoxyCodeLine{Note\ :\ samtools\ mpileup\ output\ must\ be\ piped\ into\ ivar\ consensus} +\DoxyCodeLine{} +\DoxyCodeLine{Input\ Options\ \ \ \ Description} +\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ -\/q\ \ \ \ Minimum\ quality\ score\ threshold\ to\ count\ base\ (Default:\ 20)} +\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ -\/t\ \ \ \ Minimum\ frequency\ threshold(0\ -\/\ 1)\ to\ call\ consensus.\ (Default:\ 0)} +\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ -\/c\ \ \ \ Minimum\ insertion\ frequency\ threshold(0\ -\/\ 1)\ to\ call\ consensus.\ (Default:\ 0.8)} +\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Frequently\ used\ thresholds\ |\ Description} +\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ -\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/|-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/} +\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 0\ |\ Majority\ or\ most\ common\ base} +\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 0.2\ |\ Bases\ that\ make\ up\ atleast\ 20\%\ of\ the\ depth\ at\ a\ position} +\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 0.5\ |\ Strict\ or\ bases\ that\ make\ up\ atleast\ 50\%\ of\ the\ depth\ at\ a\ position} +\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 0.9\ |\ Strict\ or\ bases\ that\ make\ up\ atleast\ 90\%\ of\ the\ depth\ at\ a\ position} +\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 1\ |\ Identical\ or\ bases\ that\ make\ up\ 100\%\ of\ the\ depth\ at\ a\ position.\ Will\ have\ highest\ ambiguities} +\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ -\/m\ \ \ \ Minimum\ depth\ to\ call\ consensus(Default:\ 10)} +\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ -\/k\ \ \ \ If\ '-\/k'\ flag\ is\ added,\ regions\ with\ depth\ less\ than\ minimum\ depth\ will\ not\ be\ added\ to\ the\ consensus\ sequence.\ Using\ '-\/k'\ will\ override\ any\ option\ specified\ using\ -\/n\ } +\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ -\/n\ \ \ \ (N/-\/)\ Character\ to\ print\ in\ regions\ with\ less\ than\ minimum\ coverage(Default:\ N)} +\DoxyCodeLine{} +\DoxyCodeLine{Output\ Options\ \ \ Description} +\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ -\/p\ \ \ \ (Required)\ Prefix\ for\ the\ output\ fasta\ file\ and\ quality\ file} + \end{DoxyCode} Example Usage\+: -\begin{DoxyCode} -samtools mpileup -d 1000 -A -Q 0 test.bam | ivar consensus -p test -q 20 -t 0 +\begin{DoxyCode}{0} +\DoxyCodeLine{samtools\ mpileup\ -\/d\ 1000\ -\/A\ -\/Q\ 0\ test.bam\ |\ ivar\ consensus\ -\/p\ test\ -\/q\ 20\ -\/t\ 0} + \end{DoxyCode} -The command above will produce a test.\+fa fasta file with the consensus sequence and a test.\+qual.\+txt with the average quality of each base in the consensus sequence.\hypertarget{manualpage_autotoc_md20}{}\subsection{Get primers with mismatches to the reference sequence}\label{manualpage_autotoc_md20} -i\+Var uses a .tsv file with variants to get the zero based indices(based on the B\+E\+D file) of mismatched primers. This command requires another .tsv file with each line containing the left and right primer names separated by a tab. This is used to get both the primers for an amplicon with a single mismatched primer. The output is a text file with the zero based primer indices delimited by a space. The output is written to a a text file using the prefix provided. +The command above will produce a test.\+fa fasta file with the consensus sequence and a test.\+qual.\+txt with the average quality of each base in the consensus sequence.\hypertarget{manualpage_autotoc_md20}{}\doxysubsection{\texorpdfstring{Get primers with mismatches to the reference sequence}{Get primers with mismatches to the reference sequence}}\label{manualpage_autotoc_md20} +i\+Var uses a .tsv file with variants to get the zero based indices(based on the BED file) of mismatched primers. This command requires another .tsv file with each line containing the left and right primer names separated by a tab. This is used to get both the primers for an amplicon with a single mismatched primer. The output is a text file with the zero based primer indices delimited by a space. The output is written to a a text file using the prefix provided. Command\+: -\begin{DoxyCode} -ivar getmasked -Usage: ivar getmasked -i -b -f -p -Note: This step is used only for amplicon-based sequencing. - -Input Options Description - -i (Required) Input filtered variants tsv generated from 'ivar filtervariants' - -b (Required) BED file with primer sequences and positions - -f (Required) Primer pair information file containing left and right primer names for the - same amplicon separated by a tab -Output Options Description - -p (Required) Prefix for the output text file +\begin{DoxyCode}{0} +\DoxyCodeLine{ivar\ getmasked} +\DoxyCodeLine{Usage:\ ivar\ getmasked\ -\/i\ \ -\/b\ \ -\/f\ \ -\/p\ } +\DoxyCodeLine{Note:\ This\ step\ is\ used\ only\ for\ amplicon-\/based\ sequencing.} +\DoxyCodeLine{} +\DoxyCodeLine{Input\ Options\ \ \ \ Description} +\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ -\/i\ \ \ \ (Required)\ Input\ filtered\ variants\ tsv\ generated\ from\ 'ivar\ filtervariants'} +\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ -\/b\ \ \ \ (Required)\ BED\ file\ with\ primer\ sequences\ and\ positions} +\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ -\/f\ \ \ \ (Required)\ Primer\ pair\ information\ file\ containing\ left\ and\ right\ primer\ names\ for\ the\ same\ amplicon\ separated\ by\ a\ tab} +\DoxyCodeLine{Output\ Options\ \ \ Description} +\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ -\/p\ \ \ \ (Required)\ Prefix\ for\ the\ output\ text\ file} + \end{DoxyCode} -Example B\+ED file +Example BED file -\begin{DoxyCode} -Puerto 28 52 400\_1\_out\_L 60 + -Puerto 482 504 400\_1\_out\_R 60 - -Puerto 359 381 400\_2\_out\_L 60 + -Puerto 796 818 400\_2\_out\_R 60 - -Puerto 658 680 400\_3\_out\_L* 60 + -Puerto 1054 1076 400\_3\_out\_R* 60 - -. -. -. -. +\begin{DoxyCode}{0} +\DoxyCodeLine{Puerto\ \ 28\ \ 52\ \ 400\_1\_out\_L\ 60\ \ +} +\DoxyCodeLine{Puerto\ \ 482\ 504\ 400\_1\_out\_R\ 60\ \ -\/} +\DoxyCodeLine{Puerto\ \ 359\ 381\ 400\_2\_out\_L\ 60\ \ +} +\DoxyCodeLine{Puerto\ \ 796\ 818\ 400\_2\_out\_R\ 60\ \ -\/} +\DoxyCodeLine{Puerto\ \ 658\ 680\ 400\_3\_out\_L*\ \ \ \ 60\ \ +} +\DoxyCodeLine{Puerto\ \ 1054\ \ \ \ 1076\ \ \ \ 400\_3\_out\_R*\ \ \ \ 60\ \ -\/} +\DoxyCodeLine{.} +\DoxyCodeLine{.} +\DoxyCodeLine{.} +\DoxyCodeLine{.} + \end{DoxyCode} Example primer pair information file -\begin{DoxyCode} -400\_1\_out\_L 400\_1\_out\_R -400\_2\_out\_L 400\_2\_out\_R -400\_3\_out\_L 400\_3\_out\_R -. -. -. -. +\begin{DoxyCode}{0} +\DoxyCodeLine{400\_1\_out\_L\ \ \ \ 400\_1\_out\_R} +\DoxyCodeLine{400\_2\_out\_L\ \ \ \ 400\_2\_out\_R} +\DoxyCodeLine{400\_3\_out\_L\ \ \ \ 400\_3\_out\_R} +\DoxyCodeLine{.} +\DoxyCodeLine{.} +\DoxyCodeLine{.} +\DoxyCodeLine{.} + \end{DoxyCode} Example Usage\+: -\begin{DoxyCode} -ivar getmasked -i test.filtered.tsv -b primers.bed -f pair\_information.tsv -p test.masked.txt +\begin{DoxyCode}{0} +\DoxyCodeLine{ivar\ getmasked\ -\/i\ test.filtered.tsv\ -\/b\ primers.bed\ -\/f\ pair\_information.tsv\ -\/p\ test.masked.txt} + \end{DoxyCode} @@ -426,38 +438,39 @@ Example Output\+: -\begin{DoxyCode} -1 2 7 8 +\begin{DoxyCode}{0} +\DoxyCodeLine{1\ 2\ 7\ 8} + \end{DoxyCode} -\hypertarget{manualpage_autotoc_md21}{}\subsection{Remove reads associated with mismatched primer indices}\label{manualpage_autotoc_md21} -This command accepts an aligned and sorted B\+AM file trimmed using {\ttfamily ivar trim} and removes the reads corresponding to the supplied primer indices, which is the output of {\ttfamily ivar getmasked} command. Under the hood, {\ttfamily ivar trim} adds the zero based primer index(based on the B\+E\+D file) to the B\+AM auxillary data for every read. Hence, ivar removereads will only work on B\+AM files that have been trimmed using {\ttfamily ivar trim}. +\hypertarget{manualpage_autotoc_md21}{}\doxysubsection{\texorpdfstring{Remove reads associated with mismatched primer indices}{Remove reads associated with mismatched primer indices}}\label{manualpage_autotoc_md21} +This command accepts an aligned and sorted BAM file trimmed using {\ttfamily ivar trim} and removes the reads corresponding to the supplied primer indices, which is the output of {\ttfamily ivar getmasked} command. Under the hood, {\ttfamily ivar trim} adds the zero based primer index(based on the BED file) to the BAM auxillary data for every read. Hence, ivar removereads will only work on BAM files that have been trimmed using {\ttfamily ivar trim}. Command\+: -\begin{DoxyCode} -ivar removereads +\begin{DoxyCode}{0} +\DoxyCodeLine{ivar\ removereads} +\DoxyCodeLine{} +\DoxyCodeLine{Usage:\ ivar\ removereads\ -\/i\ \ -\/p\ \ -\/t\ } +\DoxyCodeLine{Note:\ This\ step\ is\ used\ only\ for\ amplicon-\/based\ sequencing.} +\DoxyCodeLine{} +\DoxyCodeLine{Input\ Options\ \ \ \ Description} +\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ -\/i\ \ \ \ (Required)\ Input\ BAM\ file\ \ trimmed\ with\ ivar\ trim.\ Must\ be\ sorted\ and\ indexed,\ which\ can\ be\ done\ using\ sort\_index\_bam.sh} +\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ -\/t\ \ \ \ (Required)\ Text\ file\ with\ primer\ indices\ separated\ by\ spaces.\ This\ is\ the\ output\ of\ getmasked\ command.} +\DoxyCodeLine{} +\DoxyCodeLine{Output\ Options\ \ \ Description} +\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ -\/p\ \ \ \ (Required)\ Prefix\ for\ the\ output\ filtered\ BAM\ file} -Usage: ivar removereads -i -p -t -Note: This step is used only for amplicon-based sequencing. - -Input Options Description - -i (Required) Input BAM file trimmed with ivar trim. Must be sorted and indexed, which can - be done using sort\_index\_bam.sh - -t (Required) Text file with primer indices separated by spaces. This is the output of - getmasked command. - -Output Options Description - -p (Required) Prefix for the output filtered BAM file \end{DoxyCode} Example Usage\+: -\begin{DoxyCode} -ivar trim -i test.bam -p test.trimmed -ivar removereads -i test.trimmed.bam -p test.trimmed.masked.bam -t test.masked.txt +\begin{DoxyCode}{0} +\DoxyCodeLine{ivar\ trim\ -\/i\ test.bam\ -\/p\ test.trimmed} +\DoxyCodeLine{ivar\ removereads\ -\/i\ test.trimmed.bam\ -\/p\ test.trimmed.masked.bam\ -\/t\ test.masked.txt} + \end{DoxyCode} -The {\ttfamily ivar trim} command above trims test.\+bam and produced test.\+trimmed.\+bam with the primer indice data added. The {\ttfamily ivar removereads} command produces an output file -\/ test.\+trimmed.\+masked.\+bam after removing all the reads corresponding to primer indices -\/ 1,2,7 and 8.\hypertarget{manualpage_autotoc_md22}{}\subsection{(\+Experimental) trimadapter}\label{manualpage_autotoc_md22} -{\bfseries Note\+: This feature is under active development and not completely validated yet.} +The {\ttfamily ivar trim} command above trims test.\+bam and produced test.\+trimmed.\+bam with the primer indice data added. The {\ttfamily ivar removereads} command produces an output file -\/ test.\+trimmed.\+masked.\+bam after removing all the reads corresponding to primer indices -\/ 1,2,7 and 8.\hypertarget{manualpage_autotoc_md22}{}\doxysubsection{\texorpdfstring{(Experimental) trimadapter}{(Experimental) trimadapter}}\label{manualpage_autotoc_md22} +{\bfseries{Note\+: This feature is under active development and not completely validated yet.}} trimadapter in i\+Var can be used to trim adapter sequences from fastq files using a supplied fasta file. \ No newline at end of file diff --git a/docs/latex/refman.tex b/docs/latex/refman.tex index bac78779..45e15aaa 100644 --- a/docs/latex/refman.tex +++ b/docs/latex/refman.tex @@ -1,165 +1,222 @@ -\documentclass[twoside]{book} - -% Packages required by doxygen -\usepackage{fixltx2e} -\usepackage{calc} -\usepackage{doxygen} -\usepackage[export]{adjustbox} % also loads graphicx -\usepackage{graphicx} -\usepackage[utf8]{inputenc} -\usepackage{makeidx} -\usepackage{multicol} -\usepackage{multirow} -\PassOptionsToPackage{warn}{textcomp} -\usepackage{textcomp} -\usepackage[nointegrals]{wasysym} -\usepackage[table]{xcolor} - -% Font selection -\usepackage[T1]{fontenc} -\usepackage[scaled=.90]{helvet} + % Handle batch mode + % to overcome problems with too many open files + \let\mypdfximage\pdfximage\def\pdfximage{\immediate\mypdfximage} + \pdfminorversion=7 + % Set document class depending on configuration + \documentclass[twoside]{book} + %% moved from doxygen.sty due to workaround for LaTex 2019 version and unmaintained tabu package + \usepackage{ifthen} + \ifx\requestedLaTeXdate\undefined + \usepackage{array} + \else + \usepackage{array}[=2016-10-06] + \fi + %% + % Packages required by doxygen + \makeatletter + \providecommand\IfFormatAtLeastTF{\@ifl@t@r\fmtversion} + % suppress package identification of infwarerr as it contains the word "warning" + \let\@@protected@wlog\protected@wlog + \def\protected@wlog#1{\wlog{package info suppressed}} + \RequirePackage{infwarerr} + \let\protected@wlog\@@protected@wlog + \makeatother + \IfFormatAtLeastTF{2016/01/01}{}{\usepackage{fixltx2e}} % for \textsubscript + \IfFormatAtLeastTF{2015/01/01}{\pdfsuppresswarningpagegroup=1}{} + \usepackage{doxygen} + \usepackage{graphicx} + \usepackage[utf8]{inputenc} + \usepackage{makeidx} + \PassOptionsToPackage{warn}{textcomp} + \usepackage{textcomp} + \usepackage[nointegrals]{wasysym} + \usepackage{ifxetex} + % NLS support packages + % Define default fonts + % Font selection + \usepackage[T1]{fontenc} + % set main and monospaced font + \usepackage[scaled=.90]{helvet} \usepackage{courier} -\usepackage{amssymb} -\usepackage{sectsty} \renewcommand{\familydefault}{\sfdefault} -\allsectionsfont{% - \fontseries{bc}\selectfont% - \color{darkgray}% -} -\renewcommand{\DoxyLabelFont}{% - \fontseries{bc}\selectfont% - \color{darkgray}% -} -\newcommand{\+}{\discretionary{\mbox{\scriptsize$\hookleftarrow$}}{}{}} - -% Page & text layout -\usepackage{geometry} -\geometry{% - a4paper,% - top=2.5cm,% - bottom=2.5cm,% - left=2.5cm,% - right=2.5cm% -} -\tolerance=750 -\hfuzz=15pt -\hbadness=750 -\setlength{\emergencystretch}{15pt} -\setlength{\parindent}{0cm} -\setlength{\parskip}{3ex plus 2ex minus 2ex} -\makeatletter -\renewcommand{\paragraph}{% - \@startsection{paragraph}{4}{0ex}{-1.0ex}{1.0ex}{% - \normalfont\normalsize\bfseries\SS@parafont% - }% -} -\renewcommand{\subparagraph}{% - \@startsection{subparagraph}{5}{0ex}{-1.0ex}{1.0ex}{% - \normalfont\normalsize\bfseries\SS@subparafont% - }% -} -\makeatother - -% Headers & footers -\usepackage{fancyhdr} -\pagestyle{fancyplain} -\fancyhead[LE]{\fancyplain{}{\bfseries\thepage}} -\fancyhead[CE]{\fancyplain{}{}} -\fancyhead[RE]{\fancyplain{}{\bfseries\leftmark}} -\fancyhead[LO]{\fancyplain{}{\bfseries\rightmark}} -\fancyhead[CO]{\fancyplain{}{}} -\fancyhead[RO]{\fancyplain{}{\bfseries\thepage}} -\fancyfoot[LE]{\fancyplain{}{}} -\fancyfoot[CE]{\fancyplain{}{}} -\fancyfoot[RE]{\fancyplain{}{\bfseries\scriptsize Generated by Doxygen }} -\fancyfoot[LO]{\fancyplain{}{\bfseries\scriptsize Generated by Doxygen }} -\fancyfoot[CO]{\fancyplain{}{}} -\fancyfoot[RO]{\fancyplain{}{}} -\renewcommand{\footrulewidth}{0.4pt} -\renewcommand{\chaptermark}[1]{% - \markboth{#1}{}% -} -\renewcommand{\sectionmark}[1]{% - \markright{\thesection\ #1}% -} - -% Indices & bibliography -\usepackage{natbib} -\usepackage[titles]{tocloft} -\setcounter{tocdepth}{3} -\setcounter{secnumdepth}{5} -\makeindex - -% Hyperlinks (required, but should be loaded last) -\usepackage{ifpdf} -\ifpdf - \usepackage[pdftex,pagebackref=true]{hyperref} -\else - \usepackage[ps2pdf,pagebackref=true]{hyperref} -\fi -\hypersetup{% - colorlinks=true,% - linkcolor=blue,% - citecolor=blue,% - unicode% -} - -% Custom commands -\newcommand{\clearemptydoublepage}{% - \newpage{\pagestyle{empty}\cleardoublepage}% -} - -\usepackage{caption} -\captionsetup{labelsep=space,justification=centering,font={bf},singlelinecheck=off,skip=4pt,position=top} - + \doxyallsectionsfont{% + \fontseries{bc}\selectfont% + \color{darkgray}% + } + \renewcommand{\DoxyLabelFont}{% + \fontseries{bc}\selectfont% + \color{darkgray}% + } + \newcommand{\+}{\discretionary{\mbox{\scriptsize$\hookleftarrow$}}{}{}} + % Arguments of doxygenemoji: + % 1) '::' form of the emoji, already LaTeX-escaped + % 2) file with the name of the emoji without the .png extension + % in case image exist use this otherwise use the '::' form + \newcommand{\doxygenemoji}[2]{% + \IfFileExists{./#2.png}{\raisebox{-0.1em}{\includegraphics[height=0.9em]{./#2.png}}}{#1}% + } + % Page & text layout + \usepackage{geometry} + \geometry{% + a4paper,% + top=2.5cm,% + bottom=2.5cm,% + left=2.5cm,% + right=2.5cm% + } + \usepackage{changepage} + % Allow a bit of overflow to go unnoticed by other means + \tolerance=750 + \hfuzz=15pt + \hbadness=750 + \setlength{\emergencystretch}{15pt} + \setlength{\parindent}{0cm} + \newcommand{\doxynormalparskip}{\setlength{\parskip}{3ex plus 2ex minus 2ex}} + \newcommand{\doxytocparskip}{\setlength{\parskip}{1ex plus 0ex minus 0ex}} + \doxynormalparskip + % Redefine paragraph/subparagraph environments, using sectsty fonts + \makeatletter + \renewcommand{\paragraph}{% + \@startsection{paragraph}{4}{0ex}{-1.0ex}{1.0ex}{% + \normalfont\normalsize\bfseries\SS@parafont% + }% + } + \renewcommand{\subparagraph}{% + \@startsection{subparagraph}{5}{0ex}{-1.0ex}{1.0ex}{% + \normalfont\normalsize\bfseries\SS@subparafont% + }% + } + \makeatother + \makeatletter + \newcommand\hrulefilll{\leavevmode\leaders\hrule\hskip 0pt plus 1filll\kern\z@} + \makeatother + % Headers & footers + \usepackage{fancyhdr} + \pagestyle{fancyplain} + \renewcommand{\footrulewidth}{0.4pt} + \fancypagestyle{fancyplain}{ + \fancyhf{} + \fancyhead[LE, RO]{\bfseries\thepage} + \fancyhead[LO]{\bfseries\rightmark} + \fancyhead[RE]{\bfseries\leftmark} + \fancyfoot[LO, RE]{\bfseries\scriptsize Generated by Doxygen } + } + \fancypagestyle{plain}{ + \fancyhf{} + \fancyfoot[LO, RE]{\bfseries\scriptsize Generated by Doxygen } + \renewcommand{\headrulewidth}{0pt} + } + \pagestyle{fancyplain} + \renewcommand{\chaptermark}[1]{% + \markboth{#1}{}% + } + \renewcommand{\sectionmark}[1]{% + \markright{\thesection\ #1}% + } + % ToC, LoF, LoT, bibliography, and index + % Indices & bibliography + \usepackage{natbib} + \usepackage[titles]{tocloft} + \setcounter{tocdepth}{3} + \setcounter{secnumdepth}{5} + % creating indexes + \makeindex + \usepackage{newunicodechar} + \makeatletter + \def\doxynewunicodechar#1#2{% + \@tempswafalse + \edef\nuc@tempa{\detokenize{#1}}% + \if\relax\nuc@tempa\relax + \nuc@emptyargerr + \else + \edef\@tempb{\expandafter\@car\nuc@tempa\@nil}% + \nuc@check + \if@tempswa + \@namedef{u8:\nuc@tempa}{#2}% + \fi + \fi + } + \makeatother + \doxynewunicodechar{⁻}{${}^{-}$}% Superscript minus + \doxynewunicodechar{²}{${}^{2}$}% Superscript two + \doxynewunicodechar{³}{${}^{3}$}% Superscript three + % Hyperlinks + % Hyperlinks (required, but should be loaded last) + \ifpdf + \usepackage[pdftex,pagebackref=true]{hyperref} + \else + \ifxetex + \usepackage[pagebackref=true]{hyperref} + \else + \usepackage[ps2pdf,pagebackref=true]{hyperref} + \fi + \fi + \hypersetup{% + colorlinks=true,% + linkcolor=blue,% + citecolor=blue,% + unicode,% + pdftitle={i\+Var},% + pdfsubject={}% + } + % Custom commands used by the header + % Custom commands + \newcommand{\clearemptydoublepage}{% + \newpage{\pagestyle{empty}\cleardoublepage}% + } + % caption style definition + \usepackage{caption} + \captionsetup{labelsep=space,justification=centering,font={bf},singlelinecheck=off,skip=4pt,position=top} + % in page table of contents + \IfFormatAtLeastTF{2023/05/01}{\usepackage[deeplevels]{etoc}}{\usepackage[deeplevels]{etoc_doxygen}} + \etocsettocstyle{\doxytocparskip}{\doxynormalparskip} + \etocsetlevel{subsubsubsection}{4} + \etocsetlevel{subsubsubsubsection}{5} + \etocsetlevel{subsubsubsubsubsection}{6} + \etocsetlevel{subsubsubsubsubsubsection}{7} + \etocsetlevel{paragraph}{8} + \etocsetlevel{subparagraph}{9} + % prevent numbers overlap the titles in toc + \renewcommand{\numberline}[1]{#1~} +% End of preamble, now comes the document contents %===== C O N T E N T S ===== - \begin{document} - -% Titlepage & ToC -\hypersetup{pageanchor=false, - bookmarksnumbered=true, - pdfencoding=unicode - } -\pagenumbering{alph} -\begin{titlepage} -\vspace*{7cm} -\begin{center}% -{\Large i\+Var }\\ -\vspace*{1cm} -{\large Generated by Doxygen 1.8.14}\\ -\end{center} -\end{titlepage} -\clearemptydoublepage -\pagenumbering{roman} -\tableofcontents -\clearemptydoublepage -\pagenumbering{arabic} -\hypersetup{pageanchor=true} - + \raggedbottom + % Titlepage & ToC + % To avoid duplicate page anchors due to reuse of same numbers for + % the index (be it as roman numbers) + \hypersetup{pageanchor=false, + bookmarksnumbered=true, + pdfencoding=unicode + } + \pagenumbering{alph} + \begin{titlepage} + \vspace*{7cm} + \begin{center}% + {\Large i\+Var}\\ + \vspace*{1cm} + {\large Generated by Doxygen 1.10.0}\\ + \end{center} + \end{titlepage} + \clearemptydoublepage + \pagenumbering{roman} + \tableofcontents + \clearemptydoublepage + \pagenumbering{arabic} + % re-enable anchors again + \hypersetup{pageanchor=true} %--- Begin generated contents --- -\chapter{Documentation} -\label{index}\hypertarget{index}{}\input{index} -\chapter{Installation} -\label{installpage} -\Hypertarget{installpage} +\input{index} \input{installpage} -\chapter{Manual} -\label{manualpage} -\Hypertarget{manualpage} \input{manualpage} -\chapter{Cookbook} -\label{cookbookpage} -\Hypertarget{cookbookpage} \input{cookbookpage} %--- End generated contents --- - % Index -\backmatter -\newpage -\phantomsection -\clearemptydoublepage -\addcontentsline{toc}{chapter}{Index} -\printindex - + \backmatter + \newpage + \phantomsection + \clearemptydoublepage + \addcontentsline{toc}{chapter}{\indexname} + \printindex +% Required for some languages (in combination with latexdocumentpre from the header) \end{document} diff --git a/docs/latex/tabu_doxygen.sty b/docs/latex/tabu_doxygen.sty new file mode 100644 index 00000000..3f17d1d0 --- /dev/null +++ b/docs/latex/tabu_doxygen.sty @@ -0,0 +1,2557 @@ +%% +%% This is file `tabu.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% tabu.dtx (with options: `package') +%% +%% This is a generated file. +%% Copyright (FC) 2010-2011 - lppl +%% +%% tabu : 2011/02/26 v2.8 - tabu : Flexible LaTeX tabulars +%% +%% ********************************************************************************************** +%% \begin{tabu} { preamble } => default target: \linewidth or \linegoal +%% \begin{tabu} to { preamble } => target specified +%% \begin{tabu} spread { preamble } => target relative to the ``natural width'' +%% +%% tabu works in text and in math modes. +%% +%% X columns: automatic width adjustment + horizontal and vertical alignment +%% \begin{tabu} { X[4c] X[1c] X[-2ml] } +%% +%% Horizontal lines and / or leaders: +%% \hline\hline => double horizontal line +%% \firsthline\hline => for nested tabulars +%% \lasthline\hline => for nested tabulars +%% \tabucline[line spec]{column-column} => ``funny'' lines (dash/leader) +%% Automatic lines / leaders : +%% \everyrow{\hline\hline} +%% +%% Vertical lines and / or leaders: +%% \begin{tabu} { |[3pt red] X[4c] X[1c] X[-2ml] |[3pt blue] } +%% \begin{tabu} { |[3pt red] X[4c] X[1c] X[-2ml] |[3pt on 2pt off 4pt blue] } +%% +%% Fixed vertical spacing adjustment: +%% \extrarowheight= \extrarowdepth= +%% or: \extrarowsep= => may be prefixed by \global +%% +%% Dynamic vertical spacing adjustment: +%% \abovetabulinesep= \belowtabulinesep= +%% or: \tabulinesep= => may be prefixed by \global +%% +%% delarray.sty shortcuts: in math and text modes +%% \begin{tabu} .... \({ preamble }\) +%% +%% Algorithms reports: +%% \tracingtabu=1 \tracingtabu=2 +%% +%% ********************************************************************************************** +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either +%% version 1.3 of this license or (at your option) any later +%% version. The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% +%% This work consists of the main source file tabu.dtx +%% and the derived files +%% tabu.sty, tabu.pdf, tabu.ins +%% +%% tabu : Flexible LaTeX tabulars +%% lppl copyright 2010-2011 by FC +%% + +\NeedsTeXFormat{LaTeX2e}[2005/12/01] +\ProvidesPackage{tabu_doxygen}[2011/02/26 v2.8 - flexible LaTeX tabulars (FC), frozen version for doxygen] +\RequirePackage{array}[2008/09/09] +\RequirePackage{varwidth}[2009/03/30] +\AtEndOfPackage{\tabu@AtEnd \let\tabu@AtEnd \@undefined} +\let\tabu@AtEnd\@empty +\def\TMP@EnsureCode#1={% + \edef\tabu@AtEnd{\tabu@AtEnd + \catcode#1 \the\catcode#1}% + \catcode#1=% +}% \TMP@EnsureCode +\TMP@EnsureCode 33 = 12 % ! +\TMP@EnsureCode 58 = 12 % : (for siunitx) +\TMP@EnsureCode124 = 12 % | +\TMP@EnsureCode 36 = 3 % $ = math shift +\TMP@EnsureCode 38 = 4 % & = tab alignment character +\TMP@EnsureCode 32 = 10 % space +\TMP@EnsureCode 94 = 7 % ^ +\TMP@EnsureCode 95 = 8 % _ +%% Constants -------------------------------------------------------- +\newcount \c@taburow \def\thetaburow {\number\c@taburow} +\newcount \tabu@nbcols +\newcount \tabu@cnt +\newcount \tabu@Xcol +\let\tabu@start \@tempcnta +\let\tabu@stop \@tempcntb +\newcount \tabu@alloc \tabu@alloc=\m@ne +\newcount \tabu@nested +\def\tabu@alloc@{\global\advance\tabu@alloc \@ne \tabu@nested\tabu@alloc} +\newdimen \tabu@target +\newdimen \tabu@spreadtarget +\newdimen \tabu@naturalX +\newdimen \tabucolX +\let\tabu@DELTA \@tempdimc +\let\tabu@thick \@tempdima +\let\tabu@on \@tempdimb +\let\tabu@off \@tempdimc +\newdimen \tabu@Xsum +\newdimen \extrarowdepth +\newdimen \abovetabulinesep +\newdimen \belowtabulinesep +\newdimen \tabustrutrule \tabustrutrule \z@ +\newtoks \tabu@thebody +\newtoks \tabu@footnotes +\newsavebox \tabu@box +\newsavebox \tabu@arstrutbox +\newsavebox \tabu@hleads +\newsavebox \tabu@vleads +\newif \iftabu@colortbl +\newif \iftabu@siunitx +\newif \iftabu@measuring +\newif \iftabu@spread +\newif \iftabu@negcoef +\newif \iftabu@everyrow +\def\tabu@everyrowtrue {\global\let\iftabu@everyrow \iftrue} +\def\tabu@everyrowfalse{\global\let\iftabu@everyrow \iffalse} +\newif \iftabu@long +\newif \iftabuscantokens +\def\tabu@rescan {\tabu@verbatim \scantokens } +%% Utilities (for internal usage) ----------------------------------- +\def\tabu@gobblespace #1 {#1} +\def\tabu@gobbletoken #1#2{#1} +\def\tabu@gobbleX{\futurelet\@let@token \tabu@gobblex} +\def\tabu@gobblex{\if ^^J\noexpand\@let@token \expandafter\@gobble + \else\ifx \@sptoken\@let@token + \expandafter\tabu@gobblespace\expandafter\tabu@gobbleX + \fi\fi +}% \tabu@gobblex +\def\tabu@X{^^J} +{\obeyspaces +\global\let\tabu@spxiii= % saves an active space (for \ifx) +\gdef\tabu@@spxiii{ }} +\def\tabu@ifenvir {% only for \multicolumn + \expandafter\tabu@if@nvir\csname\@currenvir\endcsname +}% \tabu@ifenvir +\def\tabu@if@nvir #1{\csname @\ifx\tabu#1first\else + \ifx\longtabu#1first\else + second\fi\fi oftwo\endcsname +}% \tabu@ifenvir +\def\tabu@modulo #1#2{\numexpr\ifnum\numexpr#1=\z@ 0\else #1-(#1-(#2-1)/2)/(#2)*(#2)\fi} +{\catcode`\&=3 +\gdef\tabu@strtrim #1{% #1 = control sequence to trim + \ifodd 1\ifx #1\@empty \else \ifx #1\space \else 0\fi \fi + \let\tabu@c@l@r \@empty \let#1\@empty + \else \expandafter \tabu@trimspaces #1\@nnil + \fi +}% \tabu@strtrim +\gdef\tabu@trimspaces #1\@nnil{\let\tabu@c@l@r=#2\tabu@firstspace .#1& }% +\gdef\tabu@firstspace #1#2#3 &{\tabu@lastspace #2#3&} +\gdef\tabu@lastspace #1{\def #3{#1}% + \ifx #3\tabu@c@l@r \def\tabu@c@l@r{\protect\color{#1}}\expandafter\remove@to@nnil \fi + \tabu@trimspaces #1\@nnil} +}% \catcode +\def\tabu@sanitizearg #1#2{{% + \csname \ifcsname if@safe@actives\endcsname % + @safe@activestrue\else + relax\fi \endcsname + \edef#2{#1}\tabu@strtrim#2\@onelevel@sanitize#2% + \expandafter}\expandafter\def\expandafter#2\expandafter{#2}% +}% \tabu@sanitizearg +\def\tabu@textbar #1{\begingroup \endlinechar\m@ne \scantokens{\def\:{|}}% + \expandafter\endgroup \expandafter#1\:% !!! semi simple group !!! +}% \tabu@textbar +\def\tabu@everyrow@bgroup{\iftabu@everyrow \begingroup \else \noalign{\ifnum0=`}\fi \fi} +\def\tabu@everyrow@egroup{% + \iftabu@everyrow \expandafter \endgroup \the\toks@ + \else \ifnum0=`{\fi}% + \fi +}% \tabu@everyrow@egroup +\def\tabu@arstrut {\global\setbox\@arstrutbox \hbox{\vrule + height \arraystretch \dimexpr\ht\strutbox+\extrarowheight + depth \arraystretch \dimexpr\dp\strutbox+\extrarowdepth + width \z@}% +}% \tabu@arstrut +\def\tabu@rearstrut {% + \@tempdima \arraystretch\dimexpr\ht\strutbox+\extrarowheight \relax + \@tempdimb \arraystretch\dimexpr\dp\strutbox+\extrarowdepth \relax + \ifodd 1\ifdim \ht\@arstrutbox=\@tempdima + \ifdim \dp\@arstrutbox=\@tempdimb 0 \fi\fi + \tabu@mkarstrut + \fi +}% \tabu@rearstrut +\def\tabu@@DBG #1{\ifdim\tabustrutrule>\z@ \color{#1}\fi} +\def\tabu@DBG@arstrut {\global\setbox\@arstrutbox + \hbox to\z@{\hbox to\z@{\hss + {\tabu@DBG{cyan}\vrule + height \arraystretch \dimexpr\ht\strutbox+\extrarowheight + depth \z@ + width \tabustrutrule}\kern-\tabustrutrule + {\tabu@DBG{pink}\vrule + height \z@ + depth \arraystretch \dimexpr\dp\strutbox+\extrarowdepth + width \tabustrutrule}}}% +}% \tabu@DBG@arstrut +\def\tabu@save@decl{\toks\count@ \expandafter{\the\toks\expandafter\count@ + \@nextchar}}% +\def\tabu@savedecl{\ifcat$\d@llarend\else + \let\save@decl \tabu@save@decl \fi % no inversion of tokens in text mode +}% \tabu@savedecl +\def\tabu@finalstrut #1{\unskip\ifhmode\nobreak\fi\vrule height\z@ depth\z@ width\z@} +\newcommand*\tabuDisableCommands {\g@addto@macro\tabu@trialh@@k } +\let\tabu@trialh@@k \@empty +\def\tabu@nowrite #1#{{\afterassignment}\toks@} +\let\tabu@write\write +\let\tabu@immediate\immediate +\def\tabu@WRITE{\begingroup + \def\immediate\write{\aftergroup\endgroup + \tabu@immediate\tabu@write}% +}% \tabu@WRITE +\expandafter\def\expandafter\tabu@GenericError\expandafter{% + \expandafter\tabu@WRITE\GenericError} +\def\tabu@warn{\tabu@WRITE\PackageWarning{tabu}} +\def\tabu@noxfootnote [#1]{\@gobble} +\def\tabu@nocolor #1#{\@gobble} +\newcommand*\tabu@norowcolor[2][]{} +\def\tabu@maybesiunitx #1{\def\tabu@temp{#1}% + \futurelet\@let@token \tabu@m@ybesiunitx} +\def\tabu@m@ybesiunitx #1{\def\tabu@m@ybesiunitx {% + \ifx #1\@let@token \let\tabu@cellleft \@empty \let\tabu@cellright \@empty \fi + \tabu@temp}% \tabu@m@ybesiunitx +}\expandafter\tabu@m@ybesiunitx \csname siunitx_table_collect_begin:Nn\endcsname +\def\tabu@celllalign@def #1{\def\tabu@celllalign{\tabu@maybesiunitx{#1}}}% +%% Fixed vertical spacing adjustment: \extrarowsep ------------------ +\newcommand*\extrarowsep{\edef\tabu@C@extra{\the\numexpr\tabu@C@extra+1}% + \iftabu@everyrow \aftergroup\tabu@Gextra + \else \aftergroup\tabu@n@Gextra + \fi + \@ifnextchar={\tabu@gobbletoken\tabu@extra} \tabu@extra +}% \extrarowsep +\def\tabu@extra {\@ifnextchar_% + {\tabu@gobbletoken{\tabu@setextra\extrarowheight \extrarowdepth}} + {\ifx ^\@let@token \def\tabu@temp{% + \tabu@gobbletoken{\tabu@setextra\extrarowdepth \extrarowheight}}% + \else \let\tabu@temp \@empty + \afterassignment \tabu@setextrasep \extrarowdepth + \fi \tabu@temp}% +}% \tabu@extra +\def\tabu@setextra #1#2{\def\tabu@temp{\tabu@extr@#1#2}\afterassignment\tabu@temp#2} +\def\tabu@extr@ #1#2{\@ifnextchar^% + {\tabu@gobbletoken{\tabu@setextra\extrarowdepth \extrarowheight}} + {\ifx _\@let@token \def\tabu@temp{% + \tabu@gobbletoken{\tabu@setextra\extrarowheight \extrarowdepth}}% + \else \let\tabu@temp \@empty + \tabu@Gsave \tabu@G@extra \tabu@C@extra \extrarowheight \extrarowdepth + \fi \tabu@temp}% +}% \tabu@extr@ +\def\tabu@setextrasep {\extrarowheight=\extrarowdepth + \tabu@Gsave \tabu@G@extra \tabu@C@extra \extrarowheight \extrarowdepth +}% \tabu@setextrasep +\def\tabu@Gextra{\ifx \tabu@G@extra\@empty \else {\tabu@Rextra}\fi} +\def\tabu@n@Gextra{\ifx \tabu@G@extra\@empty \else \noalign{\tabu@Rextra}\fi} +\def\tabu@Rextra{\tabu@Grestore \tabu@G@extra \tabu@C@extra} +\let\tabu@C@extra \z@ +\let\tabu@G@extra \@empty +%% Dynamic vertical spacing adjustment: \tabulinesep ---------------- +\newcommand*\tabulinesep{\edef\tabu@C@linesep{\the\numexpr\tabu@C@linesep+1}% + \iftabu@everyrow \aftergroup\tabu@Glinesep + \else \aftergroup\tabu@n@Glinesep + \fi + \@ifnextchar={\tabu@gobbletoken\tabu@linesep} \tabu@linesep +}% \tabulinesep +\def\tabu@linesep {\@ifnextchar_% + {\tabu@gobbletoken{\tabu@setsep\abovetabulinesep \belowtabulinesep}} + {\ifx ^\@let@token \def\tabu@temp{% + \tabu@gobbletoken{\tabu@setsep\belowtabulinesep \abovetabulinesep}}% + \else \let\tabu@temp \@empty + \afterassignment \tabu@setlinesep \abovetabulinesep + \fi \tabu@temp}% +}% \tabu@linesep +\def\tabu@setsep #1#2{\def\tabu@temp{\tabu@sets@p#1#2}\afterassignment\tabu@temp#2} +\def\tabu@sets@p #1#2{\@ifnextchar^% + {\tabu@gobbletoken{\tabu@setsep\belowtabulinesep \abovetabulinesep}} + {\ifx _\@let@token \def\tabu@temp{% + \tabu@gobbletoken{\tabu@setsep\abovetabulinesep \belowtabulinesep}}% + \else \let\tabu@temp \@empty + \tabu@Gsave \tabu@G@linesep \tabu@C@linesep \abovetabulinesep \belowtabulinesep + \fi \tabu@temp}% +}% \tabu@sets@p +\def\tabu@setlinesep {\belowtabulinesep=\abovetabulinesep + \tabu@Gsave \tabu@G@linesep \tabu@C@linesep \abovetabulinesep \belowtabulinesep +}% \tabu@setlinesep +\def\tabu@Glinesep{\ifx \tabu@G@linesep\@empty \else {\tabu@Rlinesep}\fi} +\def\tabu@n@Glinesep{\ifx \tabu@G@linesep\@empty \else \noalign{\tabu@Rlinesep}\fi} +\def\tabu@Rlinesep{\tabu@Grestore \tabu@G@linesep \tabu@C@linesep} +\let\tabu@C@linesep \z@ +\let\tabu@G@linesep \@empty +%% \global\extrarowsep and \global\tabulinesep ------------------- +\def\tabu@Gsave #1#2#3#4{\xdef#1{#1% + \toks#2{\toks\the\currentgrouplevel{\global#3\the#3\global#4\the#4}}}% +}% \tabu@Gsave +\def\tabu@Grestore#1#2{% + \toks#2{}#1\toks\currentgrouplevel\expandafter{\expandafter}\the\toks#2\relax + \ifcat$\the\toks\currentgrouplevel$\else + \global\let#1\@empty \global\let#2\z@ + \the\toks\currentgrouplevel + \fi +}% \tabu@Grestore +%% Setting code for every row --------------------------------------- +\newcommand*\everyrow{\tabu@everyrow@bgroup + \tabu@start \z@ \tabu@stop \z@ \tabu@evrstartstop +}% \everyrow +\def\tabu@evrstartstop {\@ifnextchar^% + {\afterassignment \tabu@evrstartstop \tabu@stop=}% + {\ifx ^\@let@token + \afterassignment\tabu@evrstartstop \tabu@start=% + \else \afterassignment\tabu@everyr@w \toks@ + \fi}% +}% \tabu@evrstartstop +\def\tabu@everyr@w {% + \xdef\tabu@everyrow{% + \noexpand\tabu@everyrowfalse + \let\noalign \relax + \noexpand\tabu@rowfontreset + \iftabu@colortbl \noexpand\tabu@rc@ \fi % \taburowcolors + \let\noexpand\tabu@docline \noexpand\tabu@docline@evr + \the\toks@ + \noexpand\tabu@evrh@@k + \noexpand\tabu@rearstrut + \global\advance\c@taburow \@ne}% + \iftabu@everyrow \toks@\expandafter + {\expandafter\def\expandafter\tabu@evr@L\expandafter{\the\toks@}\ignorespaces}% + \else \xdef\tabu@evr@G{\the\toks@}% + \fi + \tabu@everyrow@egroup +}% \tabu@everyr@w +\def\tabu@evr {\def\tabu@evrh@@k} % for internal use only +\tabu@evr{} +%% line style and leaders ------------------------------------------- +\newcommand*\newtabulinestyle [1]{% + {\@for \@tempa :=#1\do{\expandafter\tabu@newlinestyle \@tempa==\@nil}}% +}% \newtabulinestyle +\def\tabu@newlinestyle #1=#2=#3\@nil{\tabu@getline {#2}% + \tabu@sanitizearg {#1}\@tempa + \ifodd 1\ifx \@tempa\@empty \ifdefined\tabu@linestyle@ 0 \fi\fi + \global\expandafter\let + \csname tabu@linestyle@\@tempa \endcsname =\tabu@thestyle \fi +}% \tabu@newlinestyle +\newcommand*\tabulinestyle [1]{\tabu@everyrow@bgroup \tabu@getline{#1}% + \iftabu@everyrow + \toks@\expandafter{\expandafter \def \expandafter + \tabu@ls@L\expandafter{\tabu@thestyle}\ignorespaces}% + \gdef\tabu@ls@{\tabu@ls@L}% + \else + \global\let\tabu@ls@G \tabu@thestyle + \gdef\tabu@ls@{\tabu@ls@G}% + \fi + \tabu@everyrow@egroup +}% \tabulinestyle +\newcommand*\taburulecolor{\tabu@everyrow@bgroup \tabu@textbar \tabu@rulecolor} +\def\tabu@rulecolor #1{\toks@{}% + \def\tabu@temp #1##1#1{\tabu@ruledrsc{##1}}\@ifnextchar #1% + \tabu@temp + \tabu@rulearc +}% \tabu@rulecolor +\def\tabu@ruledrsc #1{\edef\tabu@temp{#1}\tabu@strtrim\tabu@temp + \ifx \tabu@temp\@empty \def\tabu@temp{\tabu@rule@drsc@ {}{}}% + \else \edef\tabu@temp{\noexpand\tabu@rule@drsc@ {}{\tabu@temp}}% + \fi + \tabu@temp +}% \tabu@ruledrsc@ +\def\tabu@ruledrsc@ #1#{\tabu@rule@drsc@ {#1}} +\def\tabu@rule@drsc@ #1#2{% + \iftabu@everyrow + \ifx \\#1#2\\\toks@{\let\CT@drsc@ \relax}% + \else \toks@{\def\CT@drsc@{\color #1{#2}}}% + \fi + \else + \ifx \\#1#2\\\global\let\CT@drsc@ \relax + \else \gdef\CT@drsc@{\color #1{#2}}% + \fi + \fi + \tabu@rulearc +}% \tabu@rule@drsc@ +\def\tabu@rulearc #1#{\tabu@rule@arc@ {#1}} +\def\tabu@rule@arc@ #1#2{% + \iftabu@everyrow + \ifx \\#1#2\\\toks@\expandafter{\the\toks@ \def\CT@arc@{}}% + \else \toks@\expandafter{\the\toks@ \def\CT@arc@{\color #1{#2}}}% + \fi + \toks@\expandafter{\the\toks@ + \let\tabu@arc@L \CT@arc@ + \let\tabu@drsc@L \CT@drsc@ + \ignorespaces}% + \else + \ifx \\#1#2\\\gdef\CT@arc@{}% + \else \gdef\CT@arc@{\color #1{#2}}% + \fi + \global\let\tabu@arc@G \CT@arc@ + \global\let\tabu@drsc@G \CT@drsc@ + \fi + \tabu@everyrow@egroup +}% \tabu@rule@arc@ +\def\taburowcolors {\tabu@everyrow@bgroup \@testopt \tabu@rowcolors 1} +\def\tabu@rowcolors [#1]#2#{\tabu@rowc@lors{#1}{#2}} +\def\tabu@rowc@lors #1#2#3{% + \toks@{}\@defaultunits \count@ =\number0#2\relax \@nnil + \@defaultunits \tabu@start =\number0#1\relax \@nnil + \ifnum \count@<\tw@ \count@=\tw@ \fi + \advance\tabu@start \m@ne + \ifnum \tabu@start<\z@ \tabu@start \z@ \fi + \tabu@rowcolorseries #3\in@..\in@ \@nnil +}% \tabu@rowcolors +\def\tabu@rowcolorseries #1..#2\in@ #3\@nnil {% + \ifx \in@#1\relax + \iftabu@everyrow \toks@{\def\tabu@rc@{}\let\tabu@rc@L \tabu@rc@}% + \else \gdef\tabu@rc@{}\global\let\tabu@rc@G \tabu@rc@ + \fi + \else + \ifx \\#2\\\tabu@rowcolorserieserror \fi + \tabu@sanitizearg{#1}\tabu@temp + \tabu@sanitizearg{#2}\@tempa + \advance\count@ \m@ne + \iftabu@everyrow + \def\tabu@rc@ ##1##2##3##4{\def\tabu@rc@{% + \ifnum ##2=\c@taburow + \definecolorseries{tabu@rcseries@\the\tabu@nested}{rgb}{last}{##3}{##4}\fi + \ifnum \c@taburow<##2 \else + \ifnum \tabu@modulo {\c@taburow-##2}{##1+1}=\z@ + \resetcolorseries[{##1}]{tabu@rcseries@\the\tabu@nested}\fi + \xglobal\colorlet{tabu@rc@\the\tabu@nested}{tabu@rcseries@\the\tabu@nested!!+}% + \rowcolor{tabu@rc@\the\tabu@nested}\fi}% + }\edef\x{\noexpand\tabu@rc@ {\the\count@} + {\the\tabu@start} + {\tabu@temp} + {\@tempa}% + }\x + \toks@\expandafter{\expandafter\def\expandafter\tabu@rc@\expandafter{\tabu@rc@}}% + \toks@\expandafter{\the\toks@ \let\tabu@rc@L \tabu@rc@ \ignorespaces}% + \else % inside \noalign + \definecolorseries{tabu@rcseries@\the\tabu@nested}{rgb}{last}{\tabu@temp}{\@tempa}% + \expandafter\resetcolorseries\expandafter[\the\count@]{tabu@rcseries@\the\tabu@nested}% + \xglobal\colorlet{tabu@rc@\the\tabu@nested}{tabu@rcseries@\the\tabu@nested!!+}% + \let\noalign \relax \rowcolor{tabu@rc@\the\tabu@nested}% + \def\tabu@rc@ ##1##2{\gdef\tabu@rc@{% + \ifnum \tabu@modulo {\c@taburow-##2}{##1+1}=\@ne + \resetcolorseries[{##1}]{tabu@rcseries@\the\tabu@nested}\fi + \xglobal\colorlet{tabu@rc@\the\tabu@nested}{tabu@rcseries@\the\tabu@nested!!+}% + \rowcolor{tabu@rc@\the\tabu@nested}}% + }\edef\x{\noexpand\tabu@rc@{\the\count@}{\the\c@taburow}}\x + \global\let\tabu@rc@G \tabu@rc@ + \fi + \fi + \tabu@everyrow@egroup +}% \tabu@rowcolorseries +\tabuDisableCommands {\let\tabu@rc@ \@empty } +\def\tabu@rowcolorserieserror {\PackageError{tabu} + {Invalid syntax for \string\taburowcolors + \MessageBreak Please look at the documentation!}\@ehd +}% \tabu@rowcolorserieserror +\newcommand*\tabureset {% + \tabulinesep=\z@ \extrarowsep=\z@ \extratabsurround=\z@ + \tabulinestyle{}\everyrow{}\taburulecolor||{}\taburowcolors{}% +}% \tabureset +%% Parsing the line styles ------------------------------------------ +\def\tabu@getline #1{\begingroup + \csname \ifcsname if@safe@actives\endcsname % + @safe@activestrue\else + relax\fi \endcsname + \edef\tabu@temp{#1}\tabu@sanitizearg{#1}\@tempa + \let\tabu@thestyle \relax + \ifcsname tabu@linestyle@\@tempa \endcsname + \edef\tabu@thestyle{\endgroup + \def\tabu@thestyle{\expandafter\noexpand + \csname tabu@linestyle@\@tempa\endcsname}% + }\tabu@thestyle + \else \expandafter\tabu@definestyle \tabu@temp \@nil + \fi +}% \tabu@getline +\def\tabu@definestyle #1#2\@nil {\endlinechar \m@ne \makeatletter + \tabu@thick \maxdimen \tabu@on \maxdimen \tabu@off \maxdimen + \let\tabu@c@lon \@undefined \let\tabu@c@loff \@undefined + \ifodd 1\ifcat .#1\else\ifcat\relax #1\else 0\fi\fi % catcode 12 or non expandable cs + \def\tabu@temp{\tabu@getparam{thick}}% + \else \def\tabu@temp{\tabu@getparam{thick}\maxdimen}% + \fi + {% + \let\tabu@ \relax + \def\:{\obeyspaces \tabu@oXIII \tabu@commaXIII \edef\:}% (space active \: happy ;-)) + \scantokens{\:{\tabu@temp #1#2 \tabu@\tabu@}}% + \expandafter}\expandafter + \def\expandafter\:\expandafter{\:}% line spec rewritten now ;-) + \def\;{\def\:}% + \scantokens\expandafter{\expandafter\;\expandafter{\:}}% space is now inactive (catcode 10) + \let\tabu@ \tabu@getcolor \:% all arguments are ready now ;-) + \ifdefined\tabu@c@lon \else \let\tabu@c@lon\@empty \fi + \ifx \tabu@c@lon\@empty \def\tabu@c@lon{\CT@arc@}\fi + \ifdefined\tabu@c@loff \else \let\tabu@c@loff \@empty \fi + \ifdim \tabu@on=\maxdimen \ifdim \tabu@off<\maxdimen + \tabu@on \tabulineon \fi\fi + \ifdim \tabu@off=\maxdimen \ifdim \tabu@on<\maxdimen + \tabu@off \tabulineoff \fi\fi + \ifodd 1\ifdim \tabu@off=\maxdimen \ifdim \tabu@on=\maxdimen 0 \fi\fi + \in@true % + \else \in@false % + \fi + \ifdim\tabu@thick=\maxdimen \def\tabu@thick{\arrayrulewidth}% + \else \edef\tabu@thick{\the\tabu@thick}% + \fi + \edef \tabu@thestyle ##1##2{\endgroup + \def\tabu@thestyle{% + \ifin@ \noexpand\tabu@leadersstyle {\tabu@thick} + {\the\tabu@on}{##1} + {\the\tabu@off}{##2}% + \else \noexpand\tabu@rulesstyle + {##1\vrule width \tabu@thick}% + {##1\leaders \hrule height \tabu@thick \hfil}% + \fi}% + }\expandafter \expandafter + \expandafter \tabu@thestyle \expandafter + \expandafter \expandafter + {\expandafter\tabu@c@lon\expandafter}\expandafter{\tabu@c@loff}% +}% \tabu@definestyle +{\catcode`\O=\active \lccode`\O=`\o \catcode`\,=\active + \lowercase{\gdef\tabu@oXIII {\catcode`\o=\active \let O=\tabu@oxiii}} + \gdef\tabu@commaXIII {\catcode`\,=\active \let ,=\space} +}% \catcode +\def\tabu@oxiii #1{% + \ifcase \ifx n#1\z@ \else + \ifx f#1\@ne\else + \tw@ \fi\fi + \expandafter\tabu@onxiii + \or \expandafter\tabu@ofxiii + \else o% + \fi#1}% +\def\tabu@onxiii #1#2{% + \ifcase \ifx !#2\tw@ \else + \ifcat.\noexpand#2\z@ \else + \ifx \tabu@spxiii#2\@ne\else + \tw@ \fi\fi\fi + \tabu@getparam{on}#2\expandafter\@gobble + \or \expandafter\tabu@onxiii % (space is active) + \else o\expandafter\@firstofone + \fi{#1#2}}% +\def\tabu@ofxiii #1#2{% + \ifx #2f\expandafter\tabu@offxiii + \else o\expandafter\@firstofone + \fi{#1#2}} +\def\tabu@offxiii #1#2{% + \ifcase \ifx !#2\tw@ \else + \ifcat.\noexpand#2\z@ \else + \ifx\tabu@spxiii#2\@ne \else + \tw@ \fi\fi\fi + \tabu@getparam{off}#2\expandafter\@gobble + \or \expandafter\tabu@offxiii % (space is active) + \else o\expandafter\@firstofone + \fi{#1#2}} +\def\tabu@getparam #1{\tabu@ \csname tabu@#1\endcsname=} +\def\tabu@getcolor #1{% \tabu@ <- \tabu@getcolor after \edef + \ifx \tabu@#1\else % no more spec + \let\tabu@theparam=#1\afterassignment \tabu@getc@l@r #1\fi +}% \tabu@getcolor +\def\tabu@getc@l@r #1\tabu@ {% + \def\tabu@temp{#1}\tabu@strtrim \tabu@temp + \ifx \tabu@temp\@empty + \else%\ifcsname \string\color@\tabu@temp \endcsname % if the color exists + \ifx \tabu@theparam \tabu@off \let\tabu@c@loff \tabu@c@l@r + \else \let\tabu@c@lon \tabu@c@l@r + \fi + %\else \tabu@warncolour{\tabu@temp}% + \fi%\fi + \tabu@ % next spec +}% \tabu@getc@l@r +\def\tabu@warncolour #1{\PackageWarning{tabu} + {Color #1 is not defined. Default color used}% +}% \tabu@warncolour +\def\tabu@leadersstyle #1#2#3#4#5{\def\tabu@leaders{{#1}{#2}{#3}{#4}{#5}}% + \ifx \tabu@leaders\tabu@leaders@G \else + \tabu@LEADERS{#1}{#2}{#3}{#4}{#5}\fi +}% \tabu@leadersstyle +\def\tabu@rulesstyle #1#2{\let\tabu@leaders \@undefined + \gdef\tabu@thevrule{#1}\gdef\tabu@thehrule{#2}% +}% \tabu@rulesstyle +%% The leaders boxes ------------------------------------------------ +\def\tabu@LEADERS #1#2#3#4#5{%% width, dash, dash color, gap, gap color + {\let\color \tabu@color % => during trials -> \color = \tabu@nocolor + {% % but the leaders boxes should have colors ! + \def\@therule{\vrule}\def\@thick{height}\def\@length{width}% + \def\@box{\hbox}\def\@unbox{\unhbox}\def\@elt{\wd}% + \def\@skip{\hskip}\def\@ss{\hss}\def\tabu@leads{\tabu@hleads}% + \tabu@l@@d@rs {#1}{#2}{#3}{#4}{#5}% + \global\let\tabu@thehleaders \tabu@theleaders + }% + {% + \def\@therule{\hrule}\def\@thick{width}\def\@length{height}% + \def\@box{\vbox}\def\@unbox{\unvbox}\def\@elt{\ht}% + \def\@skip{\vskip}\def\@ss{\vss}\def\tabu@leads{\tabu@vleads}% + \tabu@l@@d@rs {#1}{#2}{#3}{#4}{#5}% + \global\let\tabu@thevleaders \tabu@theleaders + }% + \gdef\tabu@leaders@G{{#1}{#2}{#3}{#4}{#5}}% + }% +}% \tabu@LEADERS +\def\tabu@therule #1#2{\@therule \@thick#1\@length\dimexpr#2/2 \@depth\z@} +\def\tabu@l@@d@rs #1#2#3#4#5{%% width, dash, dash color, gap, gap color + \global\setbox \tabu@leads=\@box{% + {#3\tabu@therule{#1}{#2}}% + \ifx\\#5\\\@skip#4\else{#5\tabu@therule{#1}{#4*2}}\fi + {#3\tabu@therule{#1}{#2}}}% + \global\setbox\tabu@leads=\@box to\@elt\tabu@leads{\@ss + {#3\tabu@therule{#1}{#2}}\@unbox\tabu@leads}% + \edef\tabu@theleaders ##1{\def\noexpand\tabu@theleaders {% + {##1\tabu@therule{#1}{#2}}% + \xleaders \copy\tabu@leads \@ss + \tabu@therule{0pt}{-#2}{##1\tabu@therule{#1}{#2}}}% + }\tabu@theleaders{#3}% +}% \tabu@l@@d@rs +%% \tabu \endtabu \tabu* \longtabu \endlongtabu \longtabu* ---------- +\newcommand*\tabu {\tabu@longfalse + \ifmmode \def\tabu@ {\array}\def\endtabu {\endarray}% + \else \def\tabu@ {\tabu@tabular}\def\endtabu {\endtabular}\fi + \expandafter\let\csname tabu*\endcsname \tabu + \expandafter\def\csname endtabu*\endcsname{\endtabu}% + \tabu@spreadfalse \tabu@negcoeffalse \tabu@settarget +}% {tabu} +\let\tabu@tabular \tabular % +\expandafter\def\csname tabu*\endcsname{\tabuscantokenstrue \tabu} +\newcommand*\longtabu {\tabu@longtrue + \ifmmode\PackageError{tabu}{longtabu not allowed in math mode}\fi + \def\tabu@{\longtable}\def\endlongtabu{\endlongtable}% + \LTchunksize=\@M + \expandafter\let\csname tabu*\endcsname \tabu + \expandafter\def\csname endlongtabu*\endcsname{\endlongtabu}% + \let\LT@startpbox \tabu@LT@startpbox % \everypar{ array struts } + \tabu@spreadfalse \tabu@negcoeffalse \tabu@settarget +}% {longtabu} +\expandafter\def\csname longtabu*\endcsname{\tabuscantokenstrue \longtabu} +\def\tabu@nolongtabu{\PackageError{tabu} + {longtabu requires the longtable package}\@ehd} +%% Read the target and then : \tabular or \@array ------------------ +\def\tabu@settarget {\futurelet\@let@token \tabu@sett@rget } +\def\tabu@sett@rget {\tabu@target \z@ + \ifcase \ifx \bgroup\@let@token \z@ \else + \ifx \@sptoken\@let@token \@ne \else + \if t\@let@token \tw@ \else + \if s\@let@token \thr@@\else + \z@\fi\fi\fi\fi + \expandafter\tabu@begin + \or \expandafter\tabu@gobblespace\expandafter\tabu@settarget + \or \expandafter\tabu@to + \or \expandafter\tabu@spread + \fi +}% \tabu@sett@rget +\def\tabu@to to{\def\tabu@halignto{to}\tabu@gettarget} +\def\tabu@spread spread{\tabu@spreadtrue\def\tabu@halignto{spread}\tabu@gettarget} +\def\tabu@gettarget {\afterassignment\tabu@linegoaltarget \tabu@target } +\def\tabu@linegoaltarget {\futurelet\tabu@temp \tabu@linegoalt@rget } +\def\tabu@linegoalt@rget {% + \ifx \tabu@temp\LNGL@setlinegoal + \LNGL@setlinegoal \expandafter \@firstoftwo \fi % @gobbles \LNGL@setlinegoal + \tabu@begin +}% \tabu@linegoalt@rget +\def\tabu@begin #1#{% + \iftabu@measuring \expandafter\tabu@nestedmeasure \fi + \ifdim \tabu@target=\z@ \let\tabu@halignto \@empty + \else \edef\tabu@halignto{\tabu@halignto\the\tabu@target}% + \fi + \@testopt \tabu@tabu@ \tabu@aligndefault #1\@nil +}% \tabu@begin +\long\def\tabu@tabu@ [#1]#2\@nil #3{\tabu@setup + \def\tabu@align {#1}\def\tabu@savedpream{\NC@find #3}% + \tabu@ [\tabu@align ]#2{#3\tabu@rewritefirst }% +}% \tabu@tabu@ +\def\tabu@nestedmeasure {% + \ifodd 1\iftabu@spread \else \ifdim\tabu@target=\z@ \else 0 \fi\fi\relax + \tabu@spreadtrue + \else \begingroup \iffalse{\fi \ifnum0=`}\fi + \toks@{}\def\tabu@stack{b}% + \expandafter\tabu@collectbody\expandafter\tabu@quickrule + \expandafter\endgroup + \fi +}% \tabu@nestedmeasure +\def\tabu@quickrule {\indent\vrule height\z@ depth\z@ width\tabu@target} +%% \tabu@setup \tabu@init \tabu@indent +\def\tabu@setup{\tabu@alloc@ + \ifcase \tabu@nested + \ifmmode \else \iftabu@spread\else \ifdim\tabu@target=\z@ + \let\tabu@afterendpar \par + \fi\fi\fi + \def\tabu@aligndefault{c}\tabu@init \tabu@indent + \else % + \def\tabu@aligndefault{t}\let\tabudefaulttarget \linewidth + \fi + \let\tabu@thetarget \tabudefaulttarget \let\tabu@restored \@undefined + \edef\tabu@NC@list{\the\NC@list}\NC@list{\NC@do \tabu@rewritefirst}% + \everycr{}\let\@startpbox \tabu@startpbox % for nested tabu inside longtabu... + \let\@endpbox \tabu@endpbox % idem " " " " " " + \let\@tabarray \tabu@tabarray % idem " " " " " " + \tabu@setcleanup \tabu@setreset +}% \tabu@setup +\def\tabu@init{\tabu@starttimer \tabu@measuringfalse + \edef\tabu@hfuzz {\the\dimexpr\hfuzz+1sp}\global\tabu@footnotes{}% + \let\firsthline \tabu@firsthline \let\lasthline \tabu@lasthline + \let\firstline \tabu@firstline \let\lastline \tabu@lastline + \let\hline \tabu@hline \let\@xhline \tabu@xhline + \let\color \tabu@color \let\@arstrutbox \tabu@arstrutbox + \iftabu@colortbl\else\let\LT@@hline \tabu@LT@@hline \fi + \tabu@trivlist % + \let\@footnotetext \tabu@footnotetext \let\@xfootnotetext \tabu@xfootnotetext + \let\@xfootnote \tabu@xfootnote \let\centering \tabu@centering + \let\raggedright \tabu@raggedright \let\raggedleft \tabu@raggedleft + \let\tabudecimal \tabu@tabudecimal \let\Centering \tabu@Centering + \let\RaggedRight \tabu@RaggedRight \let\RaggedLeft \tabu@RaggedLeft + \let\justifying \tabu@justifying \let\rowfont \tabu@rowfont + \let\fbox \tabu@fbox \let\color@b@x \tabu@color@b@x + \let\tabu@@everycr \everycr \let\tabu@@everypar \everypar + \let\tabu@prepnext@tokORI \prepnext@tok\let\prepnext@tok \tabu@prepnext@tok + \let\tabu@multicolumnORI\multicolumn \let\multicolumn \tabu@multicolumn + \let\tabu@startpbox \@startpbox % for nested tabu inside longtabu pfff !!! + \let\tabu@endpbox \@endpbox % idem " " " " " " " + \let\tabu@tabarray \@tabarray % idem " " " " " " " + \tabu@adl@fix \let\endarray \tabu@endarray % colortbl & arydshln (delarray) + \iftabu@colortbl\CT@everycr\expandafter{\expandafter\iftabu@everyrow \the\CT@everycr \fi}\fi +}% \tabu@init +\def\tabu@indent{% correction for indentation + \ifdim \parindent>\z@\ifx \linewidth\tabudefaulttarget + \everypar\expandafter{% + \the\everypar\everypar\expandafter{\the\everypar}% + \setbox\z@=\lastbox + \ifdim\wd\z@>\z@ \edef\tabu@thetarget + {\the\dimexpr -\wd\z@+\tabudefaulttarget}\fi + \box\z@}% + \fi\fi +}% \tabu@indent +\def\tabu@setcleanup {% saves last global assignments + \ifodd 1\ifmmode \else \iftabu@long \else 0\fi\fi\relax + \def\tabu@aftergroupcleanup{% + \def\tabu@aftergroupcleanup{\aftergroup\tabu@cleanup}}% + \else + \def\tabu@aftergroupcleanup{% + \aftergroup\aftergroup\aftergroup\tabu@cleanup + \let\tabu@aftergroupcleanup \relax}% + \fi + \let\tabu@arc@Gsave \tabu@arc@G + \let\tabu@arc@G \tabu@arc@L % + \let\tabu@drsc@Gsave \tabu@drsc@G + \let\tabu@drsc@G \tabu@drsc@L % + \let\tabu@ls@Gsave \tabu@ls@G + \let\tabu@ls@G \tabu@ls@L % + \let\tabu@rc@Gsave \tabu@rc@G + \let\tabu@rc@G \tabu@rc@L % + \let\tabu@evr@Gsave \tabu@evr@G + \let\tabu@evr@G \tabu@evr@L % + \let\tabu@celllalign@save \tabu@celllalign + \let\tabu@cellralign@save \tabu@cellralign + \let\tabu@cellleft@save \tabu@cellleft + \let\tabu@cellright@save \tabu@cellright + \let\tabu@@celllalign@save \tabu@@celllalign + \let\tabu@@cellralign@save \tabu@@cellralign + \let\tabu@@cellleft@save \tabu@@cellleft + \let\tabu@@cellright@save \tabu@@cellright + \let\tabu@rowfontreset@save \tabu@rowfontreset + \let\tabu@@rowfontreset@save\tabu@@rowfontreset + \let\tabu@rowfontreset \@empty + \edef\tabu@alloc@save {\the\tabu@alloc}% restore at \tabu@reset + \edef\c@taburow@save {\the\c@taburow}% + \edef\tabu@naturalX@save {\the\tabu@naturalX}% + \let\tabu@naturalXmin@save \tabu@naturalXmin + \let\tabu@naturalXmax@save \tabu@naturalXmax + \let\tabu@mkarstrut@save \tabu@mkarstrut + \edef\tabu@clarstrut{% + \extrarowheight \the\dimexpr \ht\@arstrutbox-\ht\strutbox \relax + \extrarowdepth \the\dimexpr \dp\@arstrutbox-\dp\strutbox \relax + \let\noexpand\@arraystretch \@ne \noexpand\tabu@rearstrut}% +}% \tabu@setcleanup +\def\tabu@cleanup {\begingroup + \globaldefs\@ne \tabu@everyrowtrue + \let\tabu@arc@G \tabu@arc@Gsave + \let\CT@arc@ \tabu@arc@G + \let\tabu@drsc@G \tabu@drsc@Gsave + \let\CT@drsc@ \tabu@drsc@G + \let\tabu@ls@G \tabu@ls@Gsave + \let\tabu@ls@ \tabu@ls@G + \let\tabu@rc@G \tabu@rc@Gsave + \let\tabu@rc@ \tabu@rc@G + \let\CT@do@color \relax + \let\tabu@evr@G \tabu@evr@Gsave + \let\tabu@celllalign \tabu@celllalign@save + \let\tabu@cellralign \tabu@cellralign@save + \let\tabu@cellleft \tabu@cellleft@save + \let\tabu@cellright \tabu@cellright@save + \let\tabu@@celllalign \tabu@@celllalign@save + \let\tabu@@cellralign \tabu@@cellralign@save + \let\tabu@@cellleft \tabu@@cellleft@save + \let\tabu@@cellright \tabu@@cellright@save + \let\tabu@rowfontreset \tabu@rowfontreset@save + \let\tabu@@rowfontreset \tabu@@rowfontreset@save + \tabu@naturalX =\tabu@naturalX@save + \let\tabu@naturalXmax \tabu@naturalXmax@save + \let\tabu@naturalXmin \tabu@naturalXmin@save + \let\tabu@mkarstrut \tabu@mkarstrut@save + \c@taburow =\c@taburow@save + \ifcase \tabu@nested \tabu@alloc \m@ne\fi + \endgroup % + \ifcase \tabu@nested + \the\tabu@footnotes \global\tabu@footnotes{}% + \tabu@afterendpar \tabu@elapsedtime + \fi + \tabu@clarstrut + \everyrow\expandafter {\tabu@evr@G}% +}% \tabu@cleanup +\let\tabu@afterendpar \relax +\def\tabu@setreset {% + \edef\tabu@savedparams {% \relax for \tabu@message@save + \ifmmode \col@sep \the\arraycolsep + \else \col@sep \the\tabcolsep \fi \relax + \arrayrulewidth \the\arrayrulewidth \relax + \doublerulesep \the\doublerulesep \relax + \extratabsurround \the\extratabsurround \relax + \extrarowheight \the\extrarowheight \relax + \extrarowdepth \the\extrarowdepth \relax + \abovetabulinesep \the\abovetabulinesep \relax + \belowtabulinesep \the\belowtabulinesep \relax + \def\noexpand\arraystretch{\arraystretch}% + \ifdefined\minrowclearance \minrowclearance\the\minrowclearance\relax\fi}% + \begingroup + \@temptokena\expandafter{\tabu@savedparams}% => only for \savetabu / \usetabu + \ifx \tabu@arc@L\relax \else \tabu@setsave \tabu@arc@L \fi + \ifx \tabu@drsc@L\relax \else \tabu@setsave \tabu@drsc@L \fi + \tabu@setsave \tabu@ls@L \tabu@setsave \tabu@evr@L + \expandafter \endgroup \expandafter + \def\expandafter\tabu@saved@ \expandafter{\the\@temptokena + \let\tabu@arc@G \tabu@arc@L + \let\tabu@drsc@G \tabu@drsc@L + \let\tabu@ls@G \tabu@ls@L + \let\tabu@rc@G \tabu@rc@L + \let\tabu@evr@G \tabu@evr@L}% + \def\tabu@reset{\tabu@savedparams + \tabu@everyrowtrue \c@taburow \z@ + \let\CT@arc@ \tabu@arc@L + \let\CT@drsc@ \tabu@drsc@L + \let\tabu@ls@ \tabu@ls@L + \let\tabu@rc@ \tabu@rc@L + \global\tabu@alloc \tabu@alloc@save + \everyrow\expandafter{\tabu@evr@L}}% +}% \tabu@reset +\def\tabu@setsave #1{\expandafter\tabu@sets@ve #1\@nil{#1}} +\long\def\tabu@sets@ve #1\@nil #2{\@temptokena\expandafter{\the\@temptokena \def#2{#1}}} +%% The Rewriting Process ------------------------------------------- +\def\tabu@newcolumntype #1{% + \expandafter\tabu@new@columntype + \csname NC@find@\string#1\expandafter\endcsname + \csname NC@rewrite@\string#1\endcsname + {#1}% +}% \tabu@newcolumntype +\def\tabu@new@columntype #1#2#3{% + \def#1##1#3{\NC@{##1}}% + \let#2\relax \newcommand*#2% +}% \tabu@new@columntype +\def\tabu@privatecolumntype #1{% + \expandafter\tabu@private@columntype + \csname NC@find@\string#1\expandafter\endcsname + \csname NC@rewrite@\string#1\expandafter\endcsname + \csname tabu@NC@find@\string#1\expandafter\endcsname + \csname tabu@NC@rewrite@\string#1\endcsname + {#1}% +}% \tabu@privatecolumntype +\def\tabu@private@columntype#1#2#3#4{% + \g@addto@macro\tabu@privatecolumns{\let#1#3\let#2#4}% + \tabu@new@columntype#3#4% +}% \tabu@private@columntype +\let\tabu@privatecolumns \@empty +\newcommand*\tabucolumn [1]{\expandafter \def \expandafter + \tabu@highprioritycolumns\expandafter{\tabu@highprioritycolumns + \NC@do #1}}% +\let\tabu@highprioritycolumns \@empty +%% The | ``column'' : rewriting process -------------------------- +\tabu@privatecolumntype |{\tabu@rewritevline} +\newcommand*\tabu@rewritevline[1][]{\tabu@vlinearg{#1}% + \expandafter \NC@find \tabu@rewritten} +\def\tabu@lines #1{% + \ifx|#1\else \tabu@privatecolumntype #1{\tabu@rewritevline}\fi + \NC@list\expandafter{\the\NC@list \NC@do #1}% +}% \tabu@lines@ +\def\tabu@vlinearg #1{% + \ifx\\#1\\\def\tabu@thestyle {\tabu@ls@}% + \else\tabu@getline {#1}% + \fi + \def\tabu@rewritten ##1{\def\tabu@rewritten{!{##1\tabu@thevline}}% + }\expandafter\tabu@rewritten\expandafter{\tabu@thestyle}% + \expandafter \tabu@keepls \tabu@thestyle \@nil +}% \tabu@vlinearg +\def\tabu@keepls #1\@nil{% + \ifcat $\@cdr #1\@nil $% + \ifx \relax#1\else + \ifx \tabu@ls@#1\else + \let#1\relax + \xdef\tabu@mkpreambuffer{\tabu@mkpreambuffer + \tabu@savels\noexpand#1}\fi\fi\fi +}% \tabu@keepls +\def\tabu@thevline {\begingroup + \ifdefined\tabu@leaders + \setbox\@tempboxa=\vtop to\dimexpr + \ht\@arstrutbox+\dp\@arstrutbox{{\tabu@thevleaders}}% + \ht\@tempboxa=\ht\@arstrutbox \dp\@tempboxa=\dp\@arstrutbox + \box\@tempboxa + \else + \tabu@thevrule + \fi \endgroup +}% \tabu@thevline +\def\tabu@savels #1{% + \expandafter\let\csname\string#1\endcsname #1% + \expandafter\def\expandafter\tabu@reset\expandafter{\tabu@reset + \tabu@resetls#1}}% +\def\tabu@resetls #1{\expandafter\let\expandafter#1\csname\string#1\endcsname}% +%% \multicolumn inside tabu environment ----------------------------- +\tabu@newcolumntype \tabu@rewritemulticolumn{% + \aftergroup \tabu@endrewritemulticolumn % after \@mkpream group + \NC@list{\NC@do *}\tabu@textbar \tabu@lines + \tabu@savedecl + \tabu@privatecolumns + \NC@list\expandafter{\the\expandafter\NC@list \tabu@NC@list}% + \let\tabu@savels \relax + \NC@find +}% \tabu@rewritemulticolumn +\def\tabu@endrewritemulticolumn{\gdef\tabu@mkpreambuffer{}\endgroup} +\def\tabu@multicolumn{\tabu@ifenvir \tabu@multic@lumn \tabu@multicolumnORI} +\long\def\tabu@multic@lumn #1#2#3{\multispan{#1}\begingroup + \tabu@everyrowtrue + \NC@list{\NC@do \tabu@rewritemulticolumn}% + \expandafter\@gobbletwo % gobbles \multispan{#1} + \tabu@multicolumnORI{#1}{\tabu@rewritemulticolumn #2}% + {\iftabuscantokens \tabu@rescan \else \expandafter\@firstofone \fi + {#3}}% +}% \tabu@multic@lumn +%% The X column(s): rewriting process ----------------------------- +\tabu@privatecolumntype X[1][]{\begingroup \tabu@siunitx{\endgroup \tabu@rewriteX {#1}}} +\def\tabu@nosiunitx #1{#1{}{}\expandafter \NC@find \tabu@rewritten } +\def\tabu@siunitx #1{\@ifnextchar \bgroup + {\tabu@rewriteX@Ss{#1}} + {\tabu@nosiunitx{#1}}} +\def\tabu@rewriteX@Ss #1#2{\@temptokena{}% + \@defaultunits \let\tabu@temp =#2\relax\@nnil + \ifodd 1\ifx S\tabu@temp \else \ifx s\tabu@temp \else 0 \fi\fi + \def\NC@find{\def\NC@find >####1####2<####3\relax{#1 {####1}{####3}% + }\expandafter\NC@find \the\@temptokena \relax + }\expandafter\NC@rewrite@S \@gobble #2\relax + \else \tabu@siunitxerror + \fi + \expandafter \NC@find \tabu@rewritten +}% \tabu@rewriteX@Ss +\def\tabu@siunitxerror {\PackageError{tabu}{Not a S nor s column ! + \MessageBreak X column can only embed siunitx S or s columns}\@ehd +}% \tabu@siunitxerror +\def\tabu@rewriteX #1#2#3{\tabu@Xarg {#1}{#2}{#3}% + \iftabu@measuring + \else \tabu@measuringtrue % first X column found in the preamble + \let\@halignto \relax \let\tabu@halignto \relax + \iftabu@spread \tabu@spreadtarget \tabu@target \tabu@target \z@ + \else \tabu@spreadtarget \z@ \fi + \ifdim \tabu@target=\z@ + \setlength\tabu@target \tabu@thetarget + \tabu@message{\tabu@message@defaulttarget}% + \else \tabu@message{\tabu@message@target}\fi + \fi +}% \tabu@rewriteX +\def\tabu@rewriteXrestore #1#2#3{\let\@halignto \relax + \def\tabu@rewritten{l}} +\def\tabu@Xarg #1#2#3{% + \advance\tabu@Xcol \@ne \let\tabu@Xlcr \@empty + \let\tabu@Xdisp \@empty \let\tabu@Xmath \@empty + \ifx\\#1\\% + \def\tabu@rewritten{p}\tabucolX \p@ % + \else + \let\tabu@rewritten \@empty \let\tabu@temp \@empty \tabucolX \z@ + \tabu@Xparse {}#1\relax + \fi + \tabu@Xrewritten{#2}{#3}% +}% \tabu@Xarg +\def\tabu@Xparse #1{\futurelet\@let@token \tabu@Xtest} +\expandafter\def\expandafter\tabu@Xparsespace\space{\tabu@Xparse{}} +\def\tabu@Xtest{% + \ifcase \ifx \relax\@let@token \z@ \else + \if ,\@let@token \m@ne\else + \if p\@let@token 1\else + \if m\@let@token 2\else + \if b\@let@token 3\else + \if l\@let@token 4\else + \if c\@let@token 5\else + \if r\@let@token 6\else + \if j\@let@token 7\else + \if L\@let@token 8\else + \if C\@let@token 9\else + \if R\@let@token 10\else + \if J\@let@token 11\else + \ifx \@sptoken\@let@token 12\else + \if .\@let@token 13\else + \if -\@let@token 13\else + \ifcat $\@let@token 14\else + 15\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\relax + \or \tabu@Xtype {p}% + \or \tabu@Xtype {m}% + \or \tabu@Xtype {b}% + \or \tabu@Xalign \raggedright\relax + \or \tabu@Xalign \centering\relax + \or \tabu@Xalign \raggedleft\relax + \or \tabu@Xalign \tabu@justify\relax + \or \tabu@Xalign \RaggedRight\raggedright + \or \tabu@Xalign \Centering\centering + \or \tabu@Xalign \RaggedLeft\raggedleft + \or \tabu@Xalign \justifying\tabu@justify + \or \expandafter \tabu@Xparsespace + \or \expandafter \tabu@Xcoef + \or \expandafter \tabu@Xm@th + \or \tabu@Xcoef{}% + \else\expandafter \tabu@Xparse + \fi +}% \tabu@Xtest +\def\tabu@Xalign #1#2{% + \ifx \tabu@Xlcr\@empty \else \PackageWarning{tabu} + {Duplicate horizontal alignment specification}\fi + \ifdefined#1\def\tabu@Xlcr{#1}\let#1\relax + \else \def\tabu@Xlcr{#2}\let#2\relax\fi + \expandafter\tabu@Xparse +}% \tabu@Xalign +\def\tabu@Xtype #1{% + \ifx \tabu@rewritten\@empty \else \PackageWarning{tabu} + {Duplicate vertical alignment specification}\fi + \def\tabu@rewritten{#1}\expandafter\tabu@Xparse +}% \tabu@Xtype +\def\tabu@Xcoef#1{\edef\tabu@temp{\tabu@temp#1}% + \afterassignment\tabu@Xc@ef \tabu@cnt\number\if-#10\fi +}% \tabu@Xcoef +\def\tabu@Xc@ef{\advance\tabucolX \tabu@temp\the\tabu@cnt\p@ + \tabu@Xparse{}% +}% \tabu@Xc@ef +\def\tabu@Xm@th #1{\futurelet \@let@token \tabu@Xd@sp} +\def\tabu@Xd@sp{\let\tabu@Xmath=$% + \ifx $\@let@token \def\tabu@Xdisp{\displaystyle}% + \expandafter\tabu@Xparse + \else \expandafter\tabu@Xparse\expandafter{\expandafter}% + \fi +}% \tabu@Xd@sp +\def\tabu@Xrewritten {% + \ifx \tabu@rewritten\@empty \def\tabu@rewritten{p}\fi + \ifdim \tabucolX<\z@ \tabu@negcoeftrue + \else\ifdim \tabucolX=\z@ \tabucolX \p@ + \fi\fi + \edef\tabu@temp{{\the\tabu@Xcol}{\tabu@strippt\tabucolX}}% + \edef\tabu@Xcoefs{\tabu@Xcoefs \tabu@ \tabu@temp}% + \edef\tabu@rewritten ##1##2{\def\noexpand\tabu@rewritten{% + >{\tabu@Xlcr \ifx$\tabu@Xmath$\tabu@Xdisp\fi ##1}% + \tabu@rewritten {\tabu@hsize \tabu@temp}% + <{##2\ifx$\tabu@Xmath$\fi}}% + }\tabu@rewritten +}% \tabu@Xrewritten +\def\tabu@hsize #1#2{% + \ifdim #2\p@<\z@ + \ifdim \tabucolX=\maxdimen \tabu@wd{#1}\else + \ifdim \tabu@wd{#1}<-#2\tabucolX \tabu@wd{#1}\else -#2\tabucolX\fi + \fi + \else #2\tabucolX + \fi +}% \tabu@hsize +%% \usetabu and \preamble: rewriting process --------------------- +\tabu@privatecolumntype \usetabu [1]{% + \ifx\\#1\\\tabu@saveerr{}\else + \@ifundefined{tabu@saved@\string#1} + {\tabu@saveerr{#1}} + {\let\tabu@rewriteX \tabu@rewriteXrestore + \csname tabu@saved@\string#1\expandafter\endcsname\expandafter\@ne}% + \fi +}% \NC@rewrite@\usetabu +\tabu@privatecolumntype \preamble [1]{% + \ifx\\#1\\\tabu@saveerr{}\else + \@ifundefined{tabu@saved@\string#1} + {\tabu@saveerr{#1}} + {\csname tabu@saved@\string#1\expandafter\endcsname\expandafter\z@}% + \fi +}% \NC@rewrite@\preamble +%% Controlling the rewriting process ------------------------------- +\tabu@newcolumntype \tabu@rewritefirst{% + \iftabu@long \aftergroup \tabu@longpream % + \else \aftergroup \tabu@pream + \fi + \let\tabu@ \relax \let\tabu@hsize \relax + \let\tabu@Xcoefs \@empty \let\tabu@savels \relax + \tabu@Xcol \z@ \tabu@cnt \tw@ + \gdef\tabu@mkpreambuffer{\tabu@{}}\tabu@measuringfalse + \global\setbox\@arstrutbox \box\@arstrutbox + \NC@list{\NC@do *}\tabu@textbar \tabu@lines + \NC@list\expandafter{\the\NC@list \NC@do X}% + \iftabu@siunitx % + \NC@list\expandafter{\the\NC@list \NC@do S\NC@do s}\fi + \NC@list\expandafter{\the\expandafter\NC@list \tabu@highprioritycolumns}% + \expandafter\def\expandafter\tabu@NC@list\expandafter{% + \the\expandafter\NC@list \tabu@NC@list}% % * | X S + \NC@list\expandafter{\expandafter \NC@do \expandafter\usetabu + \expandafter \NC@do \expandafter\preamble + \the\NC@list \NC@do \tabu@rewritemiddle + \NC@do \tabu@rewritelast}% + \tabu@savedecl + \tabu@privatecolumns + \edef\tabu@prev{\the\@temptokena}\NC@find \tabu@rewritemiddle +}% NC@rewrite@\tabu@rewritefirst +\tabu@newcolumntype \tabu@rewritemiddle{% + \edef\tabu@temp{\the\@temptokena}\NC@find \tabu@rewritelast +}% \NC@rewrite@\tabu@rewritemiddle +\tabu@newcolumntype \tabu@rewritelast{% + \ifx \tabu@temp\tabu@prev \advance\tabu@cnt \m@ne + \NC@list\expandafter{\tabu@NC@list \NC@do \tabu@rewritemiddle + \NC@do \tabu@rewritelast}% + \else \let\tabu@prev\tabu@temp + \fi + \ifcase \tabu@cnt \expandafter\tabu@endrewrite + \else \expandafter\NC@find \expandafter\tabu@rewritemiddle + \fi +}% \NC@rewrite@\tabu@rewritelast +%% Choosing the strategy -------------------------------------------- +\def\tabu@endrewrite {% + \let\tabu@temp \NC@find + \ifx \@arrayright\relax \let\@arrayright \@empty \fi + \count@=% + \ifx \@finalstrut\tabu@finalstrut \z@ % outer in mode 0 print + \iftabu@measuring + \xdef\tabu@mkpreambuffer{\tabu@mkpreambuffer + \tabu@target \csname tabu@\the\tabu@nested.T\endcsname + \tabucolX \csname tabu@\the\tabu@nested.X\endcsname + \edef\@halignto {\ifx\@arrayright\@empty to\tabu@target\fi}}% + \fi + \else\iftabu@measuring 4 % X columns + \xdef\tabu@mkpreambuffer{\tabu@{\tabu@mkpreambuffer + \tabu@target \the\tabu@target + \tabu@spreadtarget \the\tabu@spreadtarget}% + \def\noexpand\tabu@Xcoefs{\tabu@Xcoefs}% + \edef\tabu@halignto{\ifx \@arrayright\@empty to\tabu@target\fi}}% + \let\tabu@Xcoefs \relax + \else\ifcase\tabu@nested \thr@@ % outer, no X + \global\let\tabu@afterendpar \relax + \else \@ne % inner, no X, outer in mode 1 or 2 + \fi + \ifdefined\tabu@usetabu + \else \ifdim\tabu@target=\z@ + \else \let\tabu@temp \tabu@extracolsep + \fi\fi + \fi + \fi + \xdef\tabu@mkpreambuffer{\count@ \the\count@ \tabu@mkpreambuffer}% + \tabu@temp +}% \tabu@endrewrite +\def\tabu@extracolsep{\@defaultunits \expandafter\let + \expandafter\tabu@temp \expandafter=\the\@temptokena \relax\@nnil + \ifx \tabu@temp\@sptoken + \expandafter\tabu@gobblespace \expandafter\tabu@extracolsep + \else + \edef\tabu@temp{\noexpand\NC@find + \if |\noexpand\tabu@temp @% + \else\if !\noexpand\tabu@temp @% + \else !% + \fi\fi + {\noexpand\extracolsep\noexpand\@flushglue}}% + \fi + \tabu@temp +}% \tabu@extrac@lsep +%% Implementing the strategy ---------------------------------------- +\long\def\tabu@pream #1\@preamble {% + \let\tabu@ \tabu@@ \tabu@mkpreambuffer \tabu@aftergroupcleanup + \NC@list\expandafter {\tabu@NC@list}% in case of nesting... + \ifdefined\tabu@usetabu \tabu@usetabu \tabu@target \z@ \fi + \let\tabu@savedpreamble \@preamble + \global\let\tabu@elapsedtime \relax + \tabu@thebody ={#1\tabu@aftergroupcleanup}% + \tabu@thebody =\expandafter{\the\expandafter\tabu@thebody + \@preamble}% + \edef\tabuthepreamble {\the\tabu@thebody}% ( no @ allowed for \scantokens ) + \tabu@select +}% \tabu@pream +\long\def\tabu@longpream #1\LT@bchunk #2\LT@bchunk{% + \let\tabu@ \tabu@@ \tabu@mkpreambuffer \tabu@aftergroupcleanup + \NC@list\expandafter {\tabu@NC@list}% in case of nesting... + \let\tabu@savedpreamble \@preamble + \global\let\tabu@elapsedtime \relax + \tabu@thebody ={#1\LT@bchunk #2\tabu@aftergroupcleanup \LT@bchunk}% + \edef\tabuthepreamble {\the\tabu@thebody}% ( no @ allowed for \scantokens ) + \tabu@select +}% \tabu@longpream +\def\tabu@select {% + \ifnum\tabu@nested>\z@ \tabuscantokensfalse \fi + \ifnum \count@=\@ne \iftabu@measuring \count@=\tw@ \fi\fi + \ifcase \count@ + \global\let\tabu@elapsedtime \relax + \tabu@seteverycr + \expandafter \tabuthepreamble % vertical adjustment (inherited from outer) + \or % exit in vertical measure + struts per cell because no X and outer in mode 3 + \tabu@evr{\tabu@verticalinit}\tabu@celllalign@def{\tabu@verticalmeasure}% + \def\tabu@cellralign{\tabu@verticalspacing}% + \tabu@seteverycr + \expandafter \tabuthepreamble + \or % exit without measure because no X and outer in mode 4 + \tabu@evr{}\tabu@celllalign@def{}\let\tabu@cellralign \@empty + \tabu@seteverycr + \expandafter \tabuthepreamble + \else % needs trials + \tabu@evr{}\tabu@celllalign@def{}\let\tabu@cellralign \@empty + \tabu@savecounters + \expandafter \tabu@setstrategy + \fi +}% \tabu@select +\def\tabu@@ {\gdef\tabu@mkpreambuffer} +%% Protections to set up before trials ------------------------------ +\def\tabu@setstrategy {\begingroup % + \tabu@trialh@@k \tabu@cnt \z@ % number of trials + \hbadness \@M \let\hbadness \@tempcnta + \hfuzz \maxdimen \let\hfuzz \@tempdima + \let\write \tabu@nowrite\let\GenericError \tabu@GenericError + \let\savetabu \@gobble \let\tabudefaulttarget \linewidth + \let\@footnotetext \@gobble \let\@xfootnote \tabu@xfootnote + \let\color \tabu@nocolor\let\rowcolor \tabu@norowcolor + \let\tabu@aftergroupcleanup \relax % only after the last trial + \tabu@mkpreambuffer + \ifnum \count@>\thr@@ \let\@halignto \@empty \tabucolX@init + \def\tabu@lasttry{\m@ne\p@}\fi + \begingroup \iffalse{\fi \ifnum0=`}\fi + \toks@{}\def\tabu@stack{b}\iftabuscantokens \endlinechar=10 \obeyspaces \fi % + \tabu@collectbody \tabu@strategy % +}% \tabu@setstrategy +\def\tabu@savecounters{% + \def\@elt ##1{\csname c@##1\endcsname\the\csname c@##1\endcsname}% + \edef\tabu@clckpt {\begingroup \globaldefs=\@ne \cl@@ckpt \endgroup}\let\@elt \relax +}% \tabu@savecounters +\def\tabucolX@init {% \tabucolX <= \tabu@target / (sum coefs > 0) + \dimen@ \z@ \tabu@Xsum \z@ \tabucolX \z@ \let\tabu@ \tabu@Xinit \tabu@Xcoefs + \ifdim \dimen@>\z@ + \@tempdima \dimexpr \tabu@target *\p@/\dimen@ + \tabu@hfuzz\relax + \ifdim \tabucolX<\@tempdima \tabucolX \@tempdima \fi + \fi +}% \tabucolX@init +\def\tabu@Xinit #1#2{\tabu@Xcol #1 \advance \tabu@Xsum + \ifdim #2\p@>\z@ #2\p@ \advance\dimen@ #2\p@ + \else -#2\p@ \tabu@negcoeftrue + \@tempdima \dimexpr \tabu@target*\p@/\dimexpr-#2\p@\relax \relax + \ifdim \tabucolX<\@tempdima \tabucolX \@tempdima \fi + \tabu@wddef{#1}{0pt}% + \fi +}% \tabu@Xinit +%% Collecting the environment body ---------------------------------- +\long\def\tabu@collectbody #1#2\end #3{% + \edef\tabu@stack{\tabu@pushbegins #2\begin\end\expandafter\@gobble\tabu@stack}% + \ifx \tabu@stack\@empty + \toks@\expandafter{\expandafter\tabu@thebody\expandafter{\the\toks@ #2}% + \def\tabu@end@envir{\end{#3}}% + \iftabuscantokens + \iftabu@long \def\tabu@endenvir {\end{#3}\tabu@gobbleX}% + \else \def\tabu@endenvir {\let\endarray \@empty + \end{#3}\tabu@gobbleX}% + \fi + \else \def\tabu@endenvir {\end{#3}}\fi}% + \let\tabu@collectbody \tabu@endofcollect + \else\def\tabu@temp{#3}% + \ifx \tabu@temp\@empty \toks@\expandafter{\the\toks@ #2\end }% + \else \ifx\tabu@temp\tabu@@spxiii \toks@\expandafter{\the\toks@ #2\end #3}% + \else \ifx\tabu@temp\tabu@X \toks@\expandafter{\the\toks@ #2\end #3}% + \else \toks@\expandafter{\the\toks@ #2\end{#3}}% + \fi\fi\fi + \fi + \tabu@collectbody{#1}% +}% \tabu@collectbody +\long\def\tabu@pushbegins#1\begin#2{\ifx\end#2\else b\expandafter\tabu@pushbegins\fi}% +\def\tabu@endofcollect #1{\ifnum0=`{}\fi + \expandafter\endgroup \the\toks@ #1% +}% \tabu@endofcollect +%% The trials: switching between strategies ------------------------- +\def\tabu@strategy {\relax % stops \count@ assignment ! + \ifcase\count@ % case 0 = print with vertical adjustment (outer is finished) + \expandafter \tabu@endoftrials + \or % case 1 = exit in vertical measure (outer in mode 3) + \expandafter\xdef\csname tabu@\the\tabu@nested.T\endcsname{\the\tabu@target}% + \expandafter\xdef\csname tabu@\the\tabu@nested.X\endcsname{\the\tabucolX}% + \expandafter \tabu@endoftrials + \or % case 2 = exit with a rule replacing the table (outer in mode 4) + \expandafter \tabu@quickend + \or % case 3 = outer is in mode 3 because of no X + \begingroup + \tabu@evr{\tabu@verticalinit}\tabu@celllalign@def{\tabu@verticalmeasure}% + \def\tabu@cellralign{\tabu@verticalspacing}% + \expandafter \tabu@measuring + \else % case 4 = horizontal measure + \begingroup + \global\let\tabu@elapsedtime \tabu@message@etime + \long\def\multicolumn##1##2##3{\multispan{##1}}% + \let\tabu@startpboxORI \@startpbox + \iftabu@spread + \def\tabu@naturalXmax {\z@}% + \let\tabu@naturalXmin \tabu@naturalXmax + \tabu@evr{\global\tabu@naturalX \z@}% + \let\@startpbox \tabu@startpboxmeasure + \else\iftabu@negcoef + \let\@startpbox \tabu@startpboxmeasure + \else \let\@startpbox \tabu@startpboxquick + \fi\fi + \expandafter \tabu@measuring + \fi +}% \tabu@strategy +\def\tabu@measuring{\expandafter \tabu@trial \expandafter + \count@ \the\count@ \tabu@endtrial +}% \tabu@measuring +\def\tabu@trial{\iftabu@long \tabu@longtrial \else \tabu@shorttrial \fi} +\def\tabu@shorttrial {\setbox\tabu@box \hbox\bgroup \tabu@seteverycr + \ifx \tabu@savecounters\relax \else + \let\tabu@savecounters \relax \tabu@clckpt \fi + $\iftabuscantokens \tabu@rescan \else \expandafter\@secondoftwo \fi + \expandafter{\expandafter \tabuthepreamble + \the\tabu@thebody + \csname tabu@adl@endtrial\endcsname + \endarray}$\egroup % got \tabu@box +}% \tabu@shorttrial +\def\tabu@longtrial {\setbox\tabu@box \hbox\bgroup \tabu@seteverycr + \ifx \tabu@savecounters\relax \else + \let\tabu@savecounters \relax \tabu@clckpt \fi + \iftabuscantokens \tabu@rescan \else \expandafter\@secondoftwo \fi + \expandafter{\expandafter \tabuthepreamble + \the\tabu@thebody + \tabuendlongtrial}\egroup % got \tabu@box +}% \tabu@longtrial +\def\tabuendlongtrial{% no @ allowed for \scantokens + \LT@echunk \global\setbox\@ne \hbox{\unhbox\@ne}\kern\wd\@ne + \LT@get@widths +}% \tabuendlongtrial +\def\tabu@adl@endtrial{% + \crcr \noalign{\global\adl@ncol \tabu@nbcols}}% anything global is crap, junky and fails ! +\def\tabu@seteverycr {\tabu@reset + \everycr \expandafter{\the\everycr \tabu@everycr}% + \let\everycr \tabu@noeverycr % +}% \tabu@seteverycr +\def\tabu@noeverycr{{\aftergroup\tabu@restoreeverycr \afterassignment}\toks@} +\def\tabu@restoreeverycr {\let\everycr \tabu@@everycr} +\def\tabu@everycr {\iftabu@everyrow \noalign{\tabu@everyrow}\fi} +\def\tabu@endoftrials {% + \iftabuscantokens \expandafter\@firstoftwo + \else \expandafter\@secondoftwo + \fi + {\expandafter \tabu@closetrialsgroup \expandafter + \tabu@rescan \expandafter{% + \expandafter\tabuthepreamble + \the\expandafter\tabu@thebody + \iftabu@long \else \endarray \fi}} + {\expandafter\tabu@closetrialsgroup \expandafter + \tabuthepreamble + \the\tabu@thebody}% + \tabu@endenvir % Finish ! +}% \tabu@endoftrials +\def\tabu@closetrialsgroup {% + \toks@\expandafter{\tabu@endenvir}% + \edef\tabu@bufferX{\endgroup + \tabucolX \the\tabucolX + \tabu@target \the\tabu@target + \tabu@cnt \the\tabu@cnt + \def\noexpand\tabu@endenvir{\the\toks@}% + %Quid de \@halignto = \tabu@halignto ?? + }% \tabu@bufferX + \tabu@bufferX + \ifcase\tabu@nested % print out (outer in mode 0) + \global\tabu@cnt \tabu@cnt + \tabu@evr{\tabu@verticaldynamicadjustment}% + \tabu@celllalign@def{\everypar{}}\let\tabu@cellralign \@empty + \let\@finalstrut \tabu@finalstrut + \else % vertical measure of nested tabu + \tabu@evr{\tabu@verticalinit}% + \tabu@celllalign@def{\tabu@verticalmeasure}% + \def\tabu@cellralign{\tabu@verticalspacing}% + \fi + \tabu@clckpt \let\@halignto \tabu@halignto + \let\@halignto \@empty + \tabu@seteverycr + \ifdim \tabustrutrule>\z@ \ifnum\tabu@nested=\z@ + \setbox\@arstrutbox \box\voidb@x % force \@arstrutbox to be rebuilt (visible struts) + \fi\fi +}% \tabu@closetrialsgroup +\def\tabu@quickend {\expandafter \endgroup \expandafter + \tabu@target \the\tabu@target \tabu@quickrule + \let\endarray \relax \tabu@endenvir +}% \tabu@quickend +\def\tabu@endtrial {\relax % stops \count@ assignment ! + \ifcase \count@ \tabu@err % case 0 = impossible here + \or \tabu@err % case 1 = impossible here + \or \tabu@err % case 2 = impossible here + \or % case 3 = outer goes into mode 0 + \def\tabu@bufferX{\endgroup}\count@ \z@ + \else % case 4 = outer goes into mode 3 + \iftabu@spread \tabu@spreadarith % inner into mode 1 (outer in mode 3) + \else \tabu@arith % or 2 (outer in mode 4) + \fi + \count@=% + \ifcase\tabu@nested \thr@@ % outer goes into mode 3 + \else\iftabu@measuring \tw@ % outer is in mode 4 + \else \@ne % outer is in mode 3 + \fi\fi + \edef\tabu@bufferX{\endgroup + \tabucolX \the\tabucolX + \tabu@target \the\tabu@target}% + \fi + \expandafter \tabu@bufferX \expandafter + \count@ \the\count@ \tabu@strategy +}% \tabu@endtrial +\def\tabu@err{\errmessage{(tabu) Internal impossible error! (\count@=\the\count@)}} +%% The algorithms: compute the widths / stop or go on --------------- +\def\tabu@arithnegcoef {% + \@tempdima \z@ \dimen@ \z@ \let\tabu@ \tabu@arith@negcoef \tabu@Xcoefs +}% \tabu@arithnegcoef +\def\tabu@arith@negcoef #1#2{% + \ifdim #2\p@>\z@ \advance\dimen@ #2\p@ % saturated by definition + \advance\@tempdima #2\tabucolX + \else + \ifdim -#2\tabucolX <\tabu@wd{#1}% c_i X < natural width <= \tabu@target-> saturated + \advance\dimen@ -#2\p@ + \advance\@tempdima -#2\tabucolX + \else + \advance\@tempdima \tabu@wd{#1}% natural width <= c_i X => neutralised + \ifdim \tabu@wd{#1}<\tabu@target \else % neutralised + \advance\dimen@ -#2\p@ % saturated (natural width = tabu@target) + \fi + \fi + \fi +}% \tabu@arith@negcoef +\def\tabu@givespace #1#2{% here \tabu@DELTA < \z@ + \ifdim \@tempdima=\z@ + \tabu@wddef{#1}{\the\dimexpr -\tabu@DELTA*\p@/\tabu@Xsum}% + \else + \tabu@wddef{#1}{\the\dimexpr \tabu@hsize{#1}{#2} + *(\p@ -\tabu@DELTA*\p@/\@tempdima)/\p@\relax}% + \fi +}% \tabu@givespace +\def\tabu@arith {\advance\tabu@cnt \@ne + \ifnum \tabu@cnt=\@ne \tabu@message{\tabu@titles}\fi + \tabu@arithnegcoef + \@tempdimb \dimexpr \wd\tabu@box -\@tempdima \relax % + \tabu@DELTA = \dimexpr \wd\tabu@box - \tabu@target \relax + \tabu@message{\tabu@message@arith}% + \ifdim \tabu@DELTA <\tabu@hfuzz + \ifdim \tabu@DELTA<\z@ % wd (tabu)<\tabu@target ? + \let\tabu@ \tabu@givespace \tabu@Xcoefs + \advance\@tempdima \@tempdimb \advance\@tempdima -\tabu@DELTA % for message + \else % already converged: nothing to do but nearly impossible... + \fi + \tabucolX \maxdimen + \tabu@measuringfalse + \else % need for narrower X columns + \tabucolX =\dimexpr (\@tempdima -\tabu@DELTA) *\p@/\tabu@Xsum \relax + \tabu@measuringtrue + \@whilesw \iftabu@measuring\fi {% + \advance\tabu@cnt \@ne + \tabu@arithnegcoef + \tabu@DELTA =\dimexpr \@tempdima+\@tempdimb -\tabu@target \relax % always < 0 here + \tabu@message{\tabu@header + \tabu@msgalign \tabucolX { }{ }{ }{ }{ }\@@ + \tabu@msgalign \@tempdima+\@tempdimb { }{ }{ }{ }{ }\@@ + \tabu@msgalign \tabu@target { }{ }{ }{ }{ }\@@ + \tabu@msgalign@PT \dimen@ { }{}{}{}{}{}{}\@@ + \ifdim -\tabu@DELTA<\tabu@hfuzz \tabu@spaces target ok\else + \tabu@msgalign \dimexpr -\tabu@DELTA *\p@/\dimen@ {}{}{}{}{}\@@ + \fi}% + \ifdim -\tabu@DELTA<\tabu@hfuzz + \advance\@tempdima \@tempdimb % for message + \tabu@measuringfalse + \else + \advance\tabucolX \dimexpr -\tabu@DELTA *\p@/\dimen@ \relax + \fi + }% + \fi + \tabu@message{\tabu@message@reached}% + \edef\tabu@bufferX{\endgroup \tabu@cnt \the\tabu@cnt + \tabucolX \the\tabucolX + \tabu@target \the\tabu@target}% +}% \tabu@arith +\def\tabu@spreadarith {% + \dimen@ \z@ \@tempdima \tabu@naturalXmax \let\tabu@ \tabu@spread@arith \tabu@Xcoefs + \edef\tabu@naturalXmin {\the\dimexpr\tabu@naturalXmin*\dimen@/\p@}% + \@tempdimc =\dimexpr \wd\tabu@box -\tabu@naturalXmax+\tabu@naturalXmin \relax + \iftabu@measuring + \tabu@target =\dimexpr \@tempdimc+\tabu@spreadtarget \relax + \edef\tabu@bufferX{\endgroup \tabucolX \the\tabucolX \tabu@target\the\tabu@target}% + \else + \tabu@message{\tabu@message@spreadarith}% + \ifdim \dimexpr \@tempdimc+\tabu@spreadtarget >\tabu@target + \tabu@message{(tabu) spread + \ifdim \@tempdimc>\tabu@target useless here: default target used% + \else too large: reduced to fit default target\fi.}% + \else + \tabu@target =\dimexpr \@tempdimc+\tabu@spreadtarget \relax + \tabu@message{(tabu) spread: New target set to \the\tabu@target^^J}% + \fi + \begingroup \let\tabu@wddef \@gobbletwo + \@tempdimb \@tempdima + \tabucolX@init + \tabu@arithnegcoef + \wd\tabu@box =\dimexpr \wd\tabu@box +\@tempdima-\@tempdimb \relax + \expandafter\endgroup \expandafter\tabucolX \the\tabucolX + \tabu@arith + \fi +}% \tabu@spreadarith +\def\tabu@spread@arith #1#2{% + \ifdim #2\p@>\z@ \advance\dimen@ #2\p@ + \else \advance\@tempdima \tabu@wd{#1}\relax + \fi +}% \tabu@spread@arith +%% Reporting in the .log file --------------------------------------- +\def\tabu@message@defaulttarget{% + \ifnum\tabu@nested=\z@^^J(tabu) Default target: + \ifx\tabudefaulttarget\linewidth \string\linewidth + \ifdim \tabu@thetarget=\linewidth \else + -\the\dimexpr\linewidth-\tabu@thetarget\fi = + \else\ifx\tabudefaulttarget\linegoal\string\linegoal= + \fi\fi + \else (tabu) Default target (nested): \fi + \the\tabu@target \on@line + \ifnum\tabu@nested=\z@ , page \the\c@page\fi} +\def\tabu@message@target {^^J(tabu) Target specified: + \the\tabu@target \on@line, page \the\c@page} +\def\tabu@message@arith {\tabu@header + \tabu@msgalign \tabucolX { }{ }{ }{ }{ }\@@ + \tabu@msgalign \wd\tabu@box { }{ }{ }{ }{ }\@@ + \tabu@msgalign \tabu@target { }{ }{ }{ }{ }\@@ + \tabu@msgalign@PT \dimen@ { }{}{}{}{}{}{}\@@ + \ifdim \tabu@DELTA<\tabu@hfuzz giving space\else + \tabu@msgalign \dimexpr (\@tempdima-\tabu@DELTA) *\p@/\tabu@Xsum -\tabucolX {}{}{}{}{}\@@ + \fi +}% \tabu@message@arith +\def\tabu@message@spreadarith {\tabu@spreadheader + \tabu@msgalign \tabu@spreadtarget { }{ }{ }{ }{}\@@ + \tabu@msgalign \wd\tabu@box { }{ }{ }{ }{}\@@ + \tabu@msgalign -\tabu@naturalXmax { }{}{}{}{}\@@ + \tabu@msgalign \tabu@naturalXmin { }{ }{ }{ }{}\@@ + \tabu@msgalign \ifdim \dimexpr\@tempdimc>\tabu@target \tabu@target + \else \@tempdimc+\tabu@spreadtarget \fi + {}{}{}{}{}\@@} +\def\tabu@message@negcoef #1#2{ + \tabu@spaces\tabu@spaces\space * #1. X[\rem@pt#2]: + \space width = \tabu@wd {#1} + \expandafter\string\csname tabu@\the\tabu@nested.W\number#1\endcsname + \ifdim -\tabu@pt#2\tabucolX<\tabu@target + < \number-\rem@pt#2 X + = \the\dimexpr -\tabu@pt#2\tabucolX \relax + \else + <= \the\tabu@target\space < \number-\rem@pt#2 X\fi} +\def\tabu@message@reached{\tabu@header + ******* Reached Target: + hfuzz = \tabu@hfuzz\on@line\space *******} +\def\tabu@message@etime{\edef\tabu@stoptime{\the\pdfelapsedtime}% + \tabu@message{(tabu)\tabu@spaces Time elapsed during measure: + \the\numexpr(\tabu@stoptime-\tabu@starttime-32767)/65536\relax sec + \the\numexpr\numexpr(\tabu@stoptime-\tabu@starttime) + -\numexpr(\tabu@stoptime-\tabu@starttime-32767)/65536\relax*65536\relax + *1000/65536\relax ms \tabu@spaces(\the\tabu@cnt\space + cycle\ifnum\tabu@cnt>\@ne s\fi)^^J^^J}} +\def\tabu@message@verticalsp {% + \ifdim \@tempdima>\tabu@ht + \ifdim \@tempdimb>\tabu@dp + \expandafter\expandafter\expandafter\string\tabu@ht = + \tabu@msgalign \@tempdima { }{ }{ }{ }{ }\@@ + \expandafter\expandafter\expandafter\string\tabu@dp = + \tabu@msgalign \@tempdimb { }{ }{ }{ }{ }\@@^^J% + \else + \expandafter\expandafter\expandafter\string\tabu@ht = + \tabu@msgalign \@tempdima { }{ }{ }{ }{ }\@@^^J% + \fi + \else\ifdim \@tempdimb>\tabu@dp + \tabu@spaces\tabu@spaces\tabu@spaces + \expandafter\expandafter\expandafter\string\tabu@dp = + \tabu@msgalign \@tempdimb { }{ }{ }{ }{ }\@@^^J\fi + \fi +}% \tabu@message@verticalsp +\edef\tabu@spaces{\@spaces} +\def\tabu@strippt{\expandafter\tabu@pt\the} +{\@makeother\P \@makeother\T\lowercase{\gdef\tabu@pt #1PT{#1}}} +\def\tabu@msgalign{\expandafter\tabu@msg@align\the\dimexpr} +\def\tabu@msgalign@PT{\expandafter\tabu@msg@align\romannumeral-`\0\tabu@strippt} +\def\do #1{% + \def\tabu@msg@align##1.##2##3##4##5##6##7##8##9\@@{% + \ifnum##1<10 #1 #1\else + \ifnum##1<100 #1 \else + \ifnum##1<\@m #1\fi\fi\fi + ##1.##2##3##4##5##6##7##8#1}% + \def\tabu@header{(tabu) \ifnum\tabu@cnt<10 #1\fi\the\tabu@cnt) }% + \def\tabu@titles{\ifnum \tabu@nested=\z@ + (tabu) Try#1 #1 tabu X #1 #1 #1tabu Width #1 #1 Target + #1 #1 #1 Coefs #1 #1 #1 Update^^J\fi}% + \def\tabu@spreadheader{% + (tabu) Try#1 #1 Spread #1 #1 tabu Width #1 #1 #1 Nat. X #1 #1 #1 #1Nat. Min. + #1 New Target^^J% + (tabu) sprd} + \def\tabu@message@save {\begingroup + \def\x ####1{\tabu@msg@align ####1{ }{ }{ }{ }{}\@@} + \def\z ####1{\expandafter\x\expandafter{\romannumeral-`\0\tabu@strippt + \dimexpr####1\p@{ }{ }}}% + \let\color \relax \def\tabu@rulesstyle ####1####2{\detokenize{####1}}% + \let\CT@arc@ \relax \let\@preamble \@gobble + \let\tabu@savedpream \@firstofone + \let\tabu@savedparams \@firstofone + \def\tabu@target ####1\relax {(tabu) target #1 #1 #1 #1 #1 = \x{####1}^^J}% + \def\tabucolX ####1\relax {(tabu) X columns width#1 = \x{####1}^^J}% + \def\tabu@nbcols ####1\relax {(tabu) Number of columns: \z{####1}^^J}% + \def\tabu@aligndefault ####1{(tabu) Default alignment: #1 #1 ####1^^J}% + \def\col@sep ####1\relax {(tabu) column sep #1 #1 #1 = \x{####1}^^J}% + \def\arrayrulewidth ####1\relax{(tabu) arrayrulewidth #1 = \x{####1}}% + \def\doublerulesep ####1\relax { doublerulesep = \x{####1}^^J}% + \def\extratabsurround####1\relax{(tabu) extratabsurround = \x{####1}^^J}% + \def\extrarowheight ####1\relax{(tabu) extrarowheight #1 = \x{####1}}% + \def\extrarowdepth ####1\relax {extrarowdepth = \x{####1}^^J}% + \def\abovetabulinesep####1\relax{(tabu) abovetabulinesep=\x{####1} }% + \def\belowtabulinesep####1\relax{ belowtabulinesep=\x{####1}^^J}% + \def\arraystretch ####1{(tabu) arraystretch #1 #1 = \z{####1}^^J}% + \def\minrowclearance####1\relax{(tabu) minrowclearance #1 = \x{####1}^^J}% + \def\tabu@arc@L ####1{(tabu) taburulecolor #1 #1 = ####1^^J}% + \def\tabu@drsc@L ####1{(tabu) tabudoublerulecolor= ####1^^J}% + \def\tabu@evr@L ####1{(tabu) everyrow #1 #1 #1 #1 = \detokenize{####1}^^J}% + \def\tabu@ls@L ####1{(tabu) line style = \detokenize{####1}^^J}% + \def\NC@find ####1\@nil{(tabu) tabu preamble#1 #1 = \detokenize{####1}^^J}% + \def\tabu@wddef####1####2{(tabu) Natural width ####1 = \x{####2}^^J}% + \let\edef \@gobbletwo \let\def \@empty \let\let \@gobbletwo + \tabu@message{% + (tabu) \string\savetabu{\tabu@temp}: \on@line^^J% + \tabu@usetabu \@nil^^J}% + \endgroup} +}\do{ } +%% Measuring the natural width (varwidth) - store the results ------- +\def\tabu@startpboxmeasure #1{\bgroup % entering \vtop + \edef\tabu@temp{\expandafter\@secondoftwo \ifx\tabu@hsize #1\else\relax\fi}% + \ifodd 1\ifx \tabu@temp\@empty 0 \else % starts with \tabu@hsize ? + \iftabu@spread \else % if spread -> measure + \ifdim \tabu@temp\p@>\z@ 0 \fi\fi\fi% if coef>0 -> do not measure + \let\@startpbox \tabu@startpboxORI % restore immediately (nesting) + \tabu@measuringtrue % for the quick option... + \tabu@Xcol =\expandafter\@firstoftwo\ifx\tabu@hsize #1\fi + \ifdim \tabu@temp\p@>\z@ \ifdim \tabu@temp\tabucolX<\tabu@target + \tabu@target=\tabu@temp\tabucolX \fi\fi + \setbox\tabu@box \hbox \bgroup + \begin{varwidth}\tabu@target + \let\FV@ListProcessLine \tabu@FV@ListProcessLine % \hbox to natural width... + \narrowragged \arraybackslash \parfillskip \@flushglue + \ifdefined\pdfadjustspacing \pdfadjustspacing\z@ \fi + \bgroup \aftergroup\tabu@endpboxmeasure + \ifdefined \cellspacetoplimit \tabu@cellspacepatch \fi + \else \expandafter\@gobble + \tabu@startpboxquick{#1}% \@gobble \bgroup + \fi +}% \tabu@startpboxmeasure +\def\tabu@cellspacepatch{\def\bcolumn##1\@nil{}\let\ecolumn\@empty + \bgroup\color@begingroup} +\def\tabu@endpboxmeasure {% + \@finalstrut \@arstrutbox + \end{varwidth}\egroup % + \ifdim \tabu@temp\p@ <\z@ % neg coef + \ifdim \tabu@wd\tabu@Xcol <\wd\tabu@box + \tabu@wddef\tabu@Xcol {\the\wd\tabu@box}% + \tabu@debug{\tabu@message@endpboxmeasure}% + \fi + \else % spread coef>0 + \global\advance \tabu@naturalX \wd\tabu@box + \@tempdima =\dimexpr \wd\tabu@box *\p@/\dimexpr \tabu@temp\p@\relax \relax + \ifdim \tabu@naturalXmax <\tabu@naturalX + \xdef\tabu@naturalXmax {\the\tabu@naturalX}\fi + \ifdim \tabu@naturalXmin <\@tempdima + \xdef\tabu@naturalXmin {\the\@tempdima}\fi + \fi + \box\tabu@box \egroup % end of \vtop (measure) restore \tabu@target +}% \tabu@endpboxmeasure +\def\tabu@wddef #1{\expandafter\xdef + \csname tabu@\the\tabu@nested.W\number#1\endcsname} +\def\tabu@wd #1{\csname tabu@\the\tabu@nested.W\number#1\endcsname} +\def\tabu@message@endpboxmeasure{\tabu@spaces\tabu@spaces<-> % <-> save natural wd + \the\tabu@Xcol. X[\tabu@temp]: + target = \the\tabucolX \space + \expandafter\expandafter\expandafter\string\tabu@wd\tabu@Xcol + =\tabu@wd\tabu@Xcol +}% \tabu@message@endpboxmeasure +\def\tabu@startpboxquick {\bgroup + \let\@startpbox \tabu@startpboxORI % restore immediately + \let\tabu \tabu@quick % \begin is expanded before... + \expandafter\@gobble \@startpbox % gobbles \bgroup +}% \tabu@startpboxquick +\def\tabu@quick {\begingroup \iffalse{\fi \ifnum0=`}\fi + \toks@{}\def\tabu@stack{b}\tabu@collectbody \tabu@endquick +}% \tabu@quick +\def\tabu@endquick {% + \ifodd 1\ifx\tabu@end@envir\tabu@endtabu \else + \ifx\tabu@end@envir\tabu@endtabus \else 0\fi\fi\relax + \endgroup + \else \let\endtabu \relax + \tabu@end@envir + \fi +}% \tabu@quick +\def\tabu@endtabu {\end{tabu}} +\def\tabu@endtabus {\end{tabu*}} +%% Measuring the heights and depths - store the results ------------- +\def\tabu@verticalmeasure{\everypar{}% + \ifnum \currentgrouptype>12 % 14=semi-simple, 15=math shift group + \setbox\tabu@box =\hbox\bgroup + \let\tabu@verticalspacing \tabu@verticalsp@lcr + \d@llarbegin % after \hbox ... + \else + \edef\tabu@temp{\ifnum\currentgrouptype=5\vtop + \else\ifnum\currentgrouptype=12\vcenter + \else\vbox\fi\fi}% + \setbox\tabu@box \hbox\bgroup$\tabu@temp \bgroup + \let\tabu@verticalspacing \tabu@verticalsp@pmb + \fi +}% \tabu@verticalmeasure +\def\tabu@verticalsp@lcr{% + \d@llarend \egroup % + \@tempdima \dimexpr \ht\tabu@box+\abovetabulinesep + \@tempdimb \dimexpr \dp\tabu@box+\belowtabulinesep \relax + \ifdim\tabustrutrule>\z@ \tabu@debug{\tabu@message@verticalsp}\fi + \ifdim \tabu@ht<\@tempdima \tabu@htdef{\the\@tempdima}\fi + \ifdim \tabu@dp<\@tempdimb \tabu@dpdef{\the\@tempdimb}\fi + \noindent\vrule height\@tempdima depth\@tempdimb +}% \tabu@verticalsp@lcr +\def\tabu@verticalsp@pmb{% inserts struts as needed + \par \expandafter\egroup + \expandafter$\expandafter + \egroup \expandafter + \@tempdimc \the\prevdepth + \@tempdima \dimexpr \ht\tabu@box+\abovetabulinesep + \@tempdimb \dimexpr \dp\tabu@box+\belowtabulinesep \relax + \ifdim\tabustrutrule>\z@ \tabu@debug{\tabu@message@verticalsp}\fi + \ifdim \tabu@ht<\@tempdima \tabu@htdef{\the\@tempdima}\fi + \ifdim \tabu@dp<\@tempdimb \tabu@dpdef{\the\@tempdimb}\fi + \let\@finalstrut \@gobble + \hrule height\@tempdima depth\@tempdimb width\hsize +%% \box\tabu@box +}% \tabu@verticalsp@pmb + +\def\tabu@verticalinit{% + \ifnum \c@taburow=\z@ \tabu@rearstrut \fi % after \tabu@reset ! + \advance\c@taburow \@ne + \tabu@htdef{\the\ht\@arstrutbox}\tabu@dpdef{\the\dp\@arstrutbox}% + \advance\c@taburow \m@ne +}% \tabu@verticalinit +\def\tabu@htdef {\expandafter\xdef \csname tabu@\the\tabu@nested.H\the\c@taburow\endcsname} +\def\tabu@ht {\csname tabu@\the\tabu@nested.H\the\c@taburow\endcsname} +\def\tabu@dpdef {\expandafter\xdef \csname tabu@\the\tabu@nested.D\the\c@taburow\endcsname} +\def\tabu@dp {\csname tabu@\the\tabu@nested.D\the\c@taburow\endcsname} +\def\tabu@verticaldynamicadjustment {% + \advance\c@taburow \@ne + \extrarowheight \dimexpr\tabu@ht - \ht\strutbox + \extrarowdepth \dimexpr\tabu@dp - \dp\strutbox + \let\arraystretch \@empty + \advance\c@taburow \m@ne +}% \tabu@verticaldynamicadjustment +\def\tabuphantomline{\crcr \noalign{% + {\globaldefs \@ne + \setbox\@arstrutbox \box\voidb@x + \let\tabu@@celllalign \tabu@celllalign + \let\tabu@@cellralign \tabu@cellralign + \let\tabu@@cellleft \tabu@cellleft + \let\tabu@@cellright \tabu@cellright + \let\tabu@@thevline \tabu@thevline + \let\tabu@celllalign \@empty + \let\tabu@cellralign \@empty + \let\tabu@cellright \@empty + \let\tabu@cellleft \@empty + \let\tabu@thevline \relax}% + \edef\tabu@temp{\tabu@multispan \tabu@nbcols{\noindent &}}% + \toks@\expandafter{\tabu@temp \noindent\tabu@everyrowfalse \cr + \noalign{\tabu@rearstrut + {\globaldefs\@ne + \let\tabu@celllalign \tabu@@celllalign + \let\tabu@cellralign \tabu@@cellralign + \let\tabu@cellleft \tabu@@cellleft + \let\tabu@cellright \tabu@@cellright + \let\tabu@thevline \tabu@@thevline}}}% + \expandafter}\the\toks@ +}% \tabuphantomline +%% \firsthline and \lasthline corrections --------------------------- +\def\tabu@firstline {\tabu@hlineAZ \tabu@firsthlinecorrection {}} +\def\tabu@firsthline{\tabu@hlineAZ \tabu@firsthlinecorrection \hline} +\def\tabu@lastline {\tabu@hlineAZ \tabu@lasthlinecorrection {}} +\def\tabu@lasthline {\tabu@hlineAZ \tabu@lasthlinecorrection \hline} +\def\tabu@hline {% replaces \hline if no colortbl (see \AtBeginDocument) + \noalign{\ifnum0=`}\fi + {\CT@arc@\hrule height\arrayrulewidth}% + \futurelet \tabu@temp \tabu@xhline +}% \tabu@hline +\def\tabu@xhline{% + \ifx \tabu@temp \hline + {\ifx \CT@drsc@\relax \vskip + \else\ifx \CT@drsc@\@empty \vskip + \else \CT@drsc@\hrule height + \fi\fi + \doublerulesep}% + \fi + \ifnum0=`{\fi}% +}% \tabu@xhline +\def\tabu@hlineAZ #1#2{\noalign{\ifnum0=`}\fi \dimen@ \z@ \count@ \z@ + \toks@{}\def\tabu@hlinecorrection{#1}\def\tabu@temp{#2}% + \tabu@hlineAZsurround +}% \tabu@hlineAZ +\newcommand*\tabu@hlineAZsurround[1][\extratabsurround]{% + \extratabsurround #1\let\tabucline \tabucline@scan + \let\hline \tabu@hlinescan \let\firsthline \hline + \let\cline \tabu@clinescan \let\lasthline \hline + \expandafter \futurelet \expandafter \tabu@temp + \expandafter \tabu@nexthlineAZ \tabu@temp +}% \tabu@hlineAZsurround +\def\tabu@hlinescan {\tabu@thick \arrayrulewidth \tabu@xhlineAZ \hline} +\def\tabu@clinescan #1{\tabu@thick \arrayrulewidth \tabu@xhlineAZ {\cline{#1}}} +\def\tabucline@scan{\@testopt \tabucline@sc@n {}} +\def\tabucline@sc@n #1[#2]{\tabu@xhlineAZ {\tabucline[{#1}]{#2}}} +\def\tabu@nexthlineAZ{% + \ifx \tabu@temp\hline \else + \ifx \tabu@temp\cline \else + \ifx \tabu@temp\tabucline \else + \tabu@hlinecorrection + \fi\fi\fi +}% \tabu@nexthlineAZ +\def\tabu@xhlineAZ #1{% + \toks@\expandafter{\the\toks@ #1}% + \@tempdimc \tabu@thick % The last line width + \ifcase\count@ \@tempdimb \tabu@thick % The first line width + \else \advance\dimen@ \dimexpr \tabu@thick+\doublerulesep \relax + \fi + \advance\count@ \@ne \futurelet \tabu@temp \tabu@nexthlineAZ +}% \tabu@xhlineAZ +\def\tabu@firsthlinecorrection{% \count@ = number of \hline -1 + \@tempdima \dimexpr \ht\@arstrutbox+\dimen@ + \edef\firsthline{% + \omit \hbox to\z@{\hss{\noexpand\tabu@DBG{yellow}\vrule + height \the\dimexpr\@tempdima+\extratabsurround + depth \dp\@arstrutbox + width \tabustrutrule}\hss}\cr + \noalign{\vskip -\the\dimexpr \@tempdima+\@tempdimb + +\dp\@arstrutbox \relax}% + \the\toks@ + }\ifnum0=`{\fi + \expandafter}\firsthline % we are then ! +}% \tabu@firsthlinecorrection +\def\tabu@lasthlinecorrection{% + \@tempdima \dimexpr \dp\@arstrutbox+\dimen@+\@tempdimb+\@tempdimc + \edef\lasthline{% + \the\toks@ + \noalign{\vskip -\the\dimexpr\dimen@+\@tempdimb+\dp\@arstrutbox}% + \omit \hbox to\z@{\hss{\noexpand\tabu@DBG{yellow}\vrule + depth \the\dimexpr \dp\@arstrutbox+\@tempdimb+\dimen@ + +\extratabsurround-\@tempdimc + height \z@ + width \tabustrutrule}\hss}\cr + }\ifnum0=`{\fi + \expandafter}\lasthline % we are then ! +}% \tabu@lasthlinecorrection +\def\tabu@LT@@hline{% + \ifx\LT@next\hline + \global\let\LT@next \@gobble + \ifx \CT@drsc@\relax + \gdef\CT@LT@sep{% + \noalign{\penalty-\@medpenalty\vskip\doublerulesep}}% + \else + \gdef\CT@LT@sep{% + \multispan\LT@cols{% + \CT@drsc@\leaders\hrule\@height\doublerulesep\hfill}\cr}% + \fi + \else + \global\let\LT@next\empty + \gdef\CT@LT@sep{% + \noalign{\penalty-\@lowpenalty\vskip-\arrayrulewidth}}% + \fi + \ifnum0=`{\fi}% + \multispan\LT@cols + {\CT@arc@\leaders\hrule\@height\arrayrulewidth\hfill}\cr + \CT@LT@sep + \multispan\LT@cols + {\CT@arc@\leaders\hrule\@height\arrayrulewidth\hfill}\cr + \noalign{\penalty\@M}% + \LT@next +}% \tabu@LT@@hline +%% Horizontal lines : \tabucline ------------------------------------ +\let\tabu@start \@tempcnta +\let\tabu@stop \@tempcntb +\newcommand*\tabucline{\noalign{\ifnum0=`}\fi \tabu@cline} +\newcommand*\tabu@cline[2][]{\tabu@startstop{#2}% + \ifnum \tabu@stop<\z@ \toks@{}% + \else \tabu@clinearg{#1}\tabu@thestyle + \edef\tabucline{\toks@{% + \ifnum \tabu@start>\z@ \omit + \tabu@multispan\tabu@start {\span\omit}&\fi + \omit \tabu@multispan\tabu@stop {\span\omit}% + \tabu@thehline\cr + }}\tabucline + \tabu@tracinglines{(tabu:tabucline) Style: #1^^J\the\toks@^^J^^J}% + \fi + \futurelet \tabu@temp \tabu@xcline +}% \tabu@cline +\def\tabu@clinearg #1{% + \ifx\\#1\\\let\tabu@thestyle \tabu@ls@ + \else \@defaultunits \expandafter\let\expandafter\@tempa + \romannumeral-`\0#1\relax \@nnil + \ifx \hbox\@tempa \tabu@clinebox{#1}% + \else\ifx \box\@tempa \tabu@clinebox{#1}% + \else\ifx \vbox\@tempa \tabu@clinebox{#1}% + \else\ifx \vtop\@tempa \tabu@clinebox{#1}% + \else\ifx \copy\@tempa \tabu@clinebox{#1}% + \else\ifx \leaders\@tempa \tabu@clineleads{#1}% + \else\ifx \cleaders\@tempa \tabu@clineleads{#1}% + \else\ifx \xleaders\@tempa \tabu@clineleads{#1}% + \else\tabu@getline {#1}% + \fi\fi\fi\fi\fi\fi\fi\fi + \fi +}% \tabu@clinearg +\def\tabu@clinebox #1{\tabu@clineleads{\xleaders#1\hss}} +\def\tabu@clineleads #1{% + \let\tabu@thestyle \relax \let\tabu@leaders \@undefined + \gdef\tabu@thehrule{#1}} +\def\tabu@thehline{\begingroup + \ifdefined\tabu@leaders + \noexpand\tabu@thehleaders + \else \noexpand\tabu@thehrule + \fi \endgroup +}% \tabu@thehline +\def\tabu@xcline{% + \ifx \tabu@temp\tabucline + \toks@\expandafter{\the\toks@ \noalign + {\ifx\CT@drsc@\relax \vskip + \else \CT@drsc@\hrule height + \fi + \doublerulesep}}% + \fi + \tabu@docline +}% \tabu@xcline +\def\tabu@docline {\ifnum0=`{\fi \expandafter}\the\toks@} +\def\tabu@docline@evr {\xdef\tabu@doclineafter{\the\toks@}% + \ifnum0=`{\fi}\aftergroup\tabu@doclineafter} +\def\tabu@multispan #1#2{% + \ifnum\numexpr#1>\@ne #2\expandafter\tabu@multispan + \else \expandafter\@gobbletwo + \fi {#1-1}{#2}% +}% \tabu@multispan +\def\tabu@startstop #1{\tabu@start@stop #1\relax 1-\tabu@nbcols \@nnil} +\def\tabu@start@stop #1-#2\@nnil{% + \@defaultunits \tabu@start\number 0#1\relax \@nnil + \@defaultunits \tabu@stop \number 0#2\relax \@nnil + \tabu@stop \ifnum \tabu@start>\tabu@nbcols \m@ne + \else\ifnum \tabu@stop=\z@ \tabu@nbcols + \else\ifnum \tabu@stop>\tabu@nbcols \tabu@nbcols + \else \tabu@stop + \fi\fi\fi + \advance\tabu@start \m@ne + \ifnum \tabu@start>\z@ \advance\tabu@stop -\tabu@start \fi +}% \tabu@start@stop +%% Numbers: siunitx S columns (and \tabudecimal) ------------------- +\def\tabu@tabudecimal #1{% + \def\tabu@decimal{#1}\@temptokena{}% + \let\tabu@getdecimal@ \tabu@getdecimal@ignorespaces + \tabu@scandecimal +}% \tabu@tabudecimal +\def\tabu@scandecimal{\futurelet \tabu@temp \tabu@getdecimal@} +\def\tabu@skipdecimal#1{#1\tabu@scandecimal} +\def\tabu@getdecimal@ignorespaces{% + \ifcase 0\ifx\tabu@temp\ignorespaces\else + \ifx\tabu@temp\@sptoken1\else + 2\fi\fi\relax + \let\tabu@getdecimal@ \tabu@getdecimal + \expandafter\tabu@skipdecimal + \or \expandafter\tabu@gobblespace\expandafter\tabu@scandecimal + \else \expandafter\tabu@skipdecimal + \fi +}% \tabu@getdecimal@ignorespaces +\def\tabu@get@decimal#1{\@temptokena\expandafter{\the\@temptokena #1}% + \tabu@scandecimal} +\def\do#1{% + \def\tabu@get@decimalspace#1{% + \@temptokena\expandafter{\the\@temptokena #1}\tabu@scandecimal}% +}\do{ } +\let\tabu@@tabudecimal \tabu@tabudecimal +\def\tabu@getdecimal{% + \ifcase 0\ifx 0\tabu@temp\else + \ifx 1\tabu@temp\else + \ifx 2\tabu@temp\else + \ifx 3\tabu@temp\else + \ifx 4\tabu@temp\else + \ifx 5\tabu@temp\else + \ifx 6\tabu@temp\else + \ifx 7\tabu@temp\else + \ifx 8\tabu@temp\else + \ifx 9\tabu@temp\else + \ifx .\tabu@temp\else + \ifx ,\tabu@temp\else + \ifx -\tabu@temp\else + \ifx +\tabu@temp\else + \ifx e\tabu@temp\else + \ifx E\tabu@temp\else + \ifx\tabu@cellleft\tabu@temp1\else + \ifx\ignorespaces\tabu@temp1\else + \ifx\@sptoken\tabu@temp2\else + 3\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\relax + \expandafter\tabu@get@decimal + \or \expandafter\tabu@skipdecimal + \or \expandafter\tabu@get@decimalspace + \else\expandafter\tabu@printdecimal + \fi +}% \tabu@getdecimal +\def\tabu@printdecimal{% + \edef\tabu@temp{\the\@temptokena}% + \ifx\tabu@temp\@empty\else + \ifx\tabu@temp\space\else + \expandafter\tabu@decimal\expandafter{\the\@temptokena}% + \fi\fi +}% \tabu@printdecimal +%% Verbatim inside X columns ---------------------------------------- +\def\tabu@verbatim{% + \let\verb \tabu@verb + \let\FV@DefineCheckEnd \tabu@FV@DefineCheckEnd +}% \tabu@verbatim +\let\tabu@ltx@verb \verb +\def\tabu@verb{\@ifstar {\tabu@ltx@verb*} \tabu@ltx@verb} +\def\tabu@fancyvrb {% + \def\tabu@FV@DefineCheckEnd ##1{% + \def\tabu@FV@DefineCheckEnd{% + ##1% + \let\FV@CheckEnd \tabu@FV@CheckEnd + \let\FV@@CheckEnd \tabu@FV@@CheckEnd + \let\FV@@@CheckEnd \tabu@FV@@@CheckEnd + \edef\FV@EndScanning{% + \def\noexpand\next{\noexpand\end{\FV@EnvironName}}% + \global\let\noexpand\FV@EnvironName\relax + \noexpand\next}% + \xdef\FV@EnvironName{\detokenize\expandafter{\FV@EnvironName}}}% + }\expandafter\tabu@FV@DefineCheckEnd\expandafter{\FV@DefineCheckEnd} +}% \tabu@fancyvrb +\def\tabu@FV@CheckEnd #1{\expandafter\FV@@CheckEnd \detokenize{#1\end{}}\@nil} +\edef\tabu@FV@@@CheckEnd {\detokenize{\end{}}} +\begingroup +\catcode`\[1 \catcode`\]2 +\@makeother\{ \@makeother\} + \edef\x[\endgroup + \def\noexpand\tabu@FV@@CheckEnd ##1\detokenize[\end{]##2\detokenize[}]##3% + ]\x \@nil{\def\@tempa{#2}\def\@tempb{#3}} +\def\tabu@FV@ListProcessLine #1{% + \hbox {%to \hsize{% + \kern\leftmargin + \hbox {%to \linewidth{% + \FV@LeftListNumber + \FV@LeftListFrame + \FancyVerbFormatLine{#1}\hss +%% DG/SR modification begin - Jan. 28, 1998 (for numbers=right add-on) +%% \FV@RightListFrame}% + \FV@RightListFrame + \FV@RightListNumber}% +%% DG/SR modification end + \hss}} +%% \savetabu -------------------------------------------------------- +\newcommand*\savetabu[1]{\noalign{% + \tabu@sanitizearg{#1}\tabu@temp + \ifx \tabu@temp\@empty \tabu@savewarn{}{The tabu will not be saved}\else + \@ifundefined{tabu@saved@\tabu@temp}{}{\tabu@savewarn{#1}{Overwriting}}% + \ifdefined\tabu@restored \expandafter\let + \csname tabu@saved@\tabu@temp \endcsname \tabu@restored + \else {\tabu@save}% + \fi + \fi}% +}% \savetabu +\def\tabu@save {% + \toks0\expandafter{\tabu@saved@}% + \iftabu@negcoef + \let\tabu@wddef \relax \let\tabu@ \tabu@savewd \edef\tabu@savewd{\tabu@Xcoefs}% + \toks0\expandafter{\the\toks\expandafter0\tabu@savewd}\fi + \toks1\expandafter{\tabu@savedpream}% + \toks2\expandafter{\tabu@savedpreamble}% + \let\@preamble \relax + \let\tabu@savedpream \relax \let\tabu@savedparams \relax + \edef\tabu@preamble{% + \def\noexpand\tabu@aligndefault{\tabu@align}% + \def\tabu@savedparams {\noexpand\the\toks0}% + \def\tabu@savedpream {\noexpand\the\toks1}}% + \edef\tabu@usetabu{% + \def\@preamble {\noexpand\the\toks2}% + \tabu@target \the\tabu@target \relax + \tabucolX \the\tabucolX \relax + \tabu@nbcols \the\tabu@nbcols \relax + \def\noexpand\tabu@aligndefault{\tabu@align}% + \def\tabu@savedparams {\noexpand\the\toks0}% + \def\tabu@savedpream {\noexpand\the\toks1}}% + \let\tabu@aligndefault \relax \let\@sharp \relax + \edef\@tempa{\noexpand\tabu@s@ved + {\tabu@usetabu} + {\tabu@preamble} + {\the\toks1}}\@tempa + \tabu@message@save +}% \tabu@save +\long\def\tabu@s@ved #1#2#3{% + \def\tabu@usetabu{#1}% + \expandafter\gdef\csname tabu@saved@\tabu@temp\endcsname ##1{% + \ifodd ##1% \usetabu + \tabu@measuringfalse \tabu@spreadfalse % Just in case... + \gdef\tabu@usetabu {% + \ifdim \tabu@target>\z@ \tabu@warn@usetabu \fi + \global\let\tabu@usetabu \@undefined + \def\@halignto {to\tabu@target}% + #1% + \ifx \tabu@align\tabu@aligndefault@text + \ifnum \tabu@nested=\z@ + \let\tabu@align \tabu@aligndefault \fi\fi}% + \else % \preamble + \gdef\tabu@preamble {% + \global\let\tabu@preamble \@undefined + #2% + \ifx \tabu@align\tabu@aligndefault@text + \ifnum \tabu@nested=\z@ + \let\tabu@align \tabu@aligndefault \fi\fi}% + \fi + #3}% +}% \tabu@s@ved +\def\tabu@aligndefault@text {\tabu@aligndefault}% +\def\tabu@warn@usetabu {\PackageWarning{tabu} + {Specifying a target with \string\usetabu\space is useless + \MessageBreak The target cannot be changed!}} +\def\tabu@savewd #1#2{\ifdim #2\p@<\z@ \tabu@wddef{#1}{\tabu@wd{#1}}\fi} +\def\tabu@savewarn#1#2{\PackageInfo{tabu} + {User-name `#1' already used for \string\savetabu + \MessageBreak #2}}% +\def\tabu@saveerr#1{\PackageError{tabu} + {User-name `#1' is unknown for \string\usetabu + \MessageBreak I cannot restore an unknown preamble!}\@ehd} +%% \rowfont --------------------------------------------------------- +\newskip \tabu@cellskip +\def\tabu@rowfont{\ifdim \baselineskip=\z@\noalign\fi + {\ifnum0=`}\fi \tabu@row@font} +\newcommand*\tabu@row@font[2][]{% + \ifnum7=\currentgrouptype + \global\let\tabu@@cellleft \tabu@cellleft + \global\let\tabu@@cellright \tabu@cellright + \global\let\tabu@@celllalign \tabu@celllalign + \global\let\tabu@@cellralign \tabu@cellralign + \global\let\tabu@@rowfontreset\tabu@rowfontreset + \fi + \global\let\tabu@rowfontreset \tabu@rowfont@reset + \expandafter\gdef\expandafter\tabu@cellleft\expandafter{\tabu@cellleft #2}% + \ifcsname tabu@cell@#1\endcsname % row alignment + \csname tabu@cell@#1\endcsname \fi + \ifnum0=`{\fi}% end of group / noalign group +}% \rowfont +\def\tabu@ifcolorleavevmode #1{\let\color \tabu@leavevmodecolor #1\let\color\tabu@color}% +\def\tabu@rowfont@reset{% + \global\let\tabu@rowfontreset \tabu@@rowfontreset + \global\let\tabu@cellleft \tabu@@cellleft + \global\let\tabu@cellright \tabu@@cellright + \global\let\tabu@cellfont \@empty + \global\let\tabu@celllalign \tabu@@celllalign + \global\let\tabu@cellralign \tabu@@cellralign +}% \tabu@@rowfontreset +\let\tabu@rowfontreset \@empty % overwritten \AtBeginDocument if colortbl +%% \tabu@prepnext@tok ----------------------------------------------- +\newif \iftabu@cellright +\def\tabu@prepnext@tok{% + \ifnum \count@<\z@ % + \@tempcnta \@M % + \tabu@nbcols\z@ + \let\tabu@fornoopORI \@fornoop + \tabu@cellrightfalse + \else + \ifcase \numexpr \count@-\@tempcnta \relax % (case 0): prev. token is left + \advance \tabu@nbcols \@ne + \iftabu@cellright % before-previous token is right and is finished + \tabu@cellrightfalse % + \tabu@righttok + \fi + \tabu@lefttok + \or % (case 1) previous token is right + \tabu@cellrighttrue \let\@fornoop \tabu@lastnoop + \else % special column: do not change the token + \iftabu@cellright % before-previous token is right + \tabu@cellrightfalse + \tabu@righttok + \fi + \fi % \ifcase + \fi + \tabu@prepnext@tokORI +}% \tabu@prepnext@tok +\long\def\tabu@lastnoop#1\@@#2#3{\tabu@lastn@@p #2\@nextchar \in@\in@@} +\def\tabu@lastn@@p #1\@nextchar #2#3\in@@{% + \ifx \in@#2\else + \let\@fornoop \tabu@fornoopORI + \xdef\tabu@mkpreambuffer{\tabu@nbcols\the\tabu@nbcols \tabu@mkpreambuffer}% + \toks0\expandafter{\expandafter\tabu@everyrowtrue \the\toks0}% + \expandafter\prepnext@tok + \fi +}% \tabu@lastnoop +\def\tabu@righttok{% + \advance \count@ \m@ne + \toks\count@\expandafter {\the\toks\count@ \tabu@cellright \tabu@cellralign}% + \advance \count@ \@ne +}% \tabu@righttok +\def\tabu@lefttok{\toks\count@\expandafter{\expandafter\tabu@celllalign + \the\toks\count@ \tabu@cellleft}% after because of $ +}% \tabu@lefttok +%% Neutralisation of glues ------------------------------------------ +\let\tabu@cellleft \@empty +\let\tabu@cellright \@empty +\tabu@celllalign@def{\tabu@cellleft}% +\let\tabu@cellralign \@empty +\def\tabu@cell@align #1#2#3{% + \let\tabu@maybesiunitx \toks@ \tabu@celllalign + \global \expandafter \tabu@celllalign@def \expandafter {\the\toks@ #1}% + \toks@\expandafter{\tabu@cellralign #2}% + \xdef\tabu@cellralign{\the\toks@}% + \toks@\expandafter{\tabu@cellleft #3}% + \xdef\tabu@cellleft{\the\toks@}% +}% \tabu@cell@align +\def\tabu@cell@l{% force alignment to left + \tabu@cell@align + {\tabu@removehfil \raggedright \tabu@cellleft}% left + {\tabu@flush1\tabu@ignorehfil}% right + \raggedright +}% \tabu@cell@l +\def\tabu@cell@c{% force alignment to center + \tabu@cell@align + {\tabu@removehfil \centering \tabu@flush{.5}\tabu@cellleft} + {\tabu@flush{.5}\tabu@ignorehfil} + \centering +}% \tabu@cell@c +\def\tabu@cell@r{% force alignment to right + \tabu@cell@align + {\tabu@removehfil \raggedleft \tabu@flush1\tabu@cellleft} + \tabu@ignorehfil + \raggedleft +}% \tabu@cell@r +\def\tabu@cell@j{% force justification (for p, m, b columns) + \tabu@cell@align + {\tabu@justify\tabu@cellleft} + {} + \tabu@justify +}% \tabu@cell@j +\def\tabu@justify{% + \leftskip\z@skip \@rightskip\leftskip \rightskip\@rightskip + \parfillskip\@flushglue +}% \tabu@justify +%% ragged2e settings +\def\tabu@cell@L{% force alignment to left (ragged2e) + \tabu@cell@align + {\tabu@removehfil \RaggedRight \tabu@cellleft} + {\tabu@flush 1\tabu@ignorehfil} + \RaggedRight +}% \tabu@cell@L +\def\tabu@cell@C{% force alignment to center (ragged2e) + \tabu@cell@align + {\tabu@removehfil \Centering \tabu@flush{.5}\tabu@cellleft} + {\tabu@flush{.5}\tabu@ignorehfil} + \Centering +}% \tabu@cell@C +\def\tabu@cell@R{% force alignment to right (ragged2e) + \tabu@cell@align + {\tabu@removehfil \RaggedLeft \tabu@flush 1\tabu@cellleft} + \tabu@ignorehfil + \RaggedLeft +}% \tabu@cell@R +\def\tabu@cell@J{% force justification (ragged2e) + \tabu@cell@align + {\justifying \tabu@cellleft} + {} + \justifying +}% \tabu@cell@J +\def\tabu@flush#1{% + \iftabu@colortbl % colortbl uses \hfill rather than \hfil + \hskip \ifnum13<\currentgrouptype \stretch{#1}% + \else \ifdim#1pt<\p@ \tabu@cellskip + \else \stretch{#1} + \fi\fi \relax + \else % array.sty + \ifnum 13<\currentgrouptype + \hfil \hskip1sp \relax \fi + \fi +}% \tabu@flush +\let\tabu@hfil \hfil +\let\tabu@hfill \hfill +\let\tabu@hskip \hskip +\def\tabu@removehfil{% + \iftabu@colortbl + \unkern \tabu@cellskip =\lastskip + \ifnum\gluestretchorder\tabu@cellskip =\tw@ \hskip-\tabu@cellskip + \else \tabu@cellskip \z@skip + \fi + \else + \ifdim\lastskip=1sp\unskip\fi + \ifnum\gluestretchorder\lastskip =\@ne + \hfilneg % \hfilneg for array.sty but not for colortbl... + \fi + \fi +}% \tabu@removehfil +\def\tabu@ignorehfil{\aftergroup \tabu@nohfil} +\def\tabu@nohfil{% \hfil -> do nothing + restore original \hfil + \def\hfil{\let\hfil \tabu@hfil}% local to (alignment template) group +}% \tabu@nohfil +\def\tabu@colortblalignments {% if colortbl + \def\tabu@nohfil{% + \def\hfil {\let\hfil \tabu@hfil}% local to (alignment template) group + \def\hfill {\let\hfill \tabu@hfill}% (colortbl uses \hfill) pfff... + \def\hskip ####1\relax{\let\hskip \tabu@hskip}}% local +}% \tabu@colortblalignments +%% Taking care of footnotes and hyperfootnotes ---------------------- +\long\def\tabu@footnotetext #1{% + \edef\@tempa{\the\tabu@footnotes + \noexpand\footnotetext [\the\csname c@\@mpfn\endcsname]}% + \global\tabu@footnotes\expandafter{\@tempa {#1}}}% +\long\def\tabu@xfootnotetext [#1]#2{% + \global\tabu@footnotes\expandafter{\the\tabu@footnotes + \footnotetext [{#1}]{#2}}} +\let\tabu@xfootnote \@xfootnote +\long\def\tabu@Hy@ftntext{\tabu@Hy@ftntxt {\the \c@footnote }} +\long\def\tabu@Hy@xfootnote [#1]{% + \begingroup + \value\@mpfn #1\relax + \protected@xdef \@thefnmark {\thempfn}% + \endgroup + \@footnotemark \tabu@Hy@ftntxt {#1}% +}% \tabu@Hy@xfootnote +\long\def\tabu@Hy@ftntxt #1#2{% + \edef\@tempa{% + \the\tabu@footnotes + \begingroup + \value\@mpfn #1\relax + \noexpand\protected@xdef\noexpand\@thefnmark {\noexpand\thempfn}% + \expandafter \noexpand \expandafter + \tabu@Hy@footnotetext \expandafter{\Hy@footnote@currentHref}% + }% + \global\tabu@footnotes\expandafter{\@tempa {#2}% + \endgroup}% +}% \tabu@Hy@ftntxt +\long\def\tabu@Hy@footnotetext #1#2{% + \H@@footnotetext{% + \ifHy@nesting + \hyper@@anchor {#1}{#2}% + \else + \Hy@raisedlink{% + \hyper@@anchor {#1}{\relax}% + }% + \def\@currentHref {#1}% + \let\@currentlabelname \@empty + #2% + \fi + }% +}% \tabu@Hy@footnotetext +%% No need for \arraybackslash ! ------------------------------------ +\def\tabu@latextwoe {% +\def\tabu@temp##1##2##3{{\toks@\expandafter{##2##3}\xdef##1{\the\toks@}}} +\tabu@temp \tabu@centering \centering \arraybackslash +\tabu@temp \tabu@raggedleft \raggedleft \arraybackslash +\tabu@temp \tabu@raggedright \raggedright \arraybackslash +}% \tabu@latextwoe +\def\tabu@raggedtwoe {% +\def\tabu@temp ##1##2##3{{\toks@\expandafter{##2##3}\xdef##1{\the\toks@}}} +\tabu@temp \tabu@Centering \Centering \arraybackslash +\tabu@temp \tabu@RaggedLeft \RaggedLeft \arraybackslash +\tabu@temp \tabu@RaggedRight \RaggedRight \arraybackslash +\tabu@temp \tabu@justifying \justifying \arraybackslash +}% \tabu@raggedtwoe +\def\tabu@normalcrbackslash{\let\\\@normalcr} +\def\tabu@trivlist{\expandafter\def\expandafter\@trivlist\expandafter{% + \expandafter\tabu@normalcrbackslash \@trivlist}} +%% Utilities: \fbox \fcolorbox and \tabudecimal ------------------- +\def\tabu@fbox {\leavevmode\afterassignment\tabu@beginfbox \setbox\@tempboxa\hbox} +\def\tabu@beginfbox {\bgroup \kern\fboxsep + \bgroup\aftergroup\tabu@endfbox} +\def\tabu@endfbox {\kern\fboxsep\egroup\egroup + \@frameb@x\relax} +\def\tabu@color@b@x #1#2{\leavevmode \bgroup + \def\tabu@docolor@b@x{#1{#2\color@block{\wd\z@}{\ht\z@}{\dp\z@}\box\z@}}% + \afterassignment\tabu@begincolor@b@x \setbox\z@ \hbox +}% \tabu@color@b@x +\def\tabu@begincolor@b@x {\kern\fboxsep \bgroup + \aftergroup\tabu@endcolor@b@x \set@color} +\def\tabu@endcolor@b@x {\kern\fboxsep \egroup + \dimen@\ht\z@ \advance\dimen@ \fboxsep \ht\z@ \dimen@ + \dimen@\dp\z@ \advance\dimen@ \fboxsep \dp\z@ \dimen@ + \tabu@docolor@b@x \egroup +}% \tabu@endcolor@b@x +%% Corrections (arydshln, delarray, colortbl) ----------------------- +\def\tabu@fix@arrayright {%% \@arrayright is missing from \endarray + \iftabu@colortbl + \ifdefined\adl@array % + \def\tabu@endarray{% + \adl@endarray \egroup \adl@arrayrestore \CT@end \egroup % + \@arrayright % + \gdef\@preamble{}}% + \else % + \def\tabu@endarray{% + \crcr \egroup \egroup % + \@arrayright % + \gdef\@preamble{}\CT@end}% + \fi + \else + \ifdefined\adl@array % + \def\tabu@endarray{% + \adl@endarray \egroup \adl@arrayrestore \egroup % + \@arrayright % + \gdef\@preamble{}}% + \else % + \PackageWarning{tabu} + {\string\@arrayright\space is missing from the + \MessageBreak definition of \string\endarray. + \MessageBreak Compatibility with delarray.sty is broken.}% + \fi\fi +}% \tabu@fix@arrayright +\def\tabu@adl@xarraydashrule #1#2#3{% + \ifnum\@lastchclass=\adl@class@start\else + \ifnum\@lastchclass=\@ne\else + \ifnum\@lastchclass=5 \else % @-arg (class 5) and !-arg (class 1) + \adl@leftrulefalse \fi\fi % must be treated the same + \fi + \ifadl@zwvrule\else \ifadl@inactive\else + \@addtopreamble{\vrule\@width\arrayrulewidth + \@height\z@ \@depth\z@}\fi \fi + \ifadl@leftrule + \@addtopreamble{\adl@vlineL{\CT@arc@}{\adl@dashgapcolor}% + {\number#1}#3}% + \else \@addtopreamble{\adl@vlineR{\CT@arc@}{\adl@dashgapcolor}% + {\number#2}#3} + \fi +}% \tabu@adl@xarraydashrule +\def\tabu@adl@act@endpbox {% + \unskip \ifhmode \nobreak \fi \@finalstrut \@arstrutbox + \egroup \egroup + \adl@colhtdp \box\adl@box \hfil +}% \tabu@adl@act@endpbox +\def\tabu@adl@fix {% + \let\adl@xarraydashrule \tabu@adl@xarraydashrule % arydshln + \let\adl@act@endpbox \tabu@adl@act@endpbox % arydshln + \let\adl@act@@endpbox \tabu@adl@act@endpbox % arydshln + \let\@preamerror \@preamerr % arydshln +}% \tabu@adl@fix +%% Correction for longtable' \@startbox definition ------------------ +%% => \everypar is ``missing'' : TeX should be in vertical mode +\def\tabu@LT@startpbox #1{% + \bgroup + \let\@footnotetext\LT@p@ftntext + \setlength\hsize{#1}% + \@arrayparboxrestore + \everypar{% + \vrule \@height \ht\@arstrutbox \@width \z@ + \everypar{}}% +}% \tabu@LT@startpbox +%% \tracingtabu and the package options ------------------ +\DeclareOption{delarray}{\AtEndOfPackage{\RequirePackage{delarray}}} +\DeclareOption{linegoal}{% + \AtEndOfPackage{% + \RequirePackage{linegoal}[2010/12/07]% + \let\tabudefaulttarget \linegoal% \linegoal is \linewidth if not pdfTeX +}} +\DeclareOption{scantokens}{\tabuscantokenstrue} +\DeclareOption{debugshow}{\AtEndOfPackage{\tracingtabu=\tw@}} +\def\tracingtabu {\begingroup\@ifnextchar=% + {\afterassignment\tabu@tracing\count@} + {\afterassignment\tabu@tracing\count@1\relax}} +\def\tabu@tracing{\expandafter\endgroup + \expandafter\tabu@tr@cing \the\count@ \relax +}% \tabu@tracing +\def\tabu@tr@cing #1\relax {% + \ifnum#1>\thr@@ \let\tabu@tracinglines\message + \else \let\tabu@tracinglines\@gobble + \fi + \ifnum#1>\tw@ \let\tabu@DBG \tabu@@DBG + \def\tabu@mkarstrut {\tabu@DBG@arstrut}% + \tabustrutrule 1.5\p@ + \else \let\tabu@DBG \@gobble + \def\tabu@mkarstrut {\tabu@arstrut}% + \tabustrutrule \z@ + \fi + \ifnum#1>\@ne \let\tabu@debug \message + \else \let\tabu@debug \@gobble + \fi + \ifnum#1>\z@ + \let\tabu@message \message + \let\tabu@tracing@save \tabu@message@save + \let\tabu@starttimer \tabu@pdftimer + \else + \let\tabu@message \@gobble + \let\tabu@tracing@save \@gobble + \let\tabu@starttimer \relax + \fi +}% \tabu@tr@cing +%% Setup \AtBeginDocument +\AtBeginDocument{\tabu@AtBeginDocument} +\def\tabu@AtBeginDocument{\let\tabu@AtBeginDocument \@undefined + \ifdefined\arrayrulecolor \tabu@colortbltrue % + \tabu@colortblalignments % different glues are used + \else \tabu@colortblfalse \fi + \ifdefined\CT@arc@ \else \let\CT@arc@ \relax \fi + \ifdefined\CT@drsc@\else \let\CT@drsc@ \relax \fi + \let\tabu@arc@L \CT@arc@ \let\tabu@drsc@L \CT@drsc@ + \ifodd 1\ifcsname siunitx_table_collect_begin:Nn\endcsname % + \expandafter\ifx + \csname siunitx_table_collect_begin:Nn\endcsname\relax 0\fi\fi\relax + \tabu@siunitxtrue + \else \let\tabu@maybesiunitx \@firstofone % + \let\tabu@siunitx \tabu@nosiunitx + \tabu@siunitxfalse + \fi + \ifdefined\adl@array % + \else \let\tabu@adl@fix \relax + \let\tabu@adl@endtrial \@empty \fi + \ifdefined\longtable % + \else \let\longtabu \tabu@nolongtabu \fi + \ifdefined\cellspacetoplimit \tabu@warn@cellspace\fi + \csname\ifcsname ifHy@hyperfootnotes\endcsname % + ifHy@hyperfootnotes\else iffalse\fi\endcsname + \let\tabu@footnotetext \tabu@Hy@ftntext + \let\tabu@xfootnote \tabu@Hy@xfootnote \fi + \ifdefined\FV@DefineCheckEnd% + \tabu@fancyvrb \fi + \ifdefined\color % + \let\tabu@color \color + \def\tabu@leavevmodecolor ##1{% + \def\tabu@leavevmodecolor {\leavevmode ##1}% + }\expandafter\tabu@leavevmodecolor\expandafter{\color}% + \else + \let\tabu@color \tabu@nocolor + \let\tabu@leavevmodecolor \@firstofone \fi + \tabu@latextwoe + \ifdefined\@raggedtwoe@everyselectfont % + \tabu@raggedtwoe + \else + \let\tabu@cell@L \tabu@cell@l + \let\tabu@cell@R \tabu@cell@r + \let\tabu@cell@C \tabu@cell@c + \let\tabu@cell@J \tabu@cell@j \fi + \expandafter\in@ \expandafter\@arrayright \expandafter{\endarray}% + \ifin@ \let\tabu@endarray \endarray + \else \tabu@fix@arrayright \fi% + \everyrow{}% +}% \tabu@AtBeginDocument +\def\tabu@warn@cellspace{% + \PackageWarning{tabu}{% + Package cellspace has some limitations + \MessageBreak And redefines some macros of array.sty. + \MessageBreak Please use \string\tabulinesep\space to control + \MessageBreak vertical spacing of lines inside tabu environment}% +}% \tabu@warn@cellspace +%% tabu Package initialisation +\tabuscantokensfalse +\let\tabu@arc@G \relax +\let\tabu@drsc@G \relax +\let\tabu@evr@G \@empty +\let\tabu@rc@G \@empty +\def\tabu@ls@G {\tabu@linestyle@}% +\let\tabu@@rowfontreset \@empty % +\let\tabu@@celllalign \@empty +\let\tabu@@cellralign \@empty +\let\tabu@@cellleft \@empty +\let\tabu@@cellright \@empty +\def\tabu@naturalXmin {\z@} +\def\tabu@naturalXmax {\z@} +\let\tabu@rowfontreset \@empty +\def\tabulineon {4pt}\let\tabulineoff \tabulineon +\tabu@everyrowtrue +\ifdefined\pdfelapsedtime % + \def\tabu@pdftimer {\xdef\tabu@starttime{\the\pdfelapsedtime}}% +\else \let\tabu@pdftimer \relax \let\tabu@message@etime \relax +\fi +\tracingtabu=\z@ +\newtabulinestyle {=\maxdimen}% creates the 'factory' settings \tabu@linestyle@ +\tabulinestyle{} +\taburowcolors{} +\let\tabudefaulttarget \linewidth +\ProcessOptions* % \ProcessOptions* is quicker ! +\endinput +%% +%% End of file `tabu.sty'. diff --git a/docs/man/man3/cookbookpage.3 b/docs/man/man3/cookbookpage.3 index e98e49cd..a1908f3f 100644 --- a/docs/man/man3/cookbookpage.3 +++ b/docs/man/man3/cookbookpage.3 @@ -1,11 +1,14 @@ -.TH "cookbookpage" 3 "Fri Jun 19 2020" "iVar" \" -*- nroff -*- +.TH "cookbookpage" 3 "iVar" \" -*- nroff -*- .ad l .nh .SH NAME cookbookpage \- Cookbook -Two pipelines to call iSNVs from known and unknown reference sequences have been written in \fCsnakemake\fP\&. .PP -The two pipelines are distributed along with iVar and are present in the\fCpipeline/\fP and \fCpipeline_field/\fP fodlers respectively\&. + +.PP +Two pipelines to call iSNVs from known and unknown reference sequences have been written in \fRsnakemake\fP\&. +.PP +The two pipelines are distributed along with iVar and are present in the\fRpipeline/\fP and \fRpipeline_field/\fP fodlers respectively\&. .PP For both pipelines, there are four parameters that will have to be set in beginning of the Snakefile\&. .PP @@ -13,7 +16,7 @@ For both pipelines, there are four parameters that will have to be set in beginn .nf in_dir = "" out_dir = "" -bed = "" +bed = "" ref="" .fi .PP @@ -21,35 +24,35 @@ ref="" .PP .SS "Call iSNVs from samples with known reference sequence" .PP -\fCLink to Jupyter Notebook\fP +\fRLink to Jupyter Notebook\fP .PP -\fCLink to pipeline\fP +\fRLink to pipeline\fP .PP .SS "Dependencies:" .PP .IP "\(bu" 2 -\fCiVar\fP +\fRiVar\fP .IP "\(bu" 2 -\fCsamtools\fP +\fRsamtools\fP .IP "\(bu" 2 -\fCbwa\fP +\fRbwa\fP .IP "\(bu" 2 -\fCbedtools\fP +\fRbedtools\fP .PP .PP .SS "Call iSNVs from samples with unknown reference sequence" .PP -\fCLink to pipeline\fP +\fRLink to pipeline\fP .PP .SS "Dependencies:" .PP .IP "\(bu" 2 -\fCiVar\fP +\fRiVar\fP .IP "\(bu" 2 -\fCsamtools\fP +\fRsamtools\fP .IP "\(bu" 2 -\fCbwa\fP +\fRbwa\fP .IP "\(bu" 2 -\fCbedtools\fP +\fRbedtools\fP .PP diff --git a/docs/man/man3/installpage.3 b/docs/man/man3/installpage.3 index 0562ba70..edd3582f 100644 --- a/docs/man/man3/installpage.3 +++ b/docs/man/man3/installpage.3 @@ -1,30 +1,32 @@ -.TH "installpage" 3 "Fri Jun 19 2020" "iVar" \" -*- nroff -*- +.TH "installpage" 3 "iVar" \" -*- nroff -*- .ad l .nh .SH NAME installpage \- Installation +.PP +.PP .SS "Dependencies" .PP .IP "\(bu" 2 -\fCHTSlib\fP +\fRHTSlib\fP .IP "\(bu" 2 -\fCGCC\fP any version after v5\&.0\&. Support for c++11 standard required\&. +\fRGCC\fP any version after v5\&.0\&. Support for c++11 standard required\&. .PP .PP Note: .IP "\(bu" 2 -It is highly recommended that \fCsamtools\fP also be installed alongside iVar\&. iVar uses the output of samtools mpileup to call variants and generate consensus sequences\&. In addition, samtools \fCsort\fP and \fCindex\fP commands are very useful to setup a pipeline using iVar\&. +It is highly recommended that \fRsamtools\fP also be installed alongside iVar\&. iVar uses the output of samtools mpileup to call variants and generate consensus sequences\&. In addition, samtools \fRsort\fP and \fRindex\fP commands are very useful to setup a pipeline using iVar\&. .PP .SH "Installing via conda" .PP -iVar is available on bioconda\&. To install conda, please use the \fCminiconda\fP package\&. After intalling conda please add the following channels, +iVar is available on bioconda\&. To install conda, please use the \fRminiconda\fP package\&. After intalling conda please add the following channels, .PP .PP .nf -conda config --add channels defaults -conda config --add channels bioconda -conda config --add channels conda-forge +conda config \-\-add channels defaults +conda config \-\-add channels bioconda +conda config \-\-add channels conda\-forge .fi .PP .PP @@ -36,7 +38,7 @@ conda install ivar .fi .PP .SS "Installing via homebrew" -iVar can be installed using \fCHomebrew\fP\&. +iVar can be installed using \fRHomebrew\fP\&. .PP .PP .nf @@ -46,17 +48,17 @@ brew install brewsci/bio/ivar .SH "Installing on Mac" .PP .SS "Installing build tools" -\fCXcode\fP from Apple is required to compile iVar (and other tools) from source\&. If you don't want to install the full Xcode package from the AppStore, you can install the Xcode command line tools, +\fRXcode\fP from Apple is required to compile iVar (and other tools) from source\&. If you don't want to install the full Xcode package from the AppStore, you can install the Xcode command line tools, .PP .PP .nf -xcode-select --install +xcode\-select \-\-install .fi .PP .PP -\fCGNU Autotools\fP is required to compile iVar from source\&. +\fRGNU Autotools\fP is required to compile iVar from source\&. .PP -To install Autotools using \fChomebrew\fP please use the command below, +To install Autotools using \fRhomebrew\fP please use the command below, .PP .PP .nf @@ -64,11 +66,11 @@ brew install autoconf automake libtool .fi .PP .SS "HTSlib installed using conda" -HTSlib can be installed with \fCconda\fP using the command, +HTSlib can be installed with \fRconda\fP using the command, .PP .PP .nf -conda install -c bioconda htslib +conda install \-c bioconda htslib .fi .PP .PP @@ -113,12 +115,12 @@ make install .PP If HTSlib was installed using conda, please run the following commands by supplying the prefix to the bin folder of the conda binary\&. .PP -The prefix to the bin folder can be found using the command \fCwhich conda\fP\&. The output of the command will be in this format - /opt/conda/bin/conda or /opt/anaconda2/bin/conda or /opt/anaconda3/bin/conda depending on whether you installed miniconda or anaconda\&. For example, if the output of the command is /opt/conda/bin/conda, the prefix to the htslib bin folder will be /opt/conda\&. This can be supplied to \&./configure --with-hts=/opt/conda\&. +The prefix to the bin folder can be found using the command \fRwhich conda\fP\&. The output of the command will be in this format - /opt/conda/bin/conda or /opt/anaconda2/bin/conda or /opt/anaconda3/bin/conda depending on whether you installed miniconda or anaconda\&. For example, if the output of the command is /opt/conda/bin/conda, the prefix to the htslib bin folder will be /opt/conda\&. This can be supplied to \&./configure --with-hts=/opt/conda\&. .PP .PP .nf \&./autogen\&.sh -\&./configure --with-hts=/prefix/to/bin/folder/with/HTSlib +\&./configure \-\-with\-hts=/prefix/to/bin/folder/with/HTSlib make make install .fi @@ -129,39 +131,39 @@ If HTSlib was installed in a non standard location, please run the following com .PP .nf \&./autogen\&.sh -\&./configure --with-hts=/prefix/to/bin/folder/with/HTSlib +\&./configure \-\-with\-hts=/prefix/to/bin/folder/with/HTSlib make make install .fi .PP .PP -To test installation just run, \fCivar version\fP and you should get the following output, +To test installation just run, \fRivar version\fP and you should get the following output, .PP .PP .nf iVar version 1\&.0 -Please raise issues and bug reports at https://github\&.com/andersen-lab/ivar/ +Please raise issues and bug reports at https://github\&.com/andersen\-lab/ivar/ .fi .PP .SH "Installing on Linux" .PP .SS "Installing build tools" -\fCGNU Autotools\fP is required to compile iVar from source\&. +\fRGNU Autotools\fP is required to compile iVar from source\&. .PP -To install Autotools using \fCAPT\fP please use the command below, +To install Autotools using \fRAPT\fP please use the command below, .PP .PP .nf -apt-get install autotools-dev +apt\-get install autotools\-dev .fi .PP .SS "HTSlib installed using conda" -HTSlib can be installed with \fCconda\fP using the command, +HTSlib can be installed with \fRconda\fP using the command, .PP .PP .nf -conda install -c bioconda htslib +conda install \-c bioconda htslib .fi .PP .PP @@ -206,12 +208,12 @@ make install .PP If HTSlib was installed using conda, please run the following commands by supplying the prefix to the bin folder of the conda binary\&. .PP -The prefix to the bin folder can be found using the command \fCwhich conda\fP\&. The output of the command will be in this format - /opt/conda/bin/conda or /opt/anaconda2/bin/conda or /opt/anaconda3/bin/conda depending on whether you installed miniconda or anaconda\&. For example, if the output of the command is /opt/conda/bin/conda, the prefix to the htslib bin folder will be /opt/conda\&. This can be supplied to \&./configure --with-hts=/opt/conda\&. +The prefix to the bin folder can be found using the command \fRwhich conda\fP\&. The output of the command will be in this format - /opt/conda/bin/conda or /opt/anaconda2/bin/conda or /opt/anaconda3/bin/conda depending on whether you installed miniconda or anaconda\&. For example, if the output of the command is /opt/conda/bin/conda, the prefix to the htslib bin folder will be /opt/conda\&. This can be supplied to \&./configure --with-hts=/opt/conda\&. .PP .PP .nf \&./autogen\&.sh -\&./configure --with-hts=/prefix/to/bin/folder/with/HTSlib +\&./configure \-\-with\-hts=/prefix/to/bin/folder/with/HTSlib make make install .fi @@ -222,24 +224,24 @@ If HTSlib was installed in a non standard location, please run the following com .PP .nf \&./autogen\&.sh -\&./configure --with-hts=/prefix/to/bin/folder/with/HTSlib +\&./configure \-\-with\-hts=/prefix/to/bin/folder/with/HTSlib make make install .fi .PP .PP -To test installation just run, \fCivar version\fP and you should get the following output, +To test installation just run, \fRivar version\fP and you should get the following output, .PP .PP .nf iVar version 1\&.0 -Please raise issues and bug reports at https://github\&.com/andersen-lab/ivar/ +Please raise issues and bug reports at https://github\&.com/andersen\-lab/ivar/ .fi .PP .SH "Running from Docker" .PP -iVar can also be run via \fCDocker\fP\&. Pull the docker image from \fCDocker Hub\fP using the following command, +iVar can also be run via \fRDocker\fP\&. Pull the docker image from \fRDocker Hub\fP using the following command, .PP .PP .nf @@ -247,9 +249,9 @@ docker pull andersenlabapps/ivar .fi .PP .PP -This docker image contains all the required dependencies to run iVar and the \fBpipelines\fP developed using iVar\&. You will have to attach a docker volume to get data into the docker container\&. Instructions to do so are in the \fCDocker docs\fP\&. +This docker image contains all the required dependencies to run iVar and the \fBpipelines\fP developed using iVar\&. You will have to attach a docker volume to get data into the docker container\&. Instructions to do so are in the \fRDocker docs\fP\&. .PP -\fCiVar on Docker Hub\fP +\fRiVar on Docker Hub\fP .SH "Contact" .PP For bug reports please email gkarthik[at]scripps\&.edu or raise an issue on Github\&. diff --git a/docs/man/man3/manualpage.3 b/docs/man/man3/manualpage.3 index 2d9c43fb..b4b71fe1 100644 --- a/docs/man/man3/manualpage.3 +++ b/docs/man/man3/manualpage.3 @@ -1,14 +1,15 @@ -.TH "manualpage" 3 "Fri Jun 19 2020" "iVar" \" -*- nroff -*- +.TH "manualpage" 3 "iVar" \" -*- nroff -*- .ad l .nh .SH NAME manualpage \- Manual +.PP .SH "Available Commands" .PP -Command Description trim Trim reads in aligned BAM variants Call variants from aligned BAM file filtervariants Filter variants across replicates or multiple samples aligned using the same reference consensus Call consensus from aligned BAM file getmasked Detect primer mismatches and get primer indices for the amplicon to be masked removereads Remove reads from trimmed BAM file version Show version information trimadapter (EXPERIMENTAL) Trim adapter sequences from reads +Command Description trim Trim reads in aligned BAM variants Call variants from aligned BAM file filtervariants Filter variants across replicates or multiple samples aligned using the same reference consensus Call consensus from aligned BAM file getmasked Detect primer mismatches and get primer indices for the amplicon to be masked removereads Remove reads from trimmed BAM file version Show version information trimadapter (EXPERIMENTAL) Trim adapter sequences from reads .PP -To view detailed usage for each command type \fCivar \fP Note : Commands maked (EXPERIMENTAL) are still under active development\&. +To view detailed usage for each command type \fRivar \fP Note : Commands maked (EXPERIMENTAL) are still under active development\&. .SH "Description of commands" .PP .SS "Trim primer sequences with iVar" @@ -20,8 +21,8 @@ To sort and index an aligned BAM file (OPTIONAL, if index is not present iVar wi .PP .PP .nf -# Input file - test\&.bam -samtools sort -o test\&.sorted\&.bam test\&.bam && samtools index test\&.sorted\&.bam\&. +# Input file \- test\&.bam +samtools sort \-o test\&.sorted\&.bam test\&.bam && samtools index test\&.sorted\&.bam\&. .fi .PP .PP @@ -32,18 +33,22 @@ Command: .nf ivar trim -Usage: ivar trim -i -b -p [-m ] [-q ] [-s ] +Usage: ivar trim \-i [] \-b [\-p ] [\-m ] [\-q ] [\-s ] Input Options Description - -i (Required) Sorted bam file, with aligned reads, to trim primers and quality - -b (Required) BED file with primer sequences and positions - -m Minimum length of read to retain after trimming (Default: 30) - -q Minimum quality threshold for sliding window to pass (Default: 20) - -s Width of sliding window (Default: 4) - -e Include reads with no primers\&. By default, reads with no primers are excluded + \-i Sorted bam file, with aligned reads, to trim primers and quality\&. If not specified will read from standard in + \-b (Required) BED file with primer sequences and positions + \-f Primer pair information file containing left and right primer names for the same amplicon separated by a tab + If provided, reads will be filtered based on their overlap with amplicons prior to trimming + \-m Minimum length of read to retain after trimming (Default: 50% the average length of the first 1000 reads) + \-q Minimum quality threshold for sliding window to pass (Default: 20) + \-s Width of sliding window (Default: 4) + \-e Include reads with no primers\&. By default, reads with no primers are excluded + \-k Keep reads to allow for reanalysis: keep reads which would be dropped by + alignment length filter or primer requirements, but mark them QCFAIL Output Options Description - -p (Required) Prefix for the output BAM file + \-p Prefix for the output BAM file\&. If none is specified the output will write to standard out\&. .fi .PP @@ -51,23 +56,34 @@ Output Options Description Example Usage: .PP .nf -ivar trim -b test_primers\&.bed -p test\&.trimmed -i test\&.bam -q 15 -m 50 -s 4 +ivar trim \-b test_primers\&.bed \-p test\&.trimmed \-i test\&.bam \-q 15 \-m 50 \-s 4 +samtools view \-h test\&.bam | ivar trim \-b test_primers\&.bed \-p test\&.trimmed .fi .PP .PP The command above will produce a trimmed BAM file test\&.trimmed\&.bam after trimming the aligned reads in test\&.bam using the primer positions specified in test_primers\&.bed and a minimum quality threshold of \fB15\fP, minimum read length of \fB50\fP and a sliding window of \fB4\fP\&. .PP +Example Usage: +.PP +.nf +bwa mem \-t 32 reference\&.fa 1\&.fq 2\&.fq | ivar trim \-b test_primers\&.bed \-x 3 \-m 30 | samtools sort \- | samtools mpileup \-aa \-A \-Q 0 \-d 0 \- | ivar consensus \-p test_consensus \-m 10 \-n N \-t 0\&.5 + +.fi +.PP +.PP +The command above will allow you to go from alignment to consensus sequence in a single command using the bwa aligner\&. +.PP Example BED file .PP .PP .nf Puerto 28 52 400_1_out_L 60 + -Puerto 482 504 400_1_out_R 60 - +Puerto 482 504 400_1_out_R 60 \- Puerto 359 381 400_2_out_L 60 + -Puerto 796 818 400_2_out_R 60 - +Puerto 796 818 400_2_out_R 60 \- Puerto 658 680 400_3_out_L* 60 + -Puerto 1054 1076 400_3_out_R* 60 - +Puerto 1054 1076 400_3_out_R* 60 \- \&. \&. \&. @@ -75,20 +91,20 @@ Puerto 1054 1076 400_3_out_R* 60 - .fi .PP .SS "Call variants with iVar" -iVar uses the output of the \fCsamtools mpileup\fP command to call variants - single nucleotide variants(SNVs) and indels\&. In order to call variants correctly, the reference file used for alignment must be passed to iVar using the \fC-r\fP flag\&. The output of \fCsamtools pileup\fP is piped into \fCivar variants\fP to generate a \&.tsv file with the variants\&. There are two parameters that can be set for variant calling using iVar - minimum quality(Default: 20) and minimum frequency(Default: 0\&.03)\&. Minimum quality is the minimum quality for a base to be counted towards the ungapped depth to canculate iSNV frequency at a given position\&. For insertions, the quality metric is discarded and the mpileup depth is used directly\&. Minimum frequency is the minimum frequency required for a SNV or indel to be reported\&. +iVar uses the output of the \fRsamtools mpileup\fP command to call variants - single nucleotide variants(SNVs) and indels\&. In order to call variants correctly, the reference file used for alignment must be passed to iVar using the \fR-r\fP flag\&. The output of \fRsamtools pileup\fP is piped into \fRivar variants\fP to generate a \&.tsv file with the variants\&. There are two parameters that can be set for variant calling using iVar - minimum quality(Default: 20) and minimum frequency(Default: 0\&.03)\&. Minimum quality is the minimum quality for a base to be counted towards the ungapped depth to canculate iSNV frequency at a given position\&. For insertions, the quality metric is discarded and the mpileup depth is used directly\&. Minimum frequency is the minimum frequency required for a SNV or indel to be reported\&. .PP .SS "Amino acid translation of iSNVs" .PP -iVar can identify codons and translate variants into amino acids using a GFF file in the \fBhttps:\fP//github\&.com/The-Sequence-Ontology/Specifications/blob/master/gff3\&.md 'GFF3' format containing the required coding regions (CDS)\&. In absence of a GFF file, iVar will not perform the translation and 'NA' will be added to the output file in place of the reference and alternate codons and amino acids\&. The GFF file in the GFF3 format can be downloaded via ftp from NCBI RefSeq/Genbank\&. They are usually the files with the extension '\&.gff\&.gz'\&. For example, the GFF file for Zaire Ebolavirus can be found \fChere\fP\&. More details on GFF3 files hosted by NCBI can be found in their ftp \fCFAQs\fP\&. +iVar can identify codons and translate variants into amino acids using a GFF file in the \fRGFF3\fP format containing the required coding regions (CDS)\&. In absence of a GFF file, iVar will not perform the translation and 'NA' will be added to the output file in place of the reference and alternate codons and amino acids\&. The GFF file in the GFF3 format can be downloaded via ftp from NCBI RefSeq/Genbank\&. They are usually the files with the extension '\&.gff\&.gz'\&. For example, the GFF file for Zaire Ebolavirus can be found \fRhere\fP\&. More details on GFF3 files hosted by NCBI can be found in their ftp \fRFAQs\fP\&. .PP .SS "Account for RNA editing through polymerase slippage" .PP -Some RNA viruses such as Ebola virus, might have polymerase slippage causing the insertion of a couple of nucleotides\&. More details can be found \fChere\fP\&. iVar can account for this editing and identify the correct open reading frames\&. The user will have to specify two additional parameters, \fBEditPosition\fP: Position at which edit occurs and \fBEditSequence\fP: The sequence tht is inserted at the given positon, in the 'attributes' column of the GFF file to account for this\&. A test example is given below, +Some RNA viruses such as Ebola virus, might have polymerase slippage causing the insertion of a couple of nucleotides\&. More details can be found \fRhere\fP\&. iVar can account for this editing and identify the correct open reading frames\&. The user will have to specify two additional parameters, \fBEditPosition\fP: Position at which edit occurs and \fBEditSequence\fP: The sequence tht is inserted at the given positon, in the 'attributes' column of the GFF file to account for this\&. A test example is given below, .PP .PP .nf -test Genbank CDS 2 292 \&. + \&. ID=id-testedit1;Note=PinkFloyd;EditPosition=100;EditSequence=A -test Genbank CDS 2 292 \&. + \&. ID=id-testedit2;Note=AnotherBrickInTheWall;EditPosition=102;EditSequence=AA +test Genbank CDS 2 292 \&. + \&. ID=id\-testedit1;Note=PinkFloyd;EditPosition=100;EditSequence=A +test Genbank CDS 2 292 \&. + \&. ID=id\-testedit2;Note=AnotherBrickInTheWall;EditPosition=102;EditSequence=AA .fi .PP .PP @@ -97,19 +113,20 @@ If a certain base is present in multiple CDSs, iVar will add a new row for each Command: .PP .nf -Usage: samtools mpileup -aa -A -d 0 -B -Q 0 --reference [ | ivar variants -p [-q ] [-t ] [-m ] [-r ] [-g GFF file] +Usage: samtools mpileup \-aa \-A \-d 0 \-B \-Q 0 \-\-reference [ | ivar variants \-p [\-q ] [\-t ] [\-m ] [\-r ] [\-g GFF file] Note : samtools mpileup output must be piped into ivar variants Input Options Description - -q Minimum quality score threshold to count base (Default: 20) - -t Minimum frequency threshold(0 - 1) to call variants (Default: 0\&.03) - -m Minimum read depth to call variants (Default: 0) - -r Reference file used for alignment\&. This is used to translate the nucleotide sequences and identify intra host single nucleotide variants - -g A GFF file in the GFF3 format can be supplied to specify coordinates of open reading frames (ORFs)\&. In absence of GFF file, amino acid translation will not be done\&. + \-q Minimum quality score threshold to count base (Default: 20) + \-t Minimum frequency threshold(0 \- 1) to call variants (Default: 0\&.03) + \-m Minimum read depth to call variants (Default: 0) + \-G Count gaps towards depth\&. By default, gaps are not counted + \-r Reference file used for alignment\&. This is used to translate the nucleotide sequences and identify intra host single nucleotide variants + \-g A GFF file in the GFF3 format can be supplied to specify coordinates of open reading frames (ORFs)\&. In absence of GFF file, amino acid translation will not be done\&. Output Options Description - -p (Required) Prefix for the output tsv variant file + \-p (Required) Prefix for the output tsv variant file .fi .PP @@ -117,7 +134,7 @@ Output Options Description Example Usage: .PP .nf -samtools mpileup -aa -A -d 600000 -B -Q 0 test\&.trimmed\&.bam | ivar variants -p test -q 20 -t 0\&.03 -r test_reference\&.fa -g test\&.gff +samtools mpileup \-aa \-A \-d 600000 \-B \-Q 0 test\&.trimmed\&.bam | ivar variants \-p test \-q 20 \-t 0\&.03 \-r test_reference\&.fa \-g test\&.gff .fi .PP @@ -129,8 +146,8 @@ Example of output \&.tsv file\&. .PP .nf REGION POS REF ALT REF_DP REF_RV REF_QUAL ALT_DP ALT_RV ALT_QUAL ALT_FREQ TOTAL_DP PVAL PASS GFF_FEATURE REF_CODON REF_AA ALT_CODON ALT_AA -test 42 G T 0 0 0 1 0 49 1 1 1 FALSE id-test3 AGG R ATG M -test 42 G T 0 0 0 1 0 49 1 1 1 FALSE id-test4 CAG Q CAT H +test 42 G T 0 0 0 1 0 49 1 1 1 FALSE id\-test3 AGG R ATG M +test 42 G T 0 0 0 1 0 49 1 1 1 FALSE id\-test4 CAG Q CAT H test 320 A T 1 1 35 1 1 46 0\&.5 2 0\&.666667 FALSE NA NA NA NA NA test 365 A T 0 0 0 1 1 27 1 1 1 FALSE NA NA NA NA NA .fi @@ -138,24 +155,24 @@ test 365 A T 0 0 0 1 1 27 1 1 1 FALSE NA NA NA NA .PP Description .PP -Field Description REGION Region from BAM file POS Position on reference sequence REF Reference base ALT Alternate Base REF_DP Ungapped depth of reference base REF_RV Ungapped depth of reference base on reverse reads REF_QUAL Mean quality of reference base ALT_DP Ungapped depth of alternate base\&. ALT_RV Ungapped deapth of alternate base on reverse reads ALT_QUAL Mean quality of alternate base ALT_FREQ Frequency of alternate base TOTAL_DP Total depth at position PVAL p-value of fisher's exact test PASS Result of p-value <= 0\&.05 GFF_FEATURE ID of the GFF feature used for the translation REF_CODON Codong using the reference base REF_AA Amino acid translated from reference codon ALT_CODON Codon using the alternate base ALT_AA Amino acid translated from the alternate codon +Field Description REGION Region from BAM file POS Position on reference sequence REF Reference base ALT Alternate Base REF_DP Ungapped depth of reference base REF_RV Ungapped depth of reference base on reverse reads REF_QUAL Mean quality of reference base ALT_DP Ungapped depth of alternate base\&. ALT_RV Ungapped deapth of alternate base on reverse reads ALT_QUAL Mean quality of alternate base ALT_FREQ Frequency of alternate base TOTAL_DP Total depth at position PVAL p-value of fisher's exact test PASS Result of p-value <= 0\&.05 GFF_FEATURE ID of the GFF feature used for the translation REF_CODON Codong using the reference base REF_AA Amino acid translated from reference codon ALT_CODON Codon using the alternate base ALT_AA Amino acid translated from the alternate codon .PP -\fBNote\fP: Please use the -B options with \fCsamtools mpileup\fP to call variants and generate consensus\&. When a reference sequence is supplied, the quality of the reference base is reduced to 0 (ASCII: !) in the mpileup output\&. Disabling BAQ with -B seems to fix this\&. This was tested in samtools 1\&.7 and 1\&.8\&. +\fBNote\fP: Please use the -B options with \fRsamtools mpileup\fP to call variants and generate consensus\&. When a reference sequence is supplied, the quality of the reference base is reduced to 0 (ASCII: !) in the mpileup output\&. Disabling BAQ with -B seems to fix this\&. This was tested in samtools 1\&.7 and 1\&.8\&. .SS "Filter variants across replicates with iVar" -iVar can be used to get an intersection of variants(in \&.tsv files) called from any number of replicates or from different samples using the same reference sequence\&. This intersection will filter out any iSNVs that do not occur in a minimum fraction of the files supplied\&. This parameter can be changed using the \fC-t\fP flag which range from 0 to 1 (default)\&. Fields that are different across replicates(fields apart from REGION, POS, REF, ALT, REF_CODON, REF_AA, ALT_CODON, ALT_AA) will have the filename added as a suffix\&. If there are a large number of files to be filtered, the \fC-f\fP flag can be used to supply a text file with one sample/replicate variant \&.tsv file per line\&. +iVar can be used to get an intersection of variants(in \&.tsv files) called from any number of replicates or from different samples using the same reference sequence\&. This intersection will filter out any iSNVs that do not occur in a minimum fraction of the files supplied\&. This parameter can be changed using the \fR-t\fP flag which range from 0 to 1 (default)\&. Fields that are different across replicates(fields apart from REGION, POS, REF, ALT, REF_CODON, REF_AA, ALT_CODON, ALT_AA) will have the filename added as a suffix\&. If there are a large number of files to be filtered, the \fR-f\fP flag can be used to supply a text file with one sample/replicate variant \&.tsv file per line\&. .PP Command: .PP .nf -Usage: ivar filtervariants -p replicate-one\&.tsv replicate-two\&.tsv \&.\&.\&. OR ivar filtervariants -p -f +Usage: ivar filtervariants \-p replicate\-one\&.tsv replicate\-two\&.tsv \&.\&.\&. OR ivar filtervariants \-p \-f Input: Variant tsv files for each replicate/sample Input Options Description - -t Minimum fration of files required to contain the same variant\&. Specify value within [0,1]\&. (Default: 1) - -f A text file with one variant file per line\&. + \-t Minimum fration of files required to contain the same variant\&. Specify value within [0,1]\&. (Default: 1) + \-f A text file with one variant file per line\&. Output Options Description - -p (Required) Prefix for the output filtered tsv file + \-p (Required) Prefix for the output filtered tsv file .fi .PP @@ -163,7 +180,7 @@ Output Options Description Example Usage: The command below only retains those variants that are found in atleast 50% of the fiels supplied .PP .nf -ivar filtervariants -t 0\&.5 -p test\&.filtered test\&.1\&.tsv test\&.2\&.tsv test\&.3\&.tsv +ivar filtervariants \-t 0\&.5 \-p test\&.filtered test\&.1\&.tsv test\&.2\&.tsv test\&.3\&.tsv .fi .PP @@ -172,7 +189,7 @@ The three replicates can also be supplied using a text file as shown below .PP .PP .nf -ivar filtervariants -t 0\&.5 -p test\&.filtered -f filter_files\&.txt +ivar filtervariants \-t 0\&.5 \-p test\&.filtered \-f filter_files\&.txt .fi .PP .PP @@ -193,28 +210,28 @@ Example output of filtered \&.tsv file from three files test_rep1\&.tsv and test .PP .nf REGION POS REF ALT GFF_FEATURE REF_CODON REF_AA ALT_CODON ALT_AA REF_DP_test\&.1\&.tsv REF_RV_test\&.1\&.tsv REF_QUAL_test\&.1\&.tsv ALT_DP_test\&.1\&.tsv ALT_RV_test\&.1\&.tsv ALT_QUAL_test\&.1\&.tsv ALT_FREQ_test\&.1\&.tsv TOTAL_DP_test\&.1\&.tsv PVAL_test\&.1\&.tsv PASS_test\&.1\&.tsv REF_DP_test\&.2\&.tsv REF_RV_test\&.2\&.tsv REF_QUAL_test\&.2\&.tsv ALT_DP_test\&.2\&.tsv ALT_RV_test\&.2\&.tsv ALT_QUAL_test\&.2\&.tsv ALT_FREQ_test\&.2\&.tsv TOTAL_DP_test\&.2\&.tsv PVAL_test\&.2\&.tsv PASS_test\&.2\&.tsv REF_DP_test\&.3\&.tsv REF_RV_test\&.3\&.tsv REF_QUAL_test\&.3\&.tsv ALT_DP_test\&.3\&.tsv ALT_RV_test\&.3\&.tsv ALT_QUAL_test\&.3\&.tsv ALT_FREQ_test\&.3\&.tsv TOTAL_DP_test\&.3\&.tsv PVAL_test\&.3\&.tsv PASS_test\&.3\&.tsv -test 139 T A id-test3 GCT A GCA A 1 0 32 1 0 55 0\&.5 2 0\&.666667 FALSE 1 0 32 1 0 55 0\&.5 2 0\&.666667 FALSE NA NA NA NA NA NA NA NA NA NA +test 139 T A id\-test3 GCT A GCA A 1 0 32 1 0 55 0\&.5 2 0\&.666667 FALSE 1 0 32 1 0 55 0\&.5 2 0\&.666667 FALSE NA NA NA NA NA NA NA NA NA NA test 320 A T NA NA NA NA NA 1 1 35 1 1 46 0\&.5 2 0\&.666667 FALSE NA NA NA NA NA NA NA NA NA NA 1 1 35 1 1 46 0\&.5 2 0\&.666667 FALSE test 365 A T NA NA NA NA NA 0 0 0 1 1 27 1 1 1 FALSE 0 0 0 1 1 27 1 1 1 FALSE 0 0 0 1 1 27 1 1 1 FALSE -test 42 G T id-test4 CAG Q CAT H 0 0 0 1 0 49 1 1 1 FALSE 0 0 0 1 0 49 1 1 1 FALSE NA NA NA NA NA NA NA NA NA NA -test 42 G T id-testedit1 AGG R ATG M 0 0 0 1 0 49 1 1 1 FALSE 0 0 0 1 0 49 1 1 1 FALSE 0 0 0 1 0 49 1 1 1 FALSE -test 69 T G id-testedit2 TTG L TGG W 1 0 57 1 0 53 0\&.5 2 0\&.666667 FALSE 1 0 57 1 0 53 0\&.5 2 0\&.666667 FALSE 1 0 57 1 0 53 0\&.5 2 0\&.666667 FALSE +test 42 G T id\-test4 CAG Q CAT H 0 0 0 1 0 49 1 1 1 FALSE 0 0 0 1 0 49 1 1 1 FALSE NA NA NA NA NA NA NA NA NA NA +test 42 G T id\-testedit1 AGG R ATG M 0 0 0 1 0 49 1 1 1 FALSE 0 0 0 1 0 49 1 1 1 FALSE 0 0 0 1 0 49 1 1 1 FALSE +test 69 T G id\-testedit2 TTG L TGG W 1 0 57 1 0 53 0\&.5 2 0\&.666667 FALSE 1 0 57 1 0 53 0\&.5 2 0\&.666667 FALSE 1 0 57 1 0 53 0\&.5 2 0\&.666667 FALSE .fi .PP .PP Description of fields .PP -No Field Description 1 REGION Common region across all replicate variant tsv files 2 POS Common position across all variant tsv files 3 REF Common reference base across all variant tsv files 4 ALT Common alternate base across all variant tsv files 5 GFF_FEATURE GFF feature used for the translation 6 REF_CODON The codon using the reference base 7 REF_AA Reference codon translated into amino acid 8 ALT_CODON Codon using the alternate base 9 ALT_AA Alternate codon translated into amino acid 10 REF_DP_ Depth of reference base in replicate 1 11 REF_RV_ Depth of reference base on reverse reads in replicate 1 12 REF_QUAL_ Mean quality of reference base in replicate 1 13 ALT_DP_ Depth of alternate base in replicate 1 14 ALT_RV_ Deapth of alternate base on reverse reads in replicate 1 15 ALT_QUAL_ Mean quality of alternate base in replicate 1 16 ALT_FREQ_ Frequency of alternate base in replicate 1 17 TOTAL_DP_ Total depth at position in replicate 1 18 PVAL_ p-value of fisher's exact test in replicate 1 19 PASS_ Result of p-value <= 0\&.05 in replicate 1 20 Continue rows 10 - 19 for every replicate provided +No Field Description 1 REGION Common region across all replicate variant tsv files 2 POS Common position across all variant tsv files 3 REF Common reference base across all variant tsv files 4 ALT Common alternate base across all variant tsv files 5 GFF_FEATURE GFF feature used for the translation 6 REF_CODON The codon using the reference base 7 REF_AA Reference codon translated into amino acid 8 ALT_CODON Codon using the alternate base 9 ALT_AA Alternate codon translated into amino acid 10 REF_DP_ Depth of reference base in replicate 1 11 REF_RV_ Depth of reference base on reverse reads in replicate 1 12 REF_QUAL_ Mean quality of reference base in replicate 1 13 ALT_DP_ Depth of alternate base in replicate 1 14 ALT_RV_ Deapth of alternate base on reverse reads in replicate 1 15 ALT_QUAL_ Mean quality of alternate base in replicate 1 16 ALT_FREQ_ Frequency of alternate base in replicate 1 17 TOTAL_DP_ Total depth at position in replicate 1 18 PVAL_ p-value of fisher's exact test in replicate 1 19 PASS_ Result of p-value <= 0\&.05 in replicate 1 20 Continue rows 10 - 19 for every replicate provided .SS "Generate a consensus sequences from an aligned BAM file" -To generate a consensus sequence iVar uses the output of \fCsamtools mpileup\fP command\&. The mpileup output must be piped into \fCivar consensus\fP\&. There are five parameters that can be set - minimum quality(Default: 20), minimum frequency threshold(Default: 0), minimum depth to call a consensus(Default: 10), a flag to exclude nucleotides from regions with depth less than the minimum depth and a character to call in regions with coverage lower than the speicifed minimum depth(Default: 'N')\&. Minimum quality is the minimum quality of a base to be considered in calculations of variant frequencies at a given position\&. Minimum frequency threshold is the minimum frequency that a base must match to be called as the consensus base at a position\&. If one base is not enough to match a given frequency, then an ambigious nucleotide is called at that position\&. Minimum depth is the minimum required depth to call a consensus\&. If '-k' flag is set then these regions are not included in the consensus sequence\&. If '-k' is not set then by default, a 'N' is called in these regions\&. You can also specfy which character you want to add to the consensus to cover regions with depth less than the minimum depth\&. This can be done using -n option\&. It takes one of two values: '-' or 'N'\&. +To generate a consensus sequence iVar uses the output of \fRsamtools mpileup\fP command\&. The mpileup output must be piped into \fRivar consensus\fP\&. There are five parameters that can be set - minimum quality(Default: 20), minimum frequency threshold(Default: 0), minimum depth to call a consensus(Default: 10), a flag to exclude nucleotides from regions with depth less than the minimum depth and a character to call in regions with coverage lower than the speicifed minimum depth(Default: 'N')\&. Minimum quality is the minimum quality of a base to be considered in calculations of variant frequencies at a given position\&. Minimum frequency threshold is the minimum frequency that a base must match to be called as the consensus base at a position\&. If one base is not enough to match a given frequency, then an ambigious nucleotide is called at that position\&. Minimum depth is the minimum required depth to call a consensus\&. If '-k' flag is set then these regions are not included in the consensus sequence\&. If '-k' is not set then by default, a 'N' is called in these regions\&. You can also specfy which character you want to add to the consensus to cover regions with depth less than the minimum depth\&. This can be done using -n option\&. It takes one of two values: '-' or 'N'\&. .PP As an example, consider a position with 6As, 3Ts and 1C\&. The table below shows the consensus nucleotide called at different frequencies\&. .PP -Minimum frequency threshold Consensus 0 A 0\&.5 A 0\&.6 A 0\&.7 W(A or T) 0\&.9 W (A or T) 1 H (A or T or C) +Minimum frequency threshold Consensus 0 A 0\&.5 A 0\&.6 A 0\&.7 W(A or T) 0\&.9 W (A or T) 1 H (A or T or C) .PP If there are two nucleotides at the same frequency, both nucleotides are used to call an ambigious base as the consensus\&. As an example, consider a position wiht 6 Ts, 2As and 2 Gs\&. The table below shows the consensus nucleotide called at different frequencies\&. .PP -Minimum frequency threshold Consensus 0 T 0\&.5 T 0\&.6 T 0\&.7 D(A or T or G) 0\&.9 D(A or T or G) 1 D(A or T or G) +Minimum frequency threshold Consensus 0 T 0\&.5 T 0\&.6 T 0\&.7 D(A or T or G) 0\&.9 D(A or T or G) 1 D(A or T or G) .PP The output of the command is a fasta file with the consensus sequence and a \&.txt file with the average quality of every base used to generate the consensus at each position\&. \fIFor insertions, the quality is set to be the minimum quality threshold since mpileup doesn't give the quality of bases in insertions\&.\fP .PP @@ -224,33 +241,34 @@ Command: .nf ivar consensus -Usage: samtools mpileup -aa -A -d 0 -Q 0 | ivar consensus -p +Usage: samtools mpileup \-aa \-A \-d 0 \-Q 0 | ivar consensus \-p Note : samtools mpileup output must be piped into ivar consensus Input Options Description - -q Minimum quality score threshold to count base (Default: 20) - -t Minimum frequency threshold(0 - 1) to call consensus\&. (Default: 0) + \-q Minimum quality score threshold to count base (Default: 20) + \-t Minimum frequency threshold(0 \- 1) to call consensus\&. (Default: 0) + \-c Minimum insertion frequency threshold(0 \- 1) to call consensus\&. (Default: 0\&.8) Frequently used thresholds | Description - ---------------------------|------------ + \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-|\-\-\-\-\-\-\-\-\-\-\-\- 0 | Majority or most common base 0\&.2 | Bases that make up atleast 20% of the depth at a position 0\&.5 | Strict or bases that make up atleast 50% of the depth at a position 0\&.9 | Strict or bases that make up atleast 90% of the depth at a position 1 | Identical or bases that make up 100% of the depth at a position\&. Will have highest ambiguities - -m Minimum depth to call consensus(Default: 10) - -k If '-k' flag is added, regions with depth less than minimum depth will not be added to the consensus sequence\&. Using '-k' will override any option specified using -n - -n (N/-) Character to print in regions with less than minimum coverage(Default: N) + \-m Minimum depth to call consensus(Default: 10) + \-k If '\-k' flag is added, regions with depth less than minimum depth will not be added to the consensus sequence\&. Using '\-k' will override any option specified using \-n + \-n (N/\-) Character to print in regions with less than minimum coverage(Default: N) Output Options Description - -p (Required) Prefix for the output fasta file and quality file + \-p (Required) Prefix for the output fasta file and quality file .fi .PP .PP Example Usage: .PP .nf -samtools mpileup -d 1000 -A -Q 0 test\&.bam | ivar consensus -p test -q 20 -t 0 +samtools mpileup \-d 1000 \-A \-Q 0 test\&.bam | ivar consensus \-p test \-q 20 \-t 0 .fi .PP @@ -263,15 +281,15 @@ Command: .PP .nf ivar getmasked -Usage: ivar getmasked -i -b -f -p -Note: This step is used only for amplicon-based sequencing\&. +Usage: ivar getmasked \-i \-b \-f \-p +Note: This step is used only for amplicon\-based sequencing\&. Input Options Description - -i (Required) Input filtered variants tsv generated from 'ivar filtervariants' - -b (Required) BED file with primer sequences and positions - -f (Required) Primer pair information file containing left and right primer names for the same amplicon separated by a tab + \-i (Required) Input filtered variants tsv generated from 'ivar filtervariants' + \-b (Required) BED file with primer sequences and positions + \-f (Required) Primer pair information file containing left and right primer names for the same amplicon separated by a tab Output Options Description - -p (Required) Prefix for the output text file + \-p (Required) Prefix for the output text file .fi .PP @@ -281,11 +299,11 @@ Example BED file .PP .nf Puerto 28 52 400_1_out_L 60 + -Puerto 482 504 400_1_out_R 60 - +Puerto 482 504 400_1_out_R 60 \- Puerto 359 381 400_2_out_L 60 + -Puerto 796 818 400_2_out_R 60 - +Puerto 796 818 400_2_out_R 60 \- Puerto 658 680 400_3_out_L* 60 + -Puerto 1054 1076 400_3_out_R* 60 - +Puerto 1054 1076 400_3_out_R* 60 \- \&. \&. \&. @@ -310,7 +328,7 @@ Example primer pair information file Example Usage: .PP .nf -ivar getmasked -i test\&.filtered\&.tsv -b primers\&.bed -f pair_information\&.tsv -p test\&.masked\&.txt +ivar getmasked \-i test\&.filtered\&.tsv \-b primers\&.bed \-f pair_information\&.tsv \-p test\&.masked\&.txt .fi .PP @@ -325,22 +343,22 @@ Example Output: .fi .PP .SS "Remove reads associated with mismatched primer indices" -This command accepts an aligned and sorted BAM file trimmed using \fCivar trim\fP and removes the reads corresponding to the supplied primer indices, which is the output of \fCivar getmasked\fP command\&. Under the hood, \fCivar trim\fP adds the zero based primer index(based on the BED file) to the BAM auxillary data for every read\&. Hence, ivar removereads will only work on BAM files that have been trimmed using \fCivar trim\fP\&. +This command accepts an aligned and sorted BAM file trimmed using \fRivar trim\fP and removes the reads corresponding to the supplied primer indices, which is the output of \fRivar getmasked\fP command\&. Under the hood, \fRivar trim\fP adds the zero based primer index(based on the BED file) to the BAM auxillary data for every read\&. Hence, ivar removereads will only work on BAM files that have been trimmed using \fRivar trim\fP\&. .PP Command: .PP .nf ivar removereads -Usage: ivar removereads -i -p -t -Note: This step is used only for amplicon-based sequencing\&. +Usage: ivar removereads \-i \-p \-t +Note: This step is used only for amplicon\-based sequencing\&. Input Options Description - -i (Required) Input BAM file trimmed with ivar trim\&. Must be sorted and indexed, which can be done using sort_index_bam\&.sh - -t (Required) Text file with primer indices separated by spaces\&. This is the output of getmasked command\&. + \-i (Required) Input BAM file trimmed with ivar trim\&. Must be sorted and indexed, which can be done using sort_index_bam\&.sh + \-t (Required) Text file with primer indices separated by spaces\&. This is the output of getmasked command\&. Output Options Description - -p (Required) Prefix for the output filtered BAM file + \-p (Required) Prefix for the output filtered BAM file .fi .PP @@ -348,13 +366,13 @@ Output Options Description Example Usage: .PP .nf -ivar trim -i test\&.bam -p test\&.trimmed -ivar removereads -i test\&.trimmed\&.bam -p test\&.trimmed\&.masked\&.bam -t test\&.masked\&.txt +ivar trim \-i test\&.bam \-p test\&.trimmed +ivar removereads \-i test\&.trimmed\&.bam \-p test\&.trimmed\&.masked\&.bam \-t test\&.masked\&.txt .fi .PP .PP -The \fCivar trim\fP command above trims test\&.bam and produced test\&.trimmed\&.bam with the primer indice data added\&. The \fCivar removereads\fP command produces an output file - test\&.trimmed\&.masked\&.bam after removing all the reads corresponding to primer indices - 1,2,7 and 8\&. +The \fRivar trim\fP command above trims test\&.bam and produced test\&.trimmed\&.bam with the primer indice data added\&. The \fRivar removereads\fP command produces an output file - test\&.trimmed\&.masked\&.bam after removing all the reads corresponding to primer indices - 1,2,7 and 8\&. .SS "(Experimental) trimadapter" \fBNote: This feature is under active development and not completely validated yet\&.\fP .PP diff --git a/src/call_consensus_pileup.cpp b/src/call_consensus_pileup.cpp index a9d1b12f..825883c3 100644 --- a/src/call_consensus_pileup.cpp +++ b/src/call_consensus_pileup.cpp @@ -33,8 +33,9 @@ ret_t get_consensus_allele(std::vector ad, uint8_t min_qual, std::vector nuc_pos; allele tmp_a; char n; - uint32_t max_l = 0, max_depth = 0, cur_depth = 0, tmp_depth = 0, + uint32_t max_l = 0, max_depth = 0, tmp_depth = 0, total_max_depth = 0, gap_depth = 0, total_indel_depth = 0; + // uint32_t cur_depth = 0; uint8_t ambg_n = 1, ctr = 0; double q = 0, tq = 0, cur_threshold = 0; std::vector::iterator it; @@ -56,7 +57,7 @@ ret_t get_consensus_allele(std::vector ad, uint8_t min_qual, tq = 0; max_depth = 0; tmp_depth = 0; - cur_depth = 0; + // cur_depth = 0; // prev_depth = 0; ctr = 1; it = ad.begin(); @@ -84,7 +85,7 @@ ret_t get_consensus_allele(std::vector ad, uint8_t min_qual, it++; ctr++; } - cur_depth += tmp_depth; + // cur_depth += tmp_depth; tmp_a.nuc = it->nuc[i]; tmp_a.mean_qual = tq; tmp_a.reverse = 0; // Reverse reads not important for consensus @@ -158,7 +159,7 @@ ret_t get_consensus_allele(std::vector ad, uint8_t min_qual, int call_consensus_from_plup(std::istream &cin, std::string seq_id, std::string out_file, uint8_t min_qual, - double threshold, uint8_t min_depth, char gap, + double threshold, uint32_t min_depth, char gap, bool min_coverage_flag, double min_insert_threshold) { std::string line, cell; @@ -173,8 +174,8 @@ int call_consensus_from_plup(std::istream &cin, std::string seq_id, fout << ">" << seq_id << std::endl; } delete[] o; - int ctr = 0, mdepth = 0; - uint32_t prev_pos = 0, pos = 0; + int ctr = 0; + uint32_t prev_pos = 0, pos = 0, mdepth = 0; std::stringstream lineStream; char ref; std::string bases; diff --git a/src/call_consensus_pileup.h b/src/call_consensus_pileup.h index d984c5ff..bcbd2eee 100644 --- a/src/call_consensus_pileup.h +++ b/src/call_consensus_pileup.h @@ -23,7 +23,7 @@ struct ret_t { void format_alleles(std::vector &ad); int call_consensus_from_plup(std::istream &cin, std::string seq_id, std::string out_file, uint8_t min_qual, - double threshold, uint8_t min_depth, char gap, + double threshold, uint32_t min_depth, char gap, bool min_coverage_flag, double min_insert_threshold); ret_t get_consensus_allele(std::vector ad, uint8_t min_qual, diff --git a/src/call_variants.cpp b/src/call_variants.cpp index 615906e2..4d85cf43 100644 --- a/src/call_variants.cpp +++ b/src/call_variants.cpp @@ -31,8 +31,8 @@ double *get_frequency_depth( int call_variants_from_plup(std::istream &cin, std::string out_file, uint8_t min_qual, double min_threshold, - uint8_t min_depth, std::string ref_path, - std::string gff_path) { + uint32_t min_depth, std::string ref_path, + std::string gff_path, bool gapped_depth) { std::string line, cell, bases, qualities, region; ref_antd refantd(ref_path, gff_path); std::ostringstream out_str; @@ -108,7 +108,13 @@ int call_variants_from_plup(std::istream &cin, std::string out_file, // Get ungapped depth pdepth = 0; for (std::vector::iterator it = ad.begin(); it != ad.end(); ++it) { - if (it->nuc[0] == '*' || it->nuc[0] == '+' || it->nuc[0] == '-') continue; + // if ((gapped_depth && (it->nuc[0] == '+' || it->nuc[0] == '-')) || (!gapped_depth && (it->nuc[0] == '+' || it->nuc[0] == '*' || it->nuc[0] == '-'))) continue; + // Split into two if statements for readability. + if (gapped_depth) { + if (it->nuc[0] == '+' || it->nuc[0] == '-') continue; // Count gaps ('*') towards depth + } else { + if (it->nuc[0] == '+' || it->nuc[0] == '*' || it->nuc[0] == '-') continue; + } pdepth += it->depth; } if (pdepth < min_depth) { // Check for minimum depth diff --git a/src/call_variants.h b/src/call_variants.h index c7c92ff2..363ccae9 100644 --- a/src/call_variants.h +++ b/src/call_variants.h @@ -18,8 +18,8 @@ int call_variants_from_plup(std::istream &cin, std::string out_file, uint8_t min_qual, double min_threshold, - uint8_t min_depth, std::string ref_path, - std::string gff_path); + uint32_t min_depth, std::string ref_path, + std::string gff_path, bool gapped_depth); std::vector::iterator get_ref_allele(std::vector &ad, char ref); #endif diff --git a/src/interval_tree.cpp b/src/interval_tree.cpp index 7f7c2007..6ee28379 100755 --- a/src/interval_tree.cpp +++ b/src/interval_tree.cpp @@ -70,8 +70,8 @@ bool IntervalTree::envelopSearch(ITNode *root, Interval i) { void IntervalTree::inOrder(ITNode *root) { if (root == NULL) return; inOrder(root->left); - cout << "[" << root->data->low << ", " << root->data->high << "]" - << " max = " << root->max << endl; + std::cerr << "[" << root->data->low << ", " << root->data->high << "]" + << " max = " << root->max << endl; inOrder(root->right); } diff --git a/src/ivar.cpp b/src/ivar.cpp index 5fd00273..3778b59a 100755 --- a/src/ivar.cpp +++ b/src/ivar.cpp @@ -17,7 +17,7 @@ #include "suffix_tree.h" #include "trim_primer_quality.h" -const std::string VERSION = "1.3.1"; +const std::string VERSION = "1.4.4"; struct args_t { std::string bam; // -i @@ -35,7 +35,7 @@ struct args_t { std::string f1; // -1 std::string f2; // -2 std::string adp_path; // -a - uint8_t min_depth; // -m + uint32_t min_depth; // -m char gap; // -n bool keep_min_coverage; // -k std::string primer_pair_file; // -f @@ -44,6 +44,7 @@ struct args_t { bool write_no_primers_flag; // -e std::string gff; // -g bool keep_for_reanalysis; // -k + bool gapped_depth; // -G } g_args; void print_usage() { @@ -67,11 +68,11 @@ void print_usage() { void print_trim_usage() { std::cout - << "Usage: ivar trim -i -b -p [-m " + << "Usage: ivar trim -i [] -b [-p ] [-m " "] [-q ] [-s ]\n\n" "Input Options Description\n" - " -i (Required) Sorted bam file, with aligned reads, to " - "trim primers and quality\n" + " -i BAM file, with aligned reads, to " + "trim primers and quality. If not specified will use standard in\n" " -b BED file with primer sequences and positions. If no " "BED file is specified, only quality trimming will be done.\n" " -f [EXPERIMENTAL] Primer pair information file " @@ -83,7 +84,7 @@ void print_trim_usage() { "occur at the specified offset positions relative to primer positions " "will also be trimmed.\n" " -m Minimum length of read to retain after trimming " - "(Default: 30)\n" + "(Default: 50% average length of the first 1000 reads)\n" " -q Minimum quality threshold for sliding window to " "pass (Default: 20)\n" " -s Width of sliding window (Default: 4)\n" @@ -94,7 +95,7 @@ void print_trim_usage() { " alignment length filter or primer requirements, but " "mark them QCFAIL\n\n" "Output Options Description\n" - " -p (Required) Prefix for the output BAM file\n"; + " -p Prefix for the output BAM file. If none is specified output will go to std out\n"; } void print_variants_usage() { @@ -110,6 +111,7 @@ void print_variants_usage() { " -t Minimum frequency threshold(0 - 1) to call variants " "(Default: 0.03)\n" " -m Minimum read depth to call variants (Default: 0)\n" + " -G Count gaps towards depth. By default, gaps are not counted\n" " -r Reference file used for alignment. This is used to " "translate the nucleotide sequences and identify intra host single " "nucleotide variants\n" @@ -241,7 +243,7 @@ void print_version_info() { } static const char *trim_opt_str = "i:b:f:x:p:m:q:s:ekh?"; -static const char *variants_opt_str = "p:t:q:m:r:g:h?"; +static const char *variants_opt_str = "p:t:q:m:r:g:Gh?"; static const char *consensus_opt_str = "i:p:q:t:c:m:n:kh?"; static const char *removereads_opt_str = "i:p:t:b:h?"; static const char *filtervariants_opt_str = "p:t:f:h?"; @@ -292,7 +294,7 @@ int main(int argc, char *argv[]) { if (cmd.compare("trim") == 0) { g_args.min_qual = 20; g_args.sliding_window = 4; - g_args.min_length = 30; + g_args.min_length = -1; g_args.write_no_primers_flag = false; g_args.keep_for_reanalysis = false; g_args.bed = ""; @@ -339,16 +341,20 @@ int main(int argc, char *argv[]) { } opt = getopt(argc, argv, trim_opt_str); } - if (g_args.bam.empty() || g_args.prefix.empty()) { + if (g_args.bam.empty() && isatty(STDIN_FILENO)) { + std::cout << "Please supply a BAM file using -i or supply the input file " + "through standard input" + << std::endl + << std::endl; print_trim_usage(); return -1; } g_args.prefix = get_filename_without_extension(g_args.prefix, ".bam"); - res = trim_bam_qual_primer( - g_args.bam, g_args.bed, g_args.prefix, g_args.region, g_args.min_qual, - g_args.sliding_window, cl_cmd.str(), g_args.write_no_primers_flag, - g_args.keep_for_reanalysis, g_args.min_length, g_args.primer_pair_file, - g_args.primer_offset); + res = trim_bam_qual_primer(g_args.bam, g_args.bed, g_args.prefix, + g_args.min_qual, g_args.sliding_window, + cl_cmd.str(), g_args.write_no_primers_flag, + g_args.keep_for_reanalysis, g_args.min_length, + g_args.primer_pair_file, g_args.primer_offset); } // ivar variants else if (cmd.compare("variants") == 0) { @@ -357,6 +363,7 @@ int main(int argc, char *argv[]) { g_args.min_depth = 0; g_args.ref = ""; g_args.gff = ""; + g_args.gapped_depth = false; opt = getopt(argc, argv, variants_opt_str); while (opt != -1) { switch (opt) { @@ -378,6 +385,9 @@ int main(int argc, char *argv[]) { case 'g': g_args.gff = optarg; break; + case 'G': + g_args.gapped_depth = true; + break; case 'h': case '?': print_variants_usage(); @@ -418,7 +428,7 @@ int main(int argc, char *argv[]) { } res = call_variants_from_plup(std::cin, g_args.prefix, g_args.min_qual, g_args.min_threshold, g_args.min_depth, - g_args.ref, g_args.gff); + g_args.ref, g_args.gff, g_args.gapped_depth); } // ivar consensus else if (cmd.compare("consensus") == 0) { diff --git a/src/parse_gff.cpp b/src/parse_gff.cpp index 68ace20b..f9cdcc8a 100644 --- a/src/parse_gff.cpp +++ b/src/parse_gff.cpp @@ -37,18 +37,18 @@ gff3_feature::gff3_feature(std::string line) { } ctr++; } - if (ctr < 9) std::cout << "GFF file is not in GFF3 file format!" << std::endl; + if (ctr < 9) std::cerr << "GFF file is not in GFF3 file format!" << std::endl; line_stream.clear(); } int gff3_feature::print() { - std::cout << seqid << "\t" << source << "\t" << type << "\t" << start << "\t" + std::cerr << seqid << "\t" << source << "\t" << type << "\t" << start << "\t" << end << "\t" << score << "\t" << strand << "\t" << phase << "\t"; std::map::iterator it; for (it = attributes.begin(); it != attributes.end(); it++) { - std::cout << it->first << ": " << it->second << "; "; + std::cerr << it->first << ": " << it->second << "; "; } - std::cout << std::endl; + std::cerr << std::endl; return 0; } @@ -85,6 +85,8 @@ int gff3_feature::get_phase() { return phase; } std::string gff3_feature::get_type() { return type; } +char gff3_feature::get_strand() { return strand; } + int64_t gff3_feature::get_edit_position() { int64_t edit_pos = -1; std::map::iterator it; @@ -129,16 +131,22 @@ gff3::gff3(std::string path) { int gff3::read_file(std::string path) { std::ifstream fin = std::ifstream(path); if (!fin) { - std::cout << "GFF file does not exist at " << path << std::endl; + std::cerr << "GFF file does not exist at " << path << std::endl; return -1; } std::string line; while (std::getline(fin, line)) { if (line[0] == '#') // Avoid comments in GFF file continue; - features.push_back(gff3_feature(line)); + if(!line.empty()) + features.push_back(gff3_feature(line)); + } + if(!features.empty()){ + this->is_empty = false; + } else { + std::cerr << "GFF file is empty!" << std::endl; } - this->is_empty = false; + return 0; } diff --git a/src/parse_gff.h b/src/parse_gff.h index 8950fa8a..b31eb71a 100644 --- a/src/parse_gff.h +++ b/src/parse_gff.h @@ -1,3 +1,4 @@ +#include #include #include #include diff --git a/src/primer_bed.cpp b/src/primer_bed.cpp index b70c7a3c..9964f316 100644 --- a/src/primer_bed.cpp +++ b/src/primer_bed.cpp @@ -41,10 +41,10 @@ void primer::set_read_count(uint32_t rc) { read_count = rc; } void primer::add_read_count(uint32_t rc) { read_count += rc; } void print_bed_format() { - std::cout << "iVar uses the standard 6 column BED format as defined here - " + std::cerr << "iVar uses the standard 6 column BED format as defined here - " "https://genome.ucsc.edu/FAQ/FAQformat.html#format1." << std::endl; - std::cout << "It requires the following columns delimited by a tab: chrom, " + std::cerr << "It requires the following columns delimited by a tab: chrom, " "chromStart, chromEnd, name, score, strand" << std::endl; } @@ -93,7 +93,7 @@ std::vector populate_from_file(std::string path, int32_t offset = 0) { } else { print_bed_format(); // score is missing, send warning but continue // populating - std::cout + std::cerr << "\nWARNING: The BED file provided did not have the expected " "score column, but iVar will continue trimming\n" << std::endl; @@ -112,7 +112,7 @@ std::vector populate_from_file(std::string path, int32_t offset = 0) { ctr++; } if (indice == 0 && ctr < 6) - std::cout << "Strand not found in primer BED file so strand will not be " + std::cerr << "Strand not found in primer BED file so strand will not be " "considered for trimming" << std::endl; p.set_indice(indice); @@ -121,7 +121,7 @@ std::vector populate_from_file(std::string path, int32_t offset = 0) { primers.push_back(p); indice++; } - std::cout << "Found " << primers.size() << " primers in BED file" + std::cerr << "Found " << primers.size() << " primers in BED file" << std::endl; return primers; } @@ -169,7 +169,7 @@ std::vector populate_from_file(std::string path) { } else { print_bed_format(); // score is missing, send warning but continue // populating - std::cout + std::cerr << "\nWARNING: The BED file provided did not have the expected " "score column, but iVar will continue trimming\n" << std::endl; @@ -188,7 +188,7 @@ std::vector populate_from_file(std::string path) { ctr++; } if (indice == 0 && ctr < 6) - std::cout << "Strand not found in primer BED file so strand will not be " + std::cerr << "Strand not found in primer BED file so strand will not be " "considered for trimming" << std::endl; p.set_indice(indice); @@ -197,7 +197,7 @@ std::vector populate_from_file(std::string path) { primers.push_back(p); indice++; } - std::cout << "Found " << primers.size() << " primers in BED file" + std::cerr << "Found " << primers.size() << " primers in BED file" << std::endl; return primers; } @@ -266,7 +266,7 @@ int populate_pair_indices(std::vector& primers, std::string path) { if (indice != -1) { it->set_pair_indice(indice); } else { - std::cout << "Primer pair for " << p1 << " not found in BED file." + std::cerr << "Primer pair for " << p1 << " not found in BED file." << std::endl; } } else if (it->get_name() == p2) { @@ -274,12 +274,12 @@ int populate_pair_indices(std::vector& primers, std::string path) { if (indice != -1) it->set_pair_indice(indice); else - std::cout << "Primer pair for " << p2 << " not found in BED file." + std::cerr << "Primer pair for " << p2 << " not found in BED file." << std::endl; } } } else { - std::cout << "Primer pair is empty." << std::endl; + std::cerr << "Primer pair is empty." << std::endl; } } return 0; @@ -300,38 +300,21 @@ primer get_max_end(std::vector primers) { return *(minmax_start.second); } -// give a primer index, find its pair and return the primer -primer fetch_primer_pair(int16_t index, std::vector primers) { - /* - * @param index: the pair index for the primer of interest - * @return pair_primer: the primer object that's pairs with the primer of - * interest - */ - std::vector::iterator it; - primer pair_primer; - for (it = primers.begin(); it != primers.end(); ++it) { - if (it->get_indice() == index) { - return *it; - } - } - return (pair_primer); -} - void print_all_primer_info(std::vector primers) { std::vector::iterator it; for (it = primers.begin(); it != primers.end(); ++it) { - std::cout << "Primer name: " << it->get_name() << std::endl; - std::cout << "Primer start: " << it->get_start() << std::endl; - std::cout << "Primer end: " << it->get_end() << std::endl; - std::cout << "Indice: " << it->get_indice() << std::endl; - std::cout << "Pair indice: " << it->get_pair_indice() << std::endl; + std::cerr << "Primer name: " << it->get_name() << std::endl; + std::cerr << "Primer start: " << it->get_start() << std::endl; + std::cerr << "Primer end: " << it->get_end() << std::endl; + std::cerr << "Indice: " << it->get_indice() << std::endl; + std::cerr << "Pair indice: " << it->get_pair_indice() << std::endl; } } void print_primer_info(primer primer) { - std::cout << "Primer name: " << primer.get_name() << std::endl; - std::cout << "Primer start: " << primer.get_start() << std::endl; - std::cout << "Primer end: " << primer.get_end() << std::endl; - std::cout << "Indice: " << primer.get_indice() << std::endl; - std::cout << "Pair indice: " << primer.get_pair_indice() << std::endl; + std::cerr << "Primer name: " << primer.get_name() << std::endl; + std::cerr << "Primer start: " << primer.get_start() << std::endl; + std::cerr << "Primer end: " << primer.get_end() << std::endl; + std::cerr << "Indice: " << primer.get_indice() << std::endl; + std::cerr << "Pair indice: " << primer.get_pair_indice() << std::endl; } diff --git a/src/primer_bed.h b/src/primer_bed.h index 6a99f596..073becab 100644 --- a/src/primer_bed.h +++ b/src/primer_bed.h @@ -1,4 +1,5 @@ #include +#include #include #include #include @@ -13,11 +14,11 @@ class primer { uint32_t start; // 0 based uint32_t end; // 0 based std::string name; - int score; + int score = 0; char strand; int16_t pair_indice; int16_t indice; - uint32_t read_count; + uint32_t read_count = 0; public: std::string get_name(); @@ -49,7 +50,6 @@ std::vector populate_from_file(std::string path, int32_t offset); std::vector populate_from_file(std::string path); std::vector get_primers(std::vector p, unsigned int pos); int get_primer_indice(std::vector p, std::string name); -primer fetch_primer_pair(int16_t index, std::vector primers); int populate_pair_indices(std::vector& primers, std::string path); void print_primer_info(primer primers); void print_all_primer_info(std::vector primers); diff --git a/src/ref_seq.cpp b/src/ref_seq.cpp index 7ab539df..2ab74b67 100644 --- a/src/ref_seq.cpp +++ b/src/ref_seq.cpp @@ -1,5 +1,26 @@ #include "ref_seq.h" +// Complement base array +// Source: https://github.com/samtools/samtools/blob/024e3d5ef0a2b0b7049f1fde6faebe8249988a06/faidx.c#L56 +const unsigned char comp_base[256] = { + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, '!', '"', '#', '$', '%', '&', '\'', '(', ')', '*', '+', ',', '-', '.', '/', + '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ':', ';', '<', '=', '>', '?', + '@', 'T', 'V', 'G', 'H', 'E', 'F', 'C', 'D', 'I', 'J', 'M', 'L', 'K', 'N', 'O', + 'P', 'Q', 'Y', 'S', 'A', 'A', 'B', 'W', 'X', 'R', 'Z', '[', '\\',']', '^', '_', + '`', 't', 'v', 'g', 'h', 'e', 'f', 'c', 'd', 'i', 'j', 'm', 'l', 'k', 'n', 'o', + 'p', 'q', 'y', 's', 'a', 'a', 'b', 'w', 'x', 'r', 'z', '{', '|', '}', '~', 127, + 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, + 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, + 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, + 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, +}; + char ref_antd::get_base(int64_t pos, std::string region) { // 1-based position int len; char base = 0; @@ -11,6 +32,13 @@ char ref_antd::get_base(int64_t pos, std::string region) { // 1-based position return base; } +void ref_antd::reverse_complement_codon(char* codon) { + char temp = comp_base[(unsigned char)codon[2]]; + codon[2] = comp_base[(unsigned char)codon[0]]; + codon[0] = temp; + codon[1] = comp_base[(unsigned char)codon[1]]; +} + char *ref_antd::get_codon(int64_t pos, std::string region, gff3_feature feature) { int len; @@ -19,7 +47,6 @@ char *ref_antd::get_codon(int64_t pos, std::string region, std::string edit_sequence = feature.get_edit_sequence(); int64_t edit_sequence_size = edit_sequence.size(); char *codon = new char[3]; - int i; int64_t edit_offset = 0; if (pos > edit_pos + edit_sequence_size && edit_pos != -1) { edit_offset = @@ -27,12 +54,22 @@ char *ref_antd::get_codon(int64_t pos, std::string region, ? edit_sequence_size : (pos - edit_pos); // Account for edits in position of insertion } - codon_start_pos = - (feature.get_start() - 1) + feature.get_phase() + - (((pos + edit_offset - (feature.get_start() + feature.get_phase()))) / - 3) * - 3; - for (i = 0; i < 3; ++i) { + // codon_start_pos is w.r.t the reference sequence + if (feature.get_strand() == '-'){ + codon_start_pos = + (feature.get_end() - 1) - feature.get_phase() - + (((feature.get_end() - feature.get_phase() - (pos + edit_offset))) / + 3) * + 3; + codon_start_pos -= 2; // This is to get to codon start from the 3' end and then take reverse complement + } else { + codon_start_pos = + (feature.get_start() - 1) + feature.get_phase() + + (((pos + edit_offset - (feature.get_start() + feature.get_phase()))) / + 3) * + 3; + } + for (int i = 0; i < 3; i++) { if (codon_start_pos + i < (int32_t)feature.get_start() - 1 || codon_start_pos + i > (int32_t)feature.get_end() - @@ -53,6 +90,11 @@ char *ref_antd::get_codon(int64_t pos, std::string region, codon[i] = *(seq + codon_start_pos + i - edit_offset); } } + + if (feature.get_strand() == '-') { + reverse_complement_codon(codon); + } + free(seq); return codon; } @@ -73,11 +115,22 @@ char *ref_antd::get_codon(int64_t pos, std::string region, gff3_feature feature, ? edit_sequence_size : (pos - edit_pos); // Account for edits in position of insertion } - codon_start_pos = - (feature.get_start() - 1) + feature.get_phase() + - (((pos + edit_offset - (feature.get_start() + feature.get_phase()))) / - 3) * - 3; + // TODO: Remove code duplication with function above + // codon_start_pos is w.r.t the reference sequence + if (feature.get_strand() == '-'){ + codon_start_pos = + (feature.get_end() - 1) - feature.get_phase() - + (((feature.get_end() - feature.get_phase() - (pos + edit_offset))) / + 3) * + 3; + codon_start_pos -= 2; // This is to get to codon start from the 3' end and then take reverse complement + } else { + codon_start_pos = + (feature.get_start() - 1) + feature.get_phase() + + (((pos + edit_offset - (feature.get_start() + feature.get_phase()))) / + 3) * + 3; + } for (i = 0; i < 3; ++i) { if (codon_start_pos + i < edit_pos - 1 || edit_pos == -1) { // If before edit or with no edit @@ -104,6 +157,11 @@ char *ref_antd::get_codon(int64_t pos, std::string region, gff3_feature feature, } alt_pos += edit_offset; codon[alt_pos - 1 - codon_start_pos] = alt; + + if (feature.get_strand() == '-') { + reverse_complement_codon(codon); + } + free(seq); return codon; } @@ -168,10 +226,17 @@ int ref_antd::codon_aa_stream(std::string region, fout << codon2aa(alt_codon[0], alt_codon[1], alt_codon[2]) << "\t"; // adding amino acid position - int64_t start = it->get_start(); - int64_t aa_pos = ((pos - start) / 3) + 1; - fout << aa_pos; - fout << std::endl; + // factor in translation direction + char strand = it->get_strand(); + int64_t aa_pos; + if (strand == '-') { + int64_t end = it->get_end(); + aa_pos = ((end - pos) / 3) + 1; + } else { // when strand is equal to '+', '?', or others + int64_t start = it->get_start(); + aa_pos = ((pos - start) / 3) + 1; + } + fout << aa_pos << std::endl; delete[] ref_codon; delete[] alt_codon; diff --git a/src/ref_seq.h b/src/ref_seq.h index ca2df946..38be2982 100644 --- a/src/ref_seq.h +++ b/src/ref_seq.h @@ -11,6 +11,7 @@ #define ref_seq const char UNKNOWN_BASE = 'N'; +extern const unsigned char comp_base[256]; class ref_antd { public: @@ -18,6 +19,7 @@ class ref_antd { ref_antd(std::string ref_path, std::string gff_path); ~ref_antd(); char get_base(int64_t pos, std::string region); + void reverse_complement_codon(char* codon); int add_gff(std::string path); int add_seq(std::string path); int codon_aa_stream(std::string region, std::ostringstream &line_stream, diff --git a/src/trim_primer_quality.cpp b/src/trim_primer_quality.cpp index bfb1bb09..0b06b31e 100755 --- a/src/trim_primer_quality.cpp +++ b/src/trim_primer_quality.cpp @@ -89,7 +89,7 @@ cigar_ quality_trim(bam1_t *r, uint8_t qual_threshold, uint8_t sliding_window) { *cigar = bam_get_cigar(r); uint8_t *qual = bam_get_qual(r); int32_t start_pos; - if (((r->core.flag & BAM_FPAIRED) != 0) && bam_is_rev(r)) { + if (bam_is_rev(r)) { reverse = true; reverse_qual(qual, r->core.l_qseq); } @@ -168,10 +168,10 @@ cigar_ quality_trim(bam1_t *r, uint8_t qual_threshold, uint8_t sliding_window) { void print_cigar(uint32_t *cigar, int nlength) { for (int i = 0; i < nlength; ++i) { - std::cout << ((cigar[i]) & BAM_CIGAR_MASK); - std::cout << "-" << ((cigar[i]) >> BAM_CIGAR_SHIFT) << " "; + std::cerr << ((cigar[i]) & BAM_CIGAR_MASK); + std::cerr << "-" << ((cigar[i]) >> BAM_CIGAR_SHIFT) << " "; } - std::cout << std::endl; + std::cerr << std::endl; } // the tricky function to change, edit with caution @@ -300,7 +300,7 @@ cigar_ primer_trim(bam1_t *r, bool &isize_flag, int32_t new_pos, /* uint32_t p=0; while(p < j){ - std::cout << bam_cigar_op(ncigar[p]) << " " << bam_cigar_oplen(ncigar[p]) + std::cerr << bam_cigar_op(ncigar[p]) << " " << bam_cigar_oplen(ncigar[p]) <<"\n"; p++; }*/ @@ -330,9 +330,9 @@ void replace_cigar(bam1_t *b, uint32_t n, uint32_t *cigar) { void print_primers(std::vector primers) { for (std::vector::iterator it = primers.begin(); it != primers.end(); ++it) { - std::cout << "Get Start " << it->get_start() << "\n"; - std::cout << "Get End " << it->get_end() << "\n"; - std::cout << "Index " << it->get_indice() << "\n"; + std::cerr << "Get Start " << it->get_start() << "\n"; + std::cerr << "Get End " << it->get_end() << "\n"; + std::cerr << "Index " << it->get_indice() << "\n"; } } @@ -351,8 +351,24 @@ int binarySearch(std::vector primers, uint32_t item, int low, return low; } +int binary_search(std::vector &primers, uint32_t target_pos, int low, + int high) { + while (low <= high) { + int mid = low + (high - low) / 2; + //success condition + if (target_pos >= primers[mid].get_start() && target_pos <= primers[mid].get_end()) { + return mid; + } else if (target_pos > primers[mid].get_end()) { + low = mid + 1; + } else { + high = mid - 1; + } + } + return low; +} + + std::vector insertionSort(std::vector primers, uint32_t n) { - // std::cout << "in insertion sort length: " << n << "\n"; uint32_t i = 0; int loc = 0; int j = 0; @@ -373,7 +389,7 @@ std::vector insertionSort(std::vector primers, uint32_t n) { } // For paired reads -void get_overlapping_primers(bam1_t *r, std::vector primers, +void get_overlapping_primers(bam1_t *r, std::vector &primers, std::vector &overlapped_primers) { overlapped_primers.clear(); uint32_t start_pos = -1; @@ -384,23 +400,54 @@ void get_overlapping_primers(bam1_t *r, std::vector primers, } else { start_pos = r->core.pos; } - - // sort it first - std::vector test = insertionSort(primers, primers.size()); - // std::cout << test.size() << "\n"; + + int low = 0; + int high = primers.size(); // then we iterate and push what fits - for (std::vector::iterator it = test.begin(); it != test.end(); - ++it) { - // if we've passed the end, we're going to find no more matches - if (start_pos < it->get_start()) { - // std::cout << "break start_pos: " << start_pos << " start: " << - // it->get_end() << " end: " << it->get_start() << "\n"; - break; + int loc_exact = binary_search(primers, start_pos, low, + high); + primer possible_match; + if(loc_exact >= low && loc_exact < high){ + possible_match = primers[loc_exact]; + if(start_pos >= possible_match.get_start() && start_pos <= possible_match.get_end() && + (strand == possible_match.get_strand() || possible_match.get_strand() == 0)){ + overlapped_primers.push_back(possible_match); + } + } + int loc = 0; + bool done_right = false; + bool done_left = false; + int i = 1; + while(!done_left && !done_right){ + loc = loc_exact + i; + if(loc >= low && loc < high){ + possible_match = primers[loc]; + + if(start_pos >= possible_match.get_start() && start_pos <= possible_match.get_end() && + (strand == possible_match.get_strand() || possible_match.get_strand() == 0)){ + overlapped_primers.push_back(possible_match); + } + if(start_pos < possible_match.get_start()){ + done_right = true; + } + } else{ + done_right = true; } - if (start_pos >= it->get_start() && start_pos <= it->get_end() && - (strand == it->get_strand() || it->get_strand() == 0)) - // std::cout << it->get_start() << " " << start_pos << "\n"; - overlapped_primers.push_back(*it); + + loc = loc_exact - i; + if(loc >= low && loc < high){ + possible_match = primers[loc]; + if(start_pos >= possible_match.get_start() && start_pos <= possible_match.get_end() && + (strand == possible_match.get_strand() || possible_match.get_strand() == 0)){ + overlapped_primers.push_back(possible_match); + } + if(start_pos > possible_match.get_end()){ + done_left = true; + } + } else{ + done_left = true; + } + i++; } } @@ -443,7 +490,7 @@ void condense_cigar(cigar_ *t) { } } -void add_pg_line_to_header(bam_hdr_t **hdr, char *cmd) { +void add_pg_line_to_header(sam_hdr_t **hdr, char *cmd) { size_t len = strlen((*hdr)->text) + strlen(cmd) + 1; char *new_text = (char *)malloc(len); memcpy(new_text, (*hdr)->text, strlen((*hdr)->text)); @@ -481,11 +528,25 @@ bool amplicon_filter(IntervalTree amplicons, bam1_t *r) { return amplicon_flag; } +int iterate_aln(std::vector::iterator &aln_itr, + std::vector &alns, sam_hdr_t *&header, samFile *&in, + bam1_t *&aln) { + int iterate_reads; + aln_itr++; + if (aln_itr < alns.end() && alns.size() > 0) { + aln = *aln_itr; + iterate_reads = 1; + } else { + iterate_reads = sam_read1(in, header, aln); + } + return iterate_reads; +} + int trim_bam_qual_primer(std::string bam, std::string bed, std::string bam_out, - std::string region_, uint8_t min_qual, - uint8_t sliding_window, std::string cmd, - bool write_no_primer_reads, bool keep_for_reanalysis, - int min_length = 30, std::string pair_info = "", + uint8_t min_qual, uint8_t sliding_window, + std::string cmd, bool write_no_primer_reads, + bool keep_for_reanalysis, int min_length = -1, + std::string pair_info = "", int32_t primer_offset = 0) { int retval = 0; std::vector primers; @@ -493,7 +554,7 @@ int trim_bam_qual_primer(std::string bam, std::string bed, std::string bam_out, if (!bed.empty()) { primers = populate_from_file(bed, primer_offset); if (primers.size() == 0) { - std::cout << "Exiting." << std::endl; + std::cerr << "Exiting." << std::endl; return -1; } } @@ -502,84 +563,47 @@ int trim_bam_qual_primer(std::string bam, std::string bed, std::string bam_out, IntervalTree amplicons; if (!pair_info.empty()) { amplicons = populate_amplicons(pair_info, primers); + std::cerr << "Amplicons detected: " << std::endl; + amplicons.inOrder(); } - std::cout << "Amplicons detected: " << std::endl; - amplicons.inOrder(); - if (bam.empty()) { - std::cout << "Bam file is empty." << std::endl; - return -1; + // Read in input file + samFile *in; + + if(bam.empty()) { + std::cerr << "Reading from stdin" << std::endl; + in = sam_open("-", "r"); + } else { + in = sam_open(bam.c_str(), "r"); + std::cerr << "Reading from " << bam << std::endl; } - bam_out += ".bam"; - samFile *in = hts_open(bam.c_str(), "r"); - BGZF *out = bgzf_open(bam_out.c_str(), "w"); if (in == NULL) { - std::cout << ("Unable to open BAM file.") << std::endl; + std::cerr << ("Unable to open input file.") << std::endl; return -1; } - // Load the index - hts_idx_t *idx = sam_index_load(in, bam.c_str()); - if (idx == NULL) { - std::cout << "Building BAM index" << std::endl; - if (sam_index_build2(bam.c_str(), 0, 0) < 0) { - std::cout << ("Unable to open or build BAM index.") << std::endl; - return -1; - } else { - idx = sam_index_load(in, bam.c_str()); - } + + // Setup output file + samFile *out; + if(bam_out.empty()) { + out = sam_open("-", "w"); + } else { + bam_out += ".bam"; + out = sam_open(bam_out.c_str(), "wb"); } + // Get the header - bam_hdr_t *header = sam_hdr_read(in); + sam_hdr_t *header = sam_hdr_read(in); if (header == NULL) { - sam_close(in); - std::cout << "Unable to open BAM header." << std::endl; - } - add_pg_line_to_header(&header, const_cast(cmd.c_str())); - if (bam_hdr_write(out, header) < 0) { - std::cout << "Unable to write BAM header to path." << std::endl; - sam_close(in); + std::cerr << "Unable to read header from input file." << std::endl; return -1; } - // Get relevant region - int region_id = -1; - uint64_t unmapped, mapped, log_skip; - std::cout << std::endl - << "Number of references in file: " << header->n_targets - << std::endl; - for (int i = 0; i < header->n_targets; ++i) { - std::cout << header->target_name[i] << std::endl; - if (region_.compare(std::string(header->target_name[i])) == 0) { - region_id = i; - } - if (i == 0) { // Reading only first reference - region_.assign(header->target_name[i]); - region_id = i; - } - } - std::cout << "Using Region: " << region_ << std::endl << std::endl; - // Get index stats - hts_idx_get_stat(idx, region_id, &mapped, &unmapped); - std::cout << "Found " << mapped << " mapped reads" << std::endl; - std::cout << "Found " << unmapped << " unmapped reads" << std::endl; - std::string hdr_text(header->text); - if (hdr_text.find(std::string("SO:coordinate")) != std::string::npos) { - std::cout << "Sorted By Coordinate" << std::endl; // Sort by coordinate - } else if (hdr_text.find(std::string("SO:queryname")) != std::string::npos) { - std::cout << "Sorted By Query Name" << std::endl; // Sort by name - } else { - std::cout << "Not sorted" << std::endl; - } - std::cout << "-------" << std::endl; - log_skip = (mapped + unmapped > 10) ? (mapped + unmapped) / 10 : 2; - // Initialize iterator - hts_itr_t *iter = NULL; - // Move the iterator to the region we are interested in - iter = sam_itr_querys(idx, header, region_.c_str()); - if (header == NULL || iter == NULL) { + add_pg_line_to_header(&header, const_cast(cmd.c_str())); + if (sam_hdr_write(out, header) < 0) { + std::cerr << "Unable to write BAM header to path." << std::endl; sam_close(in); - std::cout << "Unable to iterate to region within BAM/SAM." << std::endl; return -1; } + // Initiate the alignment record bam1_t *aln = bam_init1(); int ctr = 0; @@ -596,15 +620,33 @@ int trim_bam_qual_primer(std::string bam, std::string bed, std::string bam_out, std::vector overlapping_primers; std::vector::iterator cit; bool primer_trimmed = false; - std::string test = "NB552570:188:HL75JAFX3:2:21105:7297:5549"; + std::vector alns; + bam1_t *tmp_aln = bam_init1(); + + //make default min_length default of expected read length + if(min_length == -1){ + int32_t total_length = 0; + int32_t read_itr = 0; + while(sam_read1(in, header, aln) >= 0 && read_itr < 1000){ + total_length += aln->core.l_qseq; + tmp_aln = bam_init1(); + tmp_aln = bam_copy1(tmp_aln, aln); + alns.push_back(tmp_aln); + read_itr++; + } + int32_t percent_query = 0.50 * (total_length / read_itr); + min_length = percent_query; + std::cerr << "Minimum Read Length based on " << read_itr << " reads: " << min_length << std::endl; + } + std::vector sorted_primers = insertionSort(primers, primers.size()); + + std::vector::iterator aln_itr = alns.begin(); // Iterate through reads - while (sam_itr_next(in, iter, aln) >= 0) { + while (iterate_aln(aln_itr, alns, header, in, aln) >= 0) { unmapped_flag = false; primer_trimmed = false; - - get_overlapping_primers(aln, primers, overlapping_primers); - + get_overlapping_primers(aln, sorted_primers, overlapping_primers); if ((aln->core.flag & BAM_FUNMAP) == 0) { // If mapped // if primer pair info provided, check if read correctly overlaps with // atleast one amplicon @@ -613,7 +655,7 @@ int trim_bam_qual_primer(std::string bam, std::string bed, std::string bam_out, if (!amplicon_flag) { if (keep_for_reanalysis) { // -k (keep) option aln->core.flag |= BAM_FQCFAIL; - if (bam_write1(out, aln) < 0) { + if (sam_write1(out, header, aln) < 0) { retval = -1; goto error; } @@ -622,14 +664,13 @@ int trim_bam_qual_primer(std::string bam, std::string bed, std::string bam_out, continue; } } - // isize is insert size // l_qseq is the query length isize_flag = (abs(aln->core.isize) - max_primer_len) > abs(aln->core.l_qseq); // if reverse strand if ((aln->core.flag & BAM_FPAIRED) != 0 && isize_flag) { // If paired - get_overlapping_primers(aln, primers, overlapping_primers); + get_overlapping_primers(aln, sorted_primers, overlapping_primers); if (overlapping_primers.size() > 0) { // If read starts before overlapping regions (?) primer_trimmed = true; @@ -672,25 +713,25 @@ int trim_bam_qual_primer(std::string bam, std::string bed, std::string bam_out, // Update read's left-most coordinate aln->core.pos += t.start_pos; replace_cigar(aln, t.nlength, t.cigar); + free(t.cigar); // Add count to primer cit = std::find(primers.begin(), primers.end(), cand_primer); if (cit != primers.end()) cit->add_read_count(1); } - // reverse primer unpaired read get_overlapping_primers(aln, primers, overlapping_primers, true); - if (overlapping_primers.size() > 0) { primer_trimmed = true; cand_primer = get_min_start(overlapping_primers); t = primer_trim(aln, isize_flag, cand_primer.get_start() - 1, true); replace_cigar(aln, t.nlength, t.cigar); + free(t.cigar); // Add count to primer cit = std::find(primers.begin(), primers.end(), cand_primer); if (cit != primers.end()) cit->add_read_count(1); } t = quality_trim(aln, min_qual, sliding_window); // Quality Trimming - if (bam_is_rev(aln)) // if reverse strand + if (bam_is_rev(aln)) // if reverse strand with reverse primers trimmed aln->core.pos = t.start_pos; condense_cigar(&t); replace_cigar(aln, t.nlength, t.cigar); @@ -702,13 +743,13 @@ int trim_bam_qual_primer(std::string bam, std::string bed, std::string bam_out, } else { unmapped_flag = true; unmapped_counter++; - continue; + continue; //CHANGE HERE } if (bam_cigar2rlen(aln->core.n_cigar, bam_get_cigar(aln)) >= min_length) { if (primer_trimmed) { // Write to BAM only if primer found. int16_t cand_ind = cand_primer.get_indice(); bam_aux_append(aln, "XA", 's', sizeof(cand_ind), (uint8_t *)&cand_ind); - if (bam_write1(out, aln) < 0) { + if (sam_write1(out, header, aln) < 0) { retval = -1; goto error; } @@ -718,14 +759,14 @@ int trim_bam_qual_primer(std::string bam, std::string bed, std::string bam_out, !unmapped_flag) { // -k only option aln->core.flag |= BAM_FQCFAIL; } - if (bam_write1(out, aln) < 0) { + if (sam_write1(out, header, aln) < 0) { retval = -1; goto error; } } else { // no -k option if ((primers.size() == 0 || write_no_primer_reads) && !unmapped_flag) { // -e only option - if (bam_write1(out, aln) < 0) { + if (sam_write1(out, header, aln) < 0) { retval = -1; goto error; } @@ -737,85 +778,82 @@ int trim_bam_qual_primer(std::string bam, std::string bed, std::string bam_out, low_quality++; if (keep_for_reanalysis) { aln->core.flag |= BAM_FQCFAIL; - if (bam_write1(out, aln) < 0) { + if (sam_write1(out, header, aln) < 0) { retval = -1; goto error; } } } ctr++; - if (ctr % log_skip == 0) { - std::cout << "Processed " << (ctr / log_skip) * 10 << "% reads ... " - << std::endl; + if (ctr % 1000000 == 0) { // TODO: Let this be a parameter + std::cerr << "Processed " << ctr << " reads ... " << std::endl; } } - std::cout << std::endl << "-------" << std::endl; - std::cout << "Results: " << std::endl; - std::cout << "Primer Name" + std::cerr << std::endl << "-------" << std::endl; + std::cerr << "Results: " << std::endl; + std::cerr << "Primer Name" << "\t" << "Read Count" << std::endl; for (cit = primers.begin(); cit != primers.end(); ++cit) { - std::cout << cit->get_name() << "\t" << cit->get_read_count() << std::endl; + std::cerr << cit->get_name() << "\t" << cit->get_read_count() << std::endl; } - std::cout << std::endl - << "Trimmed primers from " << round_int(primer_trim_count, mapped) + std::cerr << std::endl + << "Trimmed primers from " << round_int(primer_trim_count, ctr) << "% (" << primer_trim_count << ") of reads." << std::endl; - std::cout << round_int(low_quality, mapped) << "% (" << low_quality + std::cerr << round_int(low_quality, ctr) << "% (" << low_quality << ") of reads were quality trimmed below the minimum length of " << min_length << " bp and were "; if (keep_for_reanalysis) { - std::cout << "marked as failed" << std::endl; + std::cerr << "marked as failed" << std::endl; } else { - std::cout << "not written to file." << std::endl; + std::cerr << "not written to file." << std::endl; } if (write_no_primer_reads) { - std::cout << round_int(no_primer_counter, mapped) << "% (" + std::cerr << round_int(no_primer_counter, ctr) << "% (" << no_primer_counter << ")" << " of reads started outside of primer regions. Since the " << (keep_for_reanalysis ? "-ek flags were " : "-e flag was ") << "given, these reads were written to file"; - std::cout << "." << std::endl; + std::cerr << "." << std::endl; } else if (primers.size() == 0) { - std::cout - << round_int(no_primer_counter, mapped) << "% (" << no_primer_counter + std::cerr + << round_int(no_primer_counter, ctr) << "% (" << no_primer_counter << ") of reads started outside of primer regions. Since there were no " "primers found in BED file, these reads were written to file." << std::endl; } else { - std::cout << round_int(no_primer_counter, mapped) << "% (" + std::cerr << round_int(no_primer_counter, ctr) << "% (" << no_primer_counter << ") of reads that started outside of primer regions were "; if (keep_for_reanalysis) { - std::cout << "written to file and marked as failed"; + std::cerr << "written to file and marked as failed"; } else { - std::cout << "not written to file"; + std::cerr << "not written to file"; } - std::cout << std::endl; + std::cerr << std::endl; } if (unmapped_counter > 0) { - std::cout << unmapped_counter << " unmapped reads were not written to file." + std::cerr << unmapped_counter << " unmapped reads were not written to file." << std::endl; } if (amplicon_flag_ctr > 0) { - std::cout - << round_int(amplicon_flag_ctr, mapped) << "% (" << amplicon_flag_ctr + std::cerr + << round_int(amplicon_flag_ctr, ctr) << "% (" << amplicon_flag_ctr << ") reads were ignored because they did not fall within an amplicon" << std::endl; } if (failed_frag_size > 0) { - std::cout - << round_int(failed_frag_size, mapped) << "% (" << failed_frag_size + std::cerr + << round_int(failed_frag_size, ctr) << "% (" << failed_frag_size << ") of reads had their insert size smaller than their read length" << std::endl; } -error: - if (retval) std::cout << "Not able to write to BAM" << std::endl; - hts_itr_destroy(iter); - hts_idx_destroy(idx); + error: + if (retval) std::cerr << "Not able to write to BAM" << std::endl; bam_destroy1(aln); bam_hdr_destroy(header); sam_close(in); - bgzf_close(out); + sam_close(out); return retval; } diff --git a/src/trim_primer_quality.h b/src/trim_primer_quality.h index 499d262a..91ec6c52 100755 --- a/src/trim_primer_quality.h +++ b/src/trim_primer_quality.h @@ -38,11 +38,10 @@ inline void free_cigar(cigar_ t) { void add_pg_line_to_header(bam_hdr_t **hdr, char *cmd); int trim_bam_qual_primer(std::string bam, std::string bed, std::string bam_out, - std::string region_, uint8_t min_qual, - uint8_t sliding_window, std::string cmd, - bool write_no_primer_reads, bool mark_qcfail_flag, - int min_length, std::string pair_info, - int32_t primer_offset); + uint8_t min_qual, uint8_t sliding_window, + std::string cmd, bool write_no_primer_reads, + bool mark_qcfail_flag, int min_length, + std::string pair_info, int32_t primer_offset); void free_cigar(cigar_ t); int32_t get_pos_on_query(uint32_t *cigar, uint32_t ncigar, int32_t pos, int32_t ref_start); @@ -57,12 +56,14 @@ cigar_ primer_trim(bam1_t *r, bool &isize_flag, int32_t new_pos, bool unpaired_rev); void replace_cigar(bam1_t *b, uint32_t n, uint32_t *cigar); void condense_cigar(cigar_ *t); -void get_overlapping_primers(bam1_t *r, std::vector primers, +void get_overlapping_primers(bam1_t *r, std::vector &primers, std::vector &overlapping_primers); void get_overlapping_primers(bam1_t *r, std::vector primers, std::vector &overlapping_primers, bool unpaired_rev); int get_bigger_primer(std::vector primers); bool amplicon_filter(IntervalTree amplicons, bam1_t *r); - +std::vector insertionSort(std::vector primers, uint32_t n); +int binary_search(std::vector &primers, uint32_t target_pos, int low, + int high); #endif diff --git a/tests/Makefile.am b/tests/Makefile.am index d824a22c..6a205c1a 100755 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,12 +1,12 @@ LIBS = -lhts -lz -lpthread -CXXFLAGS = -g -std=c++11 -Wall -Wextra -Werror +CXXFLAGS = -g -std=c++11 -Wall -Wextra -Werror -Wno-unused-but-set-variable -TESTS = check_primer_trim check_trim check_quality_trim check_consensus check_allele_depth check_consensus_threshold check_consensus_min_depth check_consensus_seq_id check_primer_bed check_getmasked check_removereads check_variants check_common_variants check_unpaired_trim check_primer_trim_edge_cases check_isize_trim check_interval_tree check_amplicon_search check_consensus_min_insert_threshold -check_PROGRAMS = check_primer_trim check_trim check_quality_trim check_consensus check_allele_depth check_consensus_threshold check_consensus_min_depth check_consensus_seq_id check_primer_bed check_getmasked check_removereads check_variants check_common_variants check_unpaired_trim check_primer_trim_edge_cases check_isize_trim check_interval_tree check_amplicon_search check_consensus_min_insert_threshold +TESTS = check_primer_trim check_trim check_quality_trim check_consensus check_allele_depth check_consensus_threshold check_consensus_min_depth check_consensus_seq_id check_primer_bed check_getmasked check_removereads check_variants check_common_variants check_unpaired_trim check_primer_trim_edge_cases check_isize_trim check_interval_tree check_amplicon_search check_consensus_min_insert_threshold check_quality_trim_unpaired check_strand_variants +check_PROGRAMS = check_primer_trim check_trim check_quality_trim check_consensus check_allele_depth check_consensus_threshold check_consensus_min_depth check_consensus_seq_id check_primer_bed check_getmasked check_removereads check_variants check_common_variants check_unpaired_trim check_primer_trim_edge_cases check_isize_trim check_interval_tree check_amplicon_search check_consensus_min_insert_threshold check_quality_trim_unpaired check_strand_variants check_primer_trim_SOURCES = test_primer_trim.cpp ../src/trim_primer_quality.cpp ../src/primer_bed.cpp ../src/interval_tree.cpp check_trim_SOURCES = test_trim.cpp ../src/trim_primer_quality.cpp ../src/primer_bed.cpp ../src/interval_tree.cpp -check_quality_trim_SOURCES = check_quality_trim.cpp ../src/trim_primer_quality.cpp ../src/primer_bed.cpp ../src/interval_tree.cpp +check_quality_trim_SOURCES = test_quality_trim.cpp ../src/trim_primer_quality.cpp ../src/primer_bed.cpp ../src/interval_tree.cpp check_consensus_SOURCES = test_call_consensus_from_plup.cpp ../src/call_consensus_pileup.cpp ../src/allele_functions.cpp check_allele_depth_SOURCES = test_allele_depth.cpp ../src/allele_functions.cpp check_consensus_threshold_SOURCES = test_consensus_threshold.cpp ../src/call_consensus_pileup.cpp ../src/allele_functions.cpp @@ -23,3 +23,5 @@ check_primer_trim_edge_cases_SOURCES = test_primer_trim_edge_cases.cpp ../src/tr check_isize_trim_SOURCES = test_isize_trim.cpp ../src/trim_primer_quality.cpp ../src/primer_bed.cpp ../src/interval_tree.cpp check_interval_tree_SOURCES = test_interval_tree.cpp ../src/primer_bed.cpp ../src/interval_tree.cpp check_amplicon_search_SOURCES = test_amplicon_search.cpp ../src/trim_primer_quality.cpp ../src/primer_bed.cpp ../src/interval_tree.cpp +check_quality_trim_unpaired_SOURCES = test_quality_trim_unpaired.cpp ../src/trim_primer_quality.cpp ../src/primer_bed.cpp ../src/interval_tree.cpp +check_strand_variants_SOURCES = test_variants_reverse_strand.cpp ../src/call_variants.cpp ../src/allele_functions.cpp ../src/parse_gff.cpp ../src/ref_seq.cpp diff --git a/tests/test_isize_trim.cpp b/tests/test_isize_trim.cpp index 3d8ef978..79c35790 100755 --- a/tests/test_isize_trim.cpp +++ b/tests/test_isize_trim.cpp @@ -32,7 +32,7 @@ int test_isize_trim(uint8_t min_qual, uint8_t sliding_window, // Test and check result res = trim_bam_qual_primer( - bam, bed, prefix, region_, min_qual, sliding_window, cmd, no_write_flag, + bam, bed, prefix, min_qual, sliding_window, cmd, no_write_flag, keep_for_reanalysis, min_length, pair_info, primer_offset); if (res) { @@ -135,4 +135,4 @@ int main() { #define BAM_CIGAR_SHIFT 4 #define BAM_CIGAR_MASK 0xf #define BAM_CIGAR_TYPE 0x3C1A7 -*/ \ No newline at end of file +*/ diff --git a/tests/test_primer_trim.cpp b/tests/test_primer_trim.cpp index 7346ae71..dbc4a18c 100755 --- a/tests/test_primer_trim.cpp +++ b/tests/test_primer_trim.cpp @@ -70,6 +70,7 @@ int main() { unsigned int overlapping_primer_sizes[] = {0, 2, 2, 0, 0, 0, 0, 2, 2, 1}; int ctr = 0; std::vector overlapping_primers; + std::vector sorted_primers = insertionSort(primers, primers.size()); primer cand_primer; bool isize_flag = false; while (sam_itr_next(in, iter, aln) >= 0) { @@ -79,7 +80,7 @@ int main() { isize_flag = (abs(aln->core.isize) - max_primer_len) > abs(aln->core.l_qseq); std::cout << bam_get_qname(aln) << std::endl; - get_overlapping_primers(aln, primers, overlapping_primers); + get_overlapping_primers(aln, sorted_primers, overlapping_primers); if (overlapping_primers.size() != overlapping_primer_sizes[ctr]) { success = -1; std::cout << "Overlapping primer sizes for " << bam_get_qname(aln) @@ -163,6 +164,5 @@ int main() { sam_hdr_destroy(header); hts_idx_destroy(idx); hts_close(in); - return success; } diff --git a/tests/check_quality_trim.cpp b/tests/test_quality_trim.cpp similarity index 100% rename from tests/check_quality_trim.cpp rename to tests/test_quality_trim.cpp diff --git a/tests/test_quality_trim_unpaired.cpp b/tests/test_quality_trim_unpaired.cpp new file mode 100755 index 00000000..79050f95 --- /dev/null +++ b/tests/test_quality_trim_unpaired.cpp @@ -0,0 +1,43 @@ +#include + +#include "../src/trim_primer_quality.h" +#include "htslib/sam.h" + +int main() { + int success = 0; + std::string bam = "../data/test_unpaired.sorted.bam"; + std::string region_; + samFile *in = hts_open(bam.c_str(), "r"); + hts_idx_t *idx = sam_index_load(in, bam.c_str()); + bam_hdr_t *header = sam_hdr_read(in); + region_.assign(header->target_name[0]); + std::string temp(header->text); + hts_itr_t *iter = NULL; + iter = sam_itr_querys(idx, header, region_.c_str()); + bam1_t *aln = bam_init1(); + cigar_ t; + int lengths[] = {323, 756, 320, 227}, ctr = 0; + int start_pos_rev[] = {456, 23, 456, 549}; + int qual_thresholds[] = {20, 6, 20, 23}; + while (sam_itr_next(in, iter, aln) >= 0) { + t = quality_trim(aln, qual_thresholds[ctr], 4); + std::cout << bam_get_qname(aln) << std::endl; + std::cout << "POS: " << t.start_pos + << " Length: " << bam_cigar2rlen(t.nlength, t.cigar) << std::endl; + if (t.start_pos != start_pos_rev[ctr]) { + success = -1; + } + if (bam_cigar2rlen(t.nlength, t.cigar) != lengths[ctr]) { + success = -1; + } + free_cigar(t); + ctr++; + } + + bam_destroy1(aln); + bam_itr_destroy(iter); + sam_hdr_destroy(header); + hts_idx_destroy(idx); + hts_close(in); + return success; +} diff --git a/tests/test_trim.cpp b/tests/test_trim.cpp index 56709bf6..cb6db618 100755 --- a/tests/test_trim.cpp +++ b/tests/test_trim.cpp @@ -32,7 +32,7 @@ int test_trim(uint8_t min_qual, uint8_t sliding_window, bool no_write_flag, // Test and check result res = trim_bam_qual_primer( - bam, bed, prefix, region_, min_qual, sliding_window, cmd, no_write_flag, + bam, bed, prefix, min_qual, sliding_window, cmd, no_write_flag, keep_for_reanalysis, min_length, pair_info, primer_offset); if (res) { success = -1; diff --git a/tests/test_variants.cpp b/tests/test_variants.cpp index 20220660..aabc6a2c 100755 --- a/tests/test_variants.cpp +++ b/tests/test_variants.cpp @@ -11,7 +11,7 @@ int call_var_check_outfile(std::string prefix, uint8_t min_qual, std::string path = "../data/test.indel.mpileup"; std::ifstream mplp(path); call_variants_from_plup(mplp, prefix, min_qual, min_threshold, min_depth, - "../data/db/test_ref.fa", "../data/test.gff"); + "../data/db/test_ref.fa", "../data/test.gff", false); std::ifstream outFile(prefix + ".tsv"); std::string l; getline(outFile, l); // Ignore first line diff --git a/tests/test_variants_reverse_strand.cpp b/tests/test_variants_reverse_strand.cpp new file mode 100755 index 00000000..e2961d58 --- /dev/null +++ b/tests/test_variants_reverse_strand.cpp @@ -0,0 +1,45 @@ +#include +#include +#include + +#include "../src/allele_functions.h" +#include "../src/call_variants.h" + +int call_var_check_outfile(std::string prefix, uint8_t min_qual, + uint8_t min_depth, double min_threshold, + std::string out[], int len) { + std::string path = "../data/test.strand.pileup"; + std::ifstream mplp(path); + call_variants_from_plup(mplp, prefix, min_qual, min_threshold, min_depth, + "../data/db/test_ref.fa", "../data/test_strand.gff", false); + std::ifstream outFile(prefix + ".tsv"); + std::string l; + getline(outFile, l); // Ignore first line + int comp = 0, ctr = 0; + + while (ctr < len) { + getline(outFile, l); + std::cout << l << std::endl; + std::cout << out[ctr] << " -> CORRECT" << std::endl; + comp += l.compare(out[ctr]); + std::cout << l.compare(out[ctr]) << "\n"; + ctr++; + } + return comp; +} + +int main() { + int num_success = 0; + // Quality threshold 20. Frequency threshold: 0.03. Total_DP = 3. Indel passes + // filters with total_depth 4. Has two lines. + std::string expected_out[2] = { + "test\t5\tC\tT\t10\t0\t30\t10\t0\t30\t0.5\t20\t0.000290613\tTRUE\tA:test1\tGCT\tA\tGTT\tV\t2", + "test\t15\tG\tC\t10\t0\t30\t10\t0\t30\t0.5\t20\t0.000290613\tTRUE\tB:test2\tGTC\tV\tGTG\tV\t2" + }; + num_success = + call_var_check_outfile("../data/test_strand", 20, 0, 0.03, expected_out, 2); + std::cout << num_success << std::endl; + + if (num_success == 0) return 0; + return -1; +}