-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathatgcuker.py
More file actions
75 lines (38 loc) · 1009 Bytes
/
atgcuker.py
File metadata and controls
75 lines (38 loc) · 1009 Bytes
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
70
71
72
73
74
75
#coding=utf8
import time
import timeit
import os
import sqlite3
#score=[]
# fix1 28.06.2018 XXXXXXXXX BAD_END
pgen_path = 'MammalsGenomesWithEcology.fasta.txt'
#pgen_path = 'test.fa'
#path2=open("uni.txt",'r')
path3=("lenatgc.csv")
reps = open(path3, "w")
#for n in range(10):
br=3713
while True:
uname = path2.readline()[:-1]
print uname
pgen = open(pgen_path,'r')
#uname = "Zu_cristatus"
pr=1
while True:
name = pgen.readline()[1:-1]
genome = pgen.readline()
length=len(genome)
#print uname+" "+name
if (uname==name.replace(" ","_")):
a = genome.count("A")
t = genome.count("T")
g = genome.count("G")
c = genome.count("C")
reps.write("%s %s %s %s %s %s %s %s\n" % (br,uname,pr,name,a,t,g,c))
break
pr=pr+1
if pr>3954:
break
br=br+1
if br>3717:
break