Skip to content

Instantly share code, notes, and snippets.

@mscook
Created May 12, 2014 06:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mscook/2ac9e97696000ad61f4d to your computer and use it in GitHub Desktop.
Save mscook/2ac9e97696000ad61f4d to your computer and use it in GitHub Desktop.
Gives an idea on what PHRED encoding
import glob
import os
inf = glob.glob("*.gz")
rlen = 76.0
for f in inf:
tmp = f.split(".fastq.gz")[0]
os.system("zcat "+f+" | head -n 4 | tail -n 1 > "+tmp)
with open(tmp) as fin:
cur = 0
line = fin.readlines()[0].strip()
for c in line:
cur = cur+ord(c)
print tmp,cur/rlen-33,cur/rlen-64
os.system("rm "+tmp)
@mscook
Copy link
Author

mscook commented May 12, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment