1 # BLASTN 2.0a19MP-WashU [05-Feb-1998] [Build decunix3.2 01:53:29 05-Feb-1998]
2 # BLASTP 2.0.4 [Feb-24-1998]
4 def __init__(self, name, version, description = ""):
5 self.name = name # 'blastx', 'blastn', etc.
6 self.version = version # '2.1.2' or '2.0a19MP-WashU'
7 self.description = description # '[05-Feb-1998] [Build dec ...1998]'
9 # Query= YAL001C YAL001C, Chr I from 147596 to 147665, and 147756 to 151168,
13 def __init__(self, name, accession, description, length):
14 self.name = name # 'YAL001C'
15 self.accession = accession # or None if missing
16 self.description = description # 'YAL001C, Chr I from 147596 to ... '
17 self.length = length # 3483
19 # Database: ArabidopsisN
20 # 66,211 sequences; 69,074,155 total letters.
22 def __init__(self, name, letters, entries):
23 self.name = name # ArabidopsisN
24 self.letters = letters # 69074155
25 self.entries = entries # 66211
28 def __init__(self, full_description, info):
29 self.__dict__.update(info)
30 self.full_description = full_description
34 def __init__(self, algorithm, query, database, table, hits,
35 parameters, statistics):
36 self.algorithm = algorithm
38 self.database = database
41 self.parameters = parameters
42 self.statistics = statistics
45 def __init__(self, name, description, accession, length,
46 algorithm, hsps = None):
48 self.description = description
49 self.accession = accession
51 self.algorithm = algorithm
61 # >GB_PL:ATF18F4 AL021637 Arabidopsis thaliana DNA chromosome 4, BAC clone
62 # F18F4 (ESSAII project). 2/98
67 # Score = 226 (33.9 bits), Expect = 0.80, P = 0.55
68 # Identities = 98/142 (69%), Positives = 98/142 (69%), Strand = Minus / Plus
69 # [...lines deleted...]
70 # Query: 2486 ATATCAAGCAATTTGATAAGATCTAG 2461
71 # A AT A C ATT GA AAGATC AG
72 # Sbjct: 85387 AGATTTACCTATT-GAGAAGATCAAG 85411
74 # computed from the strings
76 def __init__(self, length, identical, positives, gaps):
78 self.identical = identical
79 self.positives = positives
83 def __getattr__(self, name):
84 if name == "frac_identical":
85 return float(self.identical) / self.length
86 elif name == "frac_positives":
87 return float(self.positives) / self.length
88 raise AttributeError(name)
91 class HomologySeq(_SeqLength):
92 def __init__(self, seq, identical, positives, gaps):
93 _SeqLength.__init__(self, len(seq), identical, positives, gaps)
96 class HSPSeq(_SeqLength):
97 def __init__(self, name, seq, location, identical, positives, gaps):
98 _SeqLength.__init__(self, len(seq), identical, positives, gaps)
101 self.location = location
104 class HSP(_SeqLength):
106 query_seq, # ATATCAAGCAATTTGATAAGATCTAG
107 homology_seq, # A AT A C ATT GA AAGATC AG
108 subject_seq, # AGATTTACCTATT-GAGAAGATCAAG
110 query_location, # (2486, 2461, negative strand)
111 subject_location, # (85387, 85411)
113 query_name, # Query (or None)
114 subject_name, # Sbjct (or None)
116 algorithm, # an Algorithm
117 info, # contains Key/value pairs
118 homology_gaps = None, # Is this needed?
120 assert len(query_seq) == len(homology_seq) == len(subject_seq), \
121 (query_seq, homology_seq, subject_seq)
122 self.algorithm = algorithm
124 query_gaps = query_seq.count("-")
125 subject_gaps = subject_seq.count("-")
126 if homology_gaps is None:
127 homology_gaps = query_gaps + subject_gaps
130 identical = info["identical"]
131 # bioperl calls this 'conserved'
132 positives = info.get("positives", identical)
134 _SeqLength.__init__(self, len(query_seq), identical,
135 positives, homology_gaps)
137 self.query = HSPSeq(name = query_name,
139 location = query_location,
140 identical = identical,
141 positives = positives,
144 self.subject = HSPSeq(name = subject_name,
146 location = subject_location,
147 identical = identical,
148 positives = positives,
150 self.homology = HomologySeq(seq = homology_seq,
151 identical = identical,
152 positives = positives,
153 gaps = homology_gaps)