NanoStat
========

Calculate various statistics from a long read sequencing dataset in
fastq, bam or albacore sequencing summary format.

|Twitter URL| |install with conda| |Build Status| |Code Health|

INSTALLATION
~~~~~~~~~~~~

| ``pip install nanostat``
| or
| ``conda install -c bioconda nanostat``

USAGE
~~~~~

::

    NanoStat [-h] [-v] [-o OUTDIR] [-p PREFIX] [-t THREADS]
                    (--fastq FASTQ | --summary SUMMARY | --bam BAM)


    Mandatory one of the following data sources:
    --fastq FASTQ         Data is in fastq format.
    --summary SUMMARY     Data is a summary file generated by albacore.
    --bam BAM             Data as a sorted bam file.
    Specifying a list of files of the same type is supported.

    Optional arguments:
      --readtype            Specify read type to extract from summary file
                            Options: 1D (default), 2D or 1D2
      -h, --help            show this help message and exit
      -v, --version         Print version and exit.
      -o, --outdir OUTDIR   Specify directory in which output has to be created.
      -n, --name NAME       Specify a custom filename/path for the output,
                            <stdout> for printing to stdout.
      -p, --prefix PREFIX   Specify an optional prefix to be used for the output files.
      -t, --threads THREADS Set the allowed number of threads to be used by the script
                            This only applies to bam and fastq format as data source

EXAMPLES
^^^^^^^^

::

    NanoStat --fastq reads.fastq.gz --outdir statreports
    NanoStat --summary sequencing_summary1.txt sequencing_summary2.txt sequencing_summary3.txt --readtype 1D2
    NanoStat --bam alignment.bam alignment2.bam```

    ### Example output

Number of reads: 99875 Total bases: 779100562 Median read length: 5456.0
Mean read length: 7800.76 Readlength N50: 12658

Top 5 read lengths and their average basecall quality score: Length:
299625bp Q: 10.36 Length: 272879bp Q: 9.99 Length: 271441bp Q: 10.94
Length: 261038bp Q: 8.0 Length: 250267bp Q: 7.74

Top 5 average basecall quality scores and their read lengths: Length:
1455bp Q: 16.54 Length: 3634bp Q: 16.48 Length: 733bp Q: 16.23 Length:
515bp Q: 16.2 Length: 909bp Q: 15.89

Number of reads and fraction above quality cutoffs: Q5: 88489 88.6% Q10:
61809 61.89% Q15: 175 0.18% Q20: 0 0.0%

Data produced using 512 active channels.

Data was produced in run(s) with ID:
002dc25e406b22dd8e4d2a5ee83dcbb67072e10d
005aaa922c42c455c07a472a9c30f0209f1b0d93
00b31b64541f79ff1f562c3e3602d3f265cd3b05
00c9faabd00f4676a2255da178a62c1fe6ae061b
00f9dec9cb591f4cb4c60c129f87faf731323386 \`\`\`

I welcome all suggestions, bug reports, feature requests and
contributions. Please leave an
`issue <https://github.com/wdecoster/nanostat/issues>`__ or open a pull
request. I will usually respond within a day, or rarely within a few
days.

.. |Twitter URL| image:: https://img.shields.io/twitter/url/https/twitter.com/wouter_decoster.svg?style=social&label=Follow%20%40wouter_decoster
   :target: https://twitter.com/wouter_decoster
.. |install with conda| image:: https://anaconda.org/bioconda/nanostat/badges/installer/conda.svg
   :target: https://anaconda.org/bioconda/nanostat
.. |Build Status| image:: https://travis-ci.org/wdecoster/nanostat.svg?branch=master
   :target: https://travis-ci.org/wdecoster/nanostat
.. |Code Health| image:: https://landscape.io/github/wdecoster/nanostat/master/landscape.svg?style=flat
   :target: https://landscape.io/github/wdecoster/nanostat/master
