Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import re
- if __name__ == '__main__':
- f = open("reads1.fastq", "r")
- k = 0
- i = 0
- let = 0
- q_score = 0
- for line in f:
- line = line.strip()
- if line.isalpha() and "D" not in line:
- k += len(line)
- for letter in line:
- let += 1
- if line[0] == "@":
- i += 1
- if line == '+':
- next_line = f.readline()
- for l in next_line:
- if ord(l) - 33 >= 30:
- q_score += 1
- print(i)
- print(k)
- print(round(k / i, 2))
- print(round(q_score / let * 100, 2))
Add Comment
Please, Sign In to add comment