Skip to content

Instantly share code, notes, and snippets.

Created June 20, 2013 22:41
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Reverse a qual score file. May be needed when trying to match up reverse complemented fasta files.
#!/usr/bin/env python
""" Used to reverse a qual score sequence, which may be needed in cases of
paired fasta/qual files.
Requires QIIME installed to use (created with 1.7.0dev)
python X Y
where X is qual scores filepath, Y is output reversed filepath
from sys import argv
from qiime.parse import MinimalQualParser
from qiime.split_libraries import format_qual_output
input_qual = open(argv[1], "U")
output_qual = open(argv[2], "w")
for label, seq in MinimalQualParser(input_qual, full_header=True):
output_qual.write(">%s\n%s" % (label, format_qual_output(seq[::-1])))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment