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 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116
|
The dnaio API
=============
.. module:: dnaio
The open function
-----------------
.. autofunction:: open
The ``SequenceRecord`` class
------------------------------
.. autoclass:: dnaio.SequenceRecord
:members:
:special-members: __len__, __getitem__
.. automethod:: __init__(name: str, sequence: str, qualities: Optional[str] = None)
Reader and writer interfaces
----------------------------
.. autoclass:: SingleEndReader
:members: __iter__
.. autoclass:: PairedEndReader
:members: __iter__
.. autoclass:: SingleEndWriter
:members: write
.. autoclass:: PairedEndWriter
:members: write
.. autoclass:: MultipleFileWriter
:members: write, write_iterable
Reader and writer classes
-------------------------
The `dnaio.open` function returns an instance of one of the following classes.
They can also be used directly if needed.
.. autoclass:: FastaReader
:show-inheritance:
.. autoclass:: FastaWriter
:show-inheritance:
.. autoclass:: FastqReader
:show-inheritance:
.. autoclass:: FastqWriter
:show-inheritance:
.. autoclass:: BamReader
:show-inheritance:
.. autoclass:: TwoFilePairedEndReader
:show-inheritance:
.. autoclass:: TwoFilePairedEndWriter
:show-inheritance:
.. autoclass:: InterleavedPairedEndReader
:show-inheritance:
.. autoclass:: InterleavedPairedEndWriter
:show-inheritance:
.. autoclass:: MultipleFileReader
:members: __iter__
.. autoclass:: MultipleFastaWriter
:show-inheritance:
.. autoclass:: MultipleFastqWriter
:show-inheritance:
Chunked reading of sequence records
-----------------------------------
The following functions can be used to very quickly split up the input file(s)
into similarly-sized chunks without actually parsing the records. The chunks
can then be distributed to worker threads or subprocesses and be parsed and
processed there.
.. autofunction:: read_chunks
.. autofunction:: read_paired_chunks
Functions
---------
.. autofunction:: records_are_mates
Exceptions
----------
.. autoexception:: UnknownFileFormat
.. autoexception:: FileFormatError
.. autoexception:: FastaFormatError
:show-inheritance:
.. autoexception:: FastqFormatError
:show-inheritance:
|