-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinterface.txt
More file actions
54 lines (40 loc) · 1.67 KB
/
interface.txt
File metadata and controls
54 lines (40 loc) · 1.67 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
Für jeden Predicter:
- Sequence liste: hits
ein hit ist ein Dictionary mit:
- hit_id: Der id des Hits
- hit_value: Der score des Values
- hit_order: True:max, False:min
- hit_from: hit start position
- hit_to: hit end position
Der Predictor sollte eine Methode getSimilar(seq="") implementieren.
===
Der k-Sequenzen auswähler:
Eine Funktion getSimilarSeqs(seq="", k=6), die eine Liste von hits (siehe oben zurückgibt)
Eine Funktion addMethod(method)
Eine Funktion deleteMethod(method)
Eine Funktion hasMethod(methode)
Eine Funktion getAllMethods()
Alle Methoden, die addbar sind, sollen threadsave sein
#! /usr/bin/env python
# This does a precalculation for blast and hhblits
import blast, hhblits
blastDB = "../data/genes_UniProt.fasta"
hhDB = "../data/PP2db"
out = "../data/lookup0.dat"
fastaFile = "../data/dataset_0.fa"
def predictSequence(file, id, seq, dbBlast, dbHHB, minEValBlast = 0.1):
print("Do record: " + str(record.id))
g.write("{}\n".format(id))
blastResults = blast.Blast.localBlast(seq=seq, database=dbBlast, minEVal=minEValBlast)
for hit in blastResults.hits:
g.write("\t{}\t{}\t{}\t{}\t{}\t{}\n".format(hit["method"], hit["hit_id"], hit["hit_value"], hit["hit_from"], hit["hit_to"], hit["hit_order"]))
hhblitsResults = hhblits.HHBLITS.localHHBLITS(seq=seq, database=dbHHB)
for hit in hhblitsResults.hits:
g.write("\t{}\t{}\t{}\t{}\t{}\t{}\n".format(hit["method"], hit["hit_id"], hit["hit_value"], hit["hit_from"], hit["hit_to"], hit["hit_order"]))
from Bio import SeqIO
g = open(out, "w+")
f = open(fastaFile, "rU")
for record in SeqIO.parse(f, "fasta"):
predictSequence(g, record.id, str(record.seq), blastDB, hhDB)
f.close()
g.close()