-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpython_script10.py
More file actions
executable file
·69 lines (48 loc) · 1.07 KB
/
python_script10.py
File metadata and controls
executable file
·69 lines (48 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#! /usr/bin/env pyton3
import sys
import math
import re
import statistics
fasta = open(sys.argv[1], "r")
linecount = 0
seq = []
seqcount = 0
#for i, line in enumerate(fasta):
# line = line.rstrip('\n')
# if i%3 == 0 and i%2 != 0: #for every 3rd line
# seqcount += 1
# seq.append(len(line))
#print(seq)
#print(seqcount)
#print(statistics.mean(seq))
#print(statistics.stdev(seq))
#fasta.close()
#trim a fastq so that it removes every value with a Q < 20.
remindex = []
for i, line in enumerate(fasta):
if i%4 == 0:
line.rstrip()
line.join('\n')
# print(i)
# print(line)
#Illumina Q = ASCII value. Q = 64 + Phredd score
# if line != remindex:
remindex.append(line)
print(remindex[:5])
ascii_index = []
for item in remindex:
for pos in item:
pos = ord(pos)
ascii_index.append(pos)
print(ascii_index[:58])
print(ascii_index[56:120])
index_list = []
for i, line in enumerate(ascii_index):
if line < 84:
index_list.append(i)
print(index_list[:5])
#for i, line in enumerate(fasta):
# if i%4 == 0:
# for i, char in enumerate(line):
# if i =
fasta.close()