Skip to content

Instantly share code, notes, and snippets.

@dnbaker
Last active April 23, 2016 03:54
Show Gist options
  • Save dnbaker/0886c010ad21be2189a6 to your computer and use it in GitHub Desktop.
Save dnbaker/0886c010ad21be2189a6 to your computer and use it in GitHub Desktop.
Get list of all quality scores found in quality strings in a bam
import pysam
from itertools import chain
def get_qchars(bampath):
return set(chain.from_iterable(set(c.qual) for
c in pysam.AlignmentFile(bampath)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment