Last active
January 29, 2021 14:11
-
-
Save marcelm/af99da7dea5ac93cfaaa5fac946c6b00 to your computer and use it in GitHub Desktop.
FASTA to FASTQ conversion
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
""" | |
Run with: | |
fasta2fastq < in.fasta > out.fastq | |
""" | |
import dnaio | |
import sys | |
with dnaio.open(sys.stdin.buffer) as inf: | |
with dnaio.open(sys.stdout.buffer, mode="w", fileformat="fastq") as outf: | |
for record in inf: | |
record.qualities = "H" * len(record.sequence) | |
outf.write(record) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment