The DNA to FASTQ Encoder provides tool to load binary DNA file and outputs encoded DNA sequence in FASTQ format. The project consists of a Python script (main.py
) for command-line usage and a core Python module (dna_to_fastq_encoder.py
) that defines the decoding logic.
- Python 3.6 or later
To decode a binary-encoded DNA file into FASTQ format and print the output to the standard output, use the main.py
script as follows:
python main.py -f path/to/binary/file -l 80
Where:
-f
or--file
specifies the path to the binary-encoded DNA file.-l
or--length
specifies the length of the decoded DNA sequence.
You can also use the DnaToFastqEncoder
class within your Python projects:
from dna_to_fastq_encoder import DnaToFastqEncoder
Encoder = DnaToFastqEncoder(filepath='path/to/binary/file', l=100)
for fastq_str in Encoder.decode_to_fastq():
print(fastq_str)
This project includes a testsuite to verify the functionality of the DnaToFastqEncoder
class. To run the tests:
- ensure you have
pytest
installed - set up
TEST_FILES_PATH
variable intest_dna_to_fastq_encoder.py
- execute the following command in the project directory:
pytest