<commit_before>r"""
FASTQ format :mod:`skbio.io.fastq`
==================================

.. currentmodule:: skbio.io.fastq

The FASTQ file stores biological sequences,in a plain text format.
Each entry in a FASTQ file contains a biological sequence, typically
DNA or RNA, and a quality score for each nucleotide. This format was
first specified in [1]_.  More information about this format can be
found at [2]_.

An example of a FASTQ-formatted file containing one DNA sequence and
their quality scores is shown below.

@GAPC_0015:6:1:1314:13295#0/1
AATATTGCTTTGTCTGAACGATAGTGCTCTTTGAT
+GAPC_0015:6:1:1314:13295#0/1
cLcc\\dddddaaYd`T```bLYT\`a```bZccc

Format Support
--------------
**Has Sniffer: Yes**

+----------+----------+------------------------------------------------------+
|**Reader**|**Writer**|                   **Object Class**                   |
+----------+----------+------------------------------------------------------+
|Yes       |No        |generator of :mod:`skbio.sequence.BiologicalSequence` |
|          |          |objects                                               |
+----------+----------+------------------------------------------------------+

Format Specification
--------------------
A FASTQ file contains one or more biological sequences with their corresponding
quality score. Each entry in the FASTQ file contains a sequence of nucleotides
a set of quality scores and optionally a description and a id.

Sequence Header
^^^^^^^^^^^^^^^
Each sequence header consists of a single line beginning with a (``@``) symbol.
Immediately after this symbol is a sequence identifier (ID) and an description
separated by one or more whitespace characters.

For example, consider the following header::

    @GAPC_0015:6:1:1314:13295#0/1  db-accession-149855

``GAPC_0015:6:1:1314:13295#0/1`` is the sequence ID and
``db-accession-149855`` is the sequence description

Quality Header
^^^^^^^^^^^^^^^
Each quality header consists of a single line beginning with a (``+``) symbol.
Immediately after this symbol is a quality identifier (ID) and an description
separated by one or more whitespace characters.

For example, consider the following header::

    +GAPC_0015:6:1:1314:13295#0/1  db-accession-149855

``GAPC_0015:6:1:1314:13295#0/1`` is the quality ID and
``db-accession-149855`` is the quality description

Examples
--------
Suppose we have the following FASTQ file with two sequences


    @GAPC_0017:6:1:1259:10413#0/1
    AACACCAAACTTCTCCACCACGTGAGCTACAAAAG
    +GAPC_0015:6:1:1259:10413#0/1
    ````Y^T]`]c^cabcacc`^Lb^ccYT\T\Y\WF
    @GAPC_0015:6:1:1283:11957#0/1
    TATGTATATATAACATATACATATATACATACATA
    +GAPC_0015:6:1:1283:11957#0/1
    ]KZ[PY]_[YY^```ac^\\`bT``c`\aT``bbb

>>> from StringIO import StringIO
>>> fh = StringIO(
...        "@GAPC_0017:6:1:1259:10413#0/1\n"
...        "AACACCAAACTTCTCCACCACGTGAGCTACAAAAG\n"
...        "+GAPC_0015:6:1:1259:10413#0/1\n"
...        ";;;;;;;;;;;9;7;;.7;393333;;;;;;;;;;\n"
...        "@GAPC_0015:6:1:1283:11957#0/1\n"
...        "TATGTATATATAACATATACATATATACATACATA\n"
...        "+GAPC_0015:6:1:1283:11957#0/1\n"
...        "!''*((((***+))%%%++)(%%%%).1***-+*'\n")


Now read in the FASTQ file

>>> from skbio.io import read<commit_msg>Formatting docs<commit_after>r"""
FASTQ format :mod:`skbio.io.fastq`
==================================

.. currentmodule:: skbio.io.fastq

The FASTQ file stores biological sequences,in a plain text format.
Each entry in a FASTQ file contains a biological sequence, typically
DNA or RNA, and a quality score for each nucleotide. This format was
first specified in [1]_.  More information about this format can be
found at [2]_.

An example of a FASTQ-formatted file containing one DNA sequence and
their quality scores is shown below.

@GAPC_0015:6:1:1314:13295#0/1
AATATTGCTTTGTCTGAACGATAGTGCTCTTTGAT
+GAPC_0015:6:1:1314:13295#0/1
cLcc\\dddddaaYd`T```bLYT\`a```bZccc

Format Support
--------------
**Has Sniffer: Yes**

+----------+----------+------------------------------------------------------+
|**Reader**|**Writer**|                   **Object Class**                   |
+----------+----------+------------------------------------------------------+
|Yes       |No        |generator of :mod:`skbio.sequence.BiologicalSequence` |
|          |          |objects                                               |
+----------+----------+------------------------------------------------------+

Format Specification
--------------------
A FASTQ file contains one or more biological sequences with their corresponding
quality score. Each entry in the FASTQ file contains a sequence of nucleotides
a set of quality scores and optionally a description and a id.

Sequence Header
^^^^^^^^^^^^^^^
Each sequence header consists of a single line beginning with a (``@``) symbol.
Immediately after this symbol is a sequence identifier (ID) and an description
separated by one or more whitespace characters.

For example, consider the following header::

    @GAPC_0015:6:1:1314:13295#0/1  db-accession-149855

``GAPC_0015:6:1:1314:13295#0/1`` is the sequence ID and
``db-accession-149855`` is the sequence description

Quality Header
^^^^^^^^^^^^^^^
Each quality header consists of a single line beginning with a (``+``) symbol.
Immediately after this symbol is a quality identifier (ID) and an description
separated by one or more whitespace characters.

For example, consider the following header::

    +GAPC_0015:6:1:1314:13295#0/1  db-accession-149855

``GAPC_0015:6:1:1314:13295#0/1`` is the quality ID and
``db-accession-149855`` is the quality description

Examples
--------
Suppose we have a FASTQ file with two sequences

>>> from StringIO import StringIO
>>> fh = StringIO(
...        "@GAPC_0017:6:1:1259:10413#0/1\n"
...        "AACACCAAACTTCTCCACCACGTGAGCTACAAAAG\n"
...        "+GAPC_0015:6:1:1259:10413#0/1\n"
...        ";;;;;;;;;;;9;7;;.7;393333;;;;;;;;;;\n"
...        "@GAPC_0015:6:1:1283:11957#0/1\n"
...        "TATGTATATATAACATATACATATATACATACATA\n"
...        "+GAPC_0015:6:1:1283:11957#0/1\n"
...        "!''*((((***+))%%%++)(%%%%).1***-+*'\n")


Now read in the FASTQ file

>>> from skbio.io import read
{'fraction_non_alphanumeric': 0.22447984395318596, 'fraction_numerical': 0.07802340702210664, 'mean_word_length': 2.5669565217391304, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6154797', 'n_tokens_mistral': 2253, 'n_tokens_neox': 1941, 'n_words': 541}