Mercurial > repos > devteam > blast_datatypes
comparison blast.py @ 9:2bda64d39931 draft
Uploaded v0.0.19, adds blastdbp and pssm-asn1 datatypes.
author | peterjc |
---|---|
date | Wed, 26 Nov 2014 06:55:48 -0500 |
parents | de11e1a921c4 |
children | 5482a8cd0f36 |
comparison
equal
deleted
inserted
replaced
8:de11e1a921c4 | 9:2bda64d39931 |
---|---|
1 """ | 1 """ |
2 BlastXml class | 2 BlastXml class |
3 """ | 3 """ |
4 | 4 |
5 from galaxy.datatypes.data import get_file_peek | 5 from galaxy.datatypes.data import get_file_peek |
6 from galaxy.datatypes.data import Text, Data | 6 from galaxy.datatypes.data import Text, Data, GenericAsn1 |
7 from galaxy.datatypes.xml import GenericXml | 7 from galaxy.datatypes.xml import GenericXml |
8 from galaxy.datatypes.metadata import MetadataElement | 8 from galaxy.datatypes.metadata import MetadataElement |
9 | 9 |
10 from time import sleep | 10 from time import sleep |
11 import os | 11 import os |
178 to_ext, size, offset, **kwd) | 178 to_ext, size, offset, **kwd) |
179 if self.file_ext == "blastdbn": | 179 if self.file_ext == "blastdbn": |
180 title = "This is a nucleotide BLAST database" | 180 title = "This is a nucleotide BLAST database" |
181 elif self.file_ext =="blastdbp": | 181 elif self.file_ext =="blastdbp": |
182 title = "This is a protein BLAST database" | 182 title = "This is a protein BLAST database" |
183 elif self.file_ext =="blastdbd": | |
184 title = "This is a domain BLAST database" | |
183 else: | 185 else: |
184 #Error? | 186 #Error? |
185 title = "This is a BLAST database." | 187 title = "This is a BLAST database." |
186 msg = "" | 188 msg = "" |
187 try: | 189 try: |
188 #Try to use any text recorded in the dummy index file: | 190 #Try to use any text recorded in the dummy index file: |
189 handle = open(data.file_name, "rU") | 191 handle = open(data.file_name, "rU") |
257 self.add_composite_file('blastdb.psi', is_binary=True, optional=True) | 259 self.add_composite_file('blastdb.psi', is_binary=True, optional=True) |
258 # self.add_composite_file('blastdb.paa', is_binary=True, optional=True) | 260 # self.add_composite_file('blastdb.paa', is_binary=True, optional=True) |
259 # self.add_composite_file('blastdb.pab', is_binary=True, optional=True) | 261 # self.add_composite_file('blastdb.pab', is_binary=True, optional=True) |
260 # self.add_composite_file('blastdb.pac', is_binary=True, optional=True) | 262 # self.add_composite_file('blastdb.pac', is_binary=True, optional=True) |
261 # The last 3 lines should be repeated for each WriteDB column, with filename extensions like ('.pba', '.pbb', '.pbc'), ('.pca', '.pcb', '.pcc'), etc. | 263 # The last 3 lines should be repeated for each WriteDB column, with filename extensions like ('.pba', '.pbb', '.pbc'), ('.pca', '.pcb', '.pcc'), etc. |
264 | |
265 | |
266 class BlastDomainDb( _BlastDb, Data ): | |
267 """Class for domain BLAST database files.""" | |
268 file_ext = 'blastdbd' | |
269 allow_datatype_change = False | |
270 composite_type = 'basic' | |
271 | |
272 def __init__(self, **kwd): | |
273 Data.__init__(self, **kwd) | |
274 self.add_composite_file('blastdb.phr', is_binary=True) | |
275 self.add_composite_file('blastdb.pin', is_binary=True) | |
276 self.add_composite_file('blastdb.psq', is_binary=True) | |
277 self.add_composite_file('blastdb.freq', is_binary=True, optional=True) | |
278 self.add_composite_file('blastdb.loo', is_binary=True, optional=True) | |
279 self.add_composite_file('blastdb.psd', is_binary=True, optional=True) | |
280 self.add_composite_file('blastdb.psi', is_binary=True, optional=True) | |
281 self.add_composite_file('blastdb.rps', is_binary=True, optional=True) | |
282 self.add_composite_file('blastdb.aux', is_binary=True, optional=True) |