Last active
June 20, 2024 06:14
-
-
Save necrolyte2/b45a82fb4ecb0ffd70ab to your computer and use it in GitHub Desktop.
Convert fasta+qual to fastq. Writes to standard out so you can pipe or use >
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 python | |
import sys | |
from Bio import SeqIO | |
from Bio.SeqIO.QualityIO import PairedFastaQualIterator | |
import argparse | |
parser = argparse.ArgumentParser() | |
parser.add_argument('fasta', help='Fasta file') | |
parser.add_argument('qual', help='Qual file') | |
args = parser.parse_args() | |
records = PairedFastaQualIterator( | |
open(args.fasta), | |
open(args.qual) | |
) | |
for rec in records: | |
sys.stdout.write(rec.format('fastq')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment