| Previous changeset 14:623a3fbe5340 (2017-02-03) Next changeset 16:63befb860c3e (2018-06-05) |
|
Commit message:
planemo upload for repository https://github.com/peterjc/galaxy_blast/tree/master/datatypes/blast_datatypes/ commit 96d587fc6f6cab23c597e88a83daf7eecd0d4162-dirty |
|
modified:
blast.py |
| b |
| diff -r 623a3fbe5340 -r 310ec0f47485 blast.py --- a/blast.py Fri Feb 03 12:34:03 2017 -0500 +++ b/blast.py Thu Feb 09 11:16:00 2017 -0500 |
| [ |
| b'@@ -7,12 +7,17 @@\n import os\n from time import sleep\n \n-from galaxy.datatypes.data import get_file_peek\n-from galaxy.datatypes.data import Data, Text\n+from galaxy.datatypes.data import Data, Text, get_file_peek\n from galaxy.datatypes.xml import GenericXml\n \n log = logging.getLogger(__name__)\n \n+# Note implicit string concatenation here to avoid excessively long lines:\n+_DOCTYPES = [\'<!DOCTYPE BlastOutput PUBLIC "-//NCBI//NCBI BlastOutput/EN" \'\n+ \'"http://www.ncbi.nlm.nih.gov/dtd/NCBI_BlastOutput.dtd">\',\n+ \'<!DOCTYPE BlastOutput PUBLIC "-//NCBI//NCBI BlastOutput/EN" \'\n+ \'"NCBI_BlastOutput.dtd">\']\n+\n \n class BlastXml(GenericXml):\n """NCBI Blast XML Output data"""\n@@ -48,8 +53,7 @@\n handle.close()\n return False\n line = handle.readline()\n- if line.strip() not in [\'<!DOCTYPE BlastOutput PUBLIC "-//NCBI//NCBI BlastOutput/EN" "http://www.ncbi.nlm.nih.gov/dtd/NCBI_BlastOutput.dtd">\',\n- \'<!DOCTYPE BlastOutput PUBLIC "-//NCBI//NCBI BlastOutput/EN" "NCBI_BlastOutput.dtd">\']:\n+ if line.strip() not in _DOCTYPES:\n handle.close()\n return False\n line = handle.readline()\n@@ -96,8 +100,7 @@\n raise ValueError("%s is not an XML file!" % f)\n line = h.readline()\n header += line\n- if line.strip() not in [\'<!DOCTYPE BlastOutput PUBLIC "-//NCBI//NCBI BlastOutput/EN" "http://www.ncbi.nlm.nih.gov/dtd/NCBI_BlastOutput.dtd">\',\n- \'<!DOCTYPE BlastOutput PUBLIC "-//NCBI//NCBI BlastOutput/EN" "NCBI_BlastOutput.dtd">\']:\n+ if line.strip() not in _DOCTYPES:\n out.write(header) # for diagnosis\n out.close()\n h.close()\n@@ -220,21 +223,50 @@\n self.add_composite_file(\'blastdb.nhr\', is_binary=True) # sequence headers\n self.add_composite_file(\'blastdb.nin\', is_binary=True) # index file\n self.add_composite_file(\'blastdb.nsq\', is_binary=True) # nucleotide sequences\n- self.add_composite_file(\'blastdb.nal\', is_binary=False, optional=True) # alias ( -gi_mask option of makeblastdb)\n- self.add_composite_file(\'blastdb.nhd\', is_binary=True, optional=True) # sorted sequence hash values ( -hash_index option of makeblastdb)\n- self.add_composite_file(\'blastdb.nhi\', is_binary=True, optional=True) # index of sequence hash values ( -hash_index option of makeblastdb)\n- self.add_composite_file(\'blastdb.nnd\', is_binary=True, optional=True) # sorted GI values ( -parse_seqids option of makeblastdb and gi present in the description lines)\n- self.add_composite_file(\'blastdb.nni\', is_binary=True, optional=True) # index of GI values ( -parse_seqids option of makeblastdb and gi present in the description lines)\n- self.add_composite_file(\'blastdb.nog\', is_binary=True, optional=True) # OID->GI lookup file ( -hash_index or -parse_seqids option of makeblastdb)\n- self.add_composite_file(\'blastdb.nsd\', is_binary=True, optional=True) # sorted sequence accession values ( -hash_index or -parse_seqids option of makeblastdb)\n- self.add_composite_file(\'blastdb.nsi\', is_binary=True, optional=True) # index of sequence accession values ( -hash_index or -parse_seqids option of makeblastdb)\n-# self.add_composite_file(\'blastdb.00.idx\', is_binary=True, optional=True) # first volume of the MegaBLAST index generated by makembindex\n-# The previous line should be repeated for each index volume, with filename extensions like \'.01.idx\', \'.02.idx\', etc.\n- self.add_composite_file(\'blastdb.shd\', is_binary=True, optional=True) # MegaBLAST index superheader (-old_style_index false option of makembindex)\n-# self.add_composite_file(\'blastdb.naa\', is_binary=True, optional=True) # index of a WriteDB column for e.g. mask data\n-# self.add_composite_file(\'blastdb.nab\', is_binary=True, optional=True) # data of a WriteDB c'..b".ncb', '.ncc'), etc.\n+\n+ # alias ( -gi_mask option of makeblastdb)\n+ self.add_composite_file('blastdb.nal', is_binary=False, optional=True)\n+\n+ # sorted sequence hash values ( -hash_index option of makeblastdb)\n+ self.add_composite_file('blastdb.nhd', is_binary=True, optional=True)\n+\n+ # index of sequence hash values ( -hash_index option of makeblastdb)\n+ self.add_composite_file('blastdb.nhi', is_binary=True, optional=True)\n+\n+ # sorted GI values ( -parse_seqids option of makeblastdb and gi present in the description lines)\n+ self.add_composite_file('blastdb.nnd', is_binary=True, optional=True)\n+\n+ # index of GI values ( -parse_seqids option of makeblastdb and gi present in the description lines)\n+ self.add_composite_file('blastdb.nni', is_binary=True, optional=True)\n+\n+ # OID->GI lookup file ( -hash_index or -parse_seqids option of makeblastdb)\n+ self.add_composite_file('blastdb.nog', is_binary=True, optional=True)\n+\n+ # sorted sequence accession values ( -hash_index or -parse_seqids option of makeblastdb)\n+ self.add_composite_file('blastdb.nsd', is_binary=True, optional=True)\n+\n+ # index of sequence accession values ( -hash_index or -parse_seqids option of makeblastdb)\n+ self.add_composite_file('blastdb.nsi', is_binary=True, optional=True)\n+\n+ # first volume of the MegaBLAST index generated by makembindex\n+ # self.add_composite_file('blastdb.00.idx', is_binary=True, optional=True)\n+ # The previous line should be repeated for each index volume, with filename\n+ # extensions like '.01.idx', '.02.idx', etc.\n+\n+ # MegaBLAST index superheader (-old_style_index false option of makembindex)\n+ # self.add_composite_file('blastdb.shd', is_binary=True, optional=True)\n+\n+ # index of a WriteDB column for e.g. mask data\n+ # self.add_composite_file('blastdb.naa', is_binary=True, optional=True)\n+\n+ # data of a WriteDB column\n+ # self.add_composite_file('blastdb.nab', is_binary=True, optional=True)\n+\n+ # multiple byte order for a WriteDB column\n+ # self.add_composite_file('blastdb.nac', is_binary=True, optional=True)\n+\n+ # The previous 3 lines should be repeated for each WriteDB column, with filename\n+ # extensions like ('.nba', '.nbb', '.nbc'), ('.nca', '.ncb', '.ncc'), etc.\n \n \n class BlastProtDb(_BlastDb, Data):\n@@ -245,7 +277,7 @@\n \n def __init__(self, **kwd):\n Data.__init__(self, **kwd)\n-# Component file comments are as in BlastNucDb except where noted\n+ # Component file comments are as in BlastNucDb except where noted\n self.add_composite_file('blastdb.phr', is_binary=True)\n self.add_composite_file('blastdb.pin', is_binary=True)\n self.add_composite_file('blastdb.psq', is_binary=True) # protein sequences\n@@ -256,10 +288,11 @@\n self.add_composite_file('blastdb.pog', is_binary=True, optional=True)\n self.add_composite_file('blastdb.psd', is_binary=True, optional=True)\n self.add_composite_file('blastdb.psi', is_binary=True, optional=True)\n-# self.add_composite_file('blastdb.paa', is_binary=True, optional=True)\n-# self.add_composite_file('blastdb.pab', is_binary=True, optional=True)\n-# self.add_composite_file('blastdb.pac', is_binary=True, optional=True)\n-# The last 3 lines should be repeated for each WriteDB column, with filename extensions like ('.pba', '.pbb', '.pbc'), ('.pca', '.pcb', '.pcc'), etc.\n+ # self.add_composite_file('blastdb.paa', is_binary=True, optional=True)\n+ # self.add_composite_file('blastdb.pab', is_binary=True, optional=True)\n+ # self.add_composite_file('blastdb.pac', is_binary=True, optional=True)\n+ # The last 3 lines should be repeated for each WriteDB column, with filename\n+ # extensions like ('.pba', '.pbb', '.pbc'), ('.pca', '.pcb', '.pcc'), etc.\n \n \n class BlastDomainDb(_BlastDb, Data):\n" |