From 190177b5c0ae776c5ba1af5685b7068909667858 Mon Sep 17 00:00:00 2001 From: Anthony Bretaudeau Date: Tue, 30 Jun 2020 15:15:47 +0200 Subject: [PATCH 1/2] Add blastdbv5 format (for blast >=2.8.1) --- .../config/sample/datatypes_conf.xml.sample | 3 +++ lib/galaxy/datatypes/blast.py | 15 +++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/lib/galaxy/config/sample/datatypes_conf.xml.sample b/lib/galaxy/config/sample/datatypes_conf.xml.sample index 61fde7845d21..e6da6d8b9680 100644 --- a/lib/galaxy/config/sample/datatypes_conf.xml.sample +++ b/lib/galaxy/config/sample/datatypes_conf.xml.sample @@ -742,6 +742,9 @@ + + + diff --git a/lib/galaxy/datatypes/blast.py b/lib/galaxy/datatypes/blast.py index e1114e3410d6..45e757379013 100644 --- a/lib/galaxy/datatypes/blast.py +++ b/lib/galaxy/datatypes/blast.py @@ -307,3 +307,18 @@ def __init__(self, **kwd): self.add_composite_file('blastdb.psi', is_binary=True, optional=True) self.add_composite_file('blastdb.rps', is_binary=True, optional=True) self.add_composite_file('blastdb.aux', is_binary=True, optional=True) + + +class BlastNucDb5(BlastNucDb): + """Class for nucleotide BLAST database files.""" + file_ext = 'blastdbn5' + + +class BlastProtDb5(BlastProtDb): + """Class for protein BLAST database files.""" + file_ext = 'blastdbp5' + + +class BlastDomainDb5(BlastDomainDb): + """Class for domain BLAST database files.""" + file_ext = 'blastdbd5' From 74aa97f7efffd64e808285bb0c346df930b010ca Mon Sep 17 00:00:00 2001 From: Anthony Bretaudeau Date: Tue, 30 Jun 2020 15:42:30 +0200 Subject: [PATCH 2/2] Don't make them subtypes, would break tools not able to handle latest version --- lib/galaxy/datatypes/blast.py | 63 +++++++++++++++++++++++++++++++++-- 1 file changed, 60 insertions(+), 3 deletions(-) diff --git a/lib/galaxy/datatypes/blast.py b/lib/galaxy/datatypes/blast.py index 45e757379013..9f975ef5afca 100644 --- a/lib/galaxy/datatypes/blast.py +++ b/lib/galaxy/datatypes/blast.py @@ -309,16 +309,73 @@ def __init__(self, **kwd): self.add_composite_file('blastdb.aux', is_binary=True, optional=True) -class BlastNucDb5(BlastNucDb): +class BlastNucDb5(_BlastDb, Data): """Class for nucleotide BLAST database files.""" file_ext = 'blastdbn5' + allow_datatype_change = False + composite_type = 'basic' + def __init__(self, **kwd): + Data.__init__(self, **kwd) + self.add_composite_file('blastdb.nhr', is_binary=True) # sequence headers + self.add_composite_file('blastdb.nin', is_binary=True) # index file + self.add_composite_file('blastdb.nsq', is_binary=True) # nucleotide sequences + self.add_composite_file('blastdb.nal', is_binary=False, optional=True) # alias ( -gi_mask option of makeblastdb) + self.add_composite_file('blastdb.nhd', is_binary=True, optional=True) # sorted sequence hash values ( -hash_index option of makeblastdb) + self.add_composite_file('blastdb.nhi', is_binary=True, optional=True) # index of sequence hash values ( -hash_index option of makeblastdb) + 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) + 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) + self.add_composite_file('blastdb.nog', is_binary=True, optional=True) # OID->GI lookup file ( -hash_index or -parse_seqids option of makeblastdb) + self.add_composite_file('blastdb.nsd', is_binary=True, optional=True) # sorted sequence accession values ( -hash_index or -parse_seqids option of makeblastdb) + self.add_composite_file('blastdb.nsi', is_binary=True, optional=True) # index of sequence accession values ( -hash_index or -parse_seqids option of makeblastdb) +# self.add_composite_file('blastdb.00.idx', is_binary=True, optional=True) # first volume of the MegaBLAST index generated by makembindex +# The previous line should be repeated for each index volume, with filename extensions like '.01.idx', '.02.idx', etc. + self.add_composite_file('blastdb.shd', is_binary=True, optional=True) # MegaBLAST index superheader (-old_style_index false option of makembindex) +# self.add_composite_file('blastdb.naa', is_binary=True, optional=True) # index of a WriteDB column for e.g. mask data +# self.add_composite_file('blastdb.nab', is_binary=True, optional=True) # data of a WriteDB column +# self.add_composite_file('blastdb.nac', is_binary=True, optional=True) # multiple byte order for a WriteDB column +# The previous 3 lines should be repeated for each WriteDB column, with filename extensions like ('.nba', '.nbb', '.nbc'), ('.nca', '.ncb', '.ncc'), etc. -class BlastProtDb5(BlastProtDb): + +class BlastProtDb5(_BlastDb, Data): """Class for protein BLAST database files.""" file_ext = 'blastdbp5' + allow_datatype_change = False + composite_type = 'basic' + + def __init__(self, **kwd): + Data.__init__(self, **kwd) +# Component file comments are as in BlastNucDb except where noted + self.add_composite_file('blastdb.phr', is_binary=True) + self.add_composite_file('blastdb.pin', is_binary=True) + self.add_composite_file('blastdb.psq', is_binary=True) # protein sequences + self.add_composite_file('blastdb.phd', is_binary=True, optional=True) + self.add_composite_file('blastdb.phi', is_binary=True, optional=True) + self.add_composite_file('blastdb.pnd', is_binary=True, optional=True) + self.add_composite_file('blastdb.pni', is_binary=True, optional=True) + self.add_composite_file('blastdb.pog', is_binary=True, optional=True) + self.add_composite_file('blastdb.psd', is_binary=True, optional=True) + self.add_composite_file('blastdb.psi', is_binary=True, optional=True) +# self.add_composite_file('blastdb.paa', is_binary=True, optional=True) +# self.add_composite_file('blastdb.pab', is_binary=True, optional=True) +# self.add_composite_file('blastdb.pac', is_binary=True, optional=True) +# The last 3 lines should be repeated for each WriteDB column, with filename extensions like ('.pba', '.pbb', '.pbc'), ('.pca', '.pcb', '.pcc'), etc. -class BlastDomainDb5(BlastDomainDb): +class BlastDomainDb5(_BlastDb, Data): """Class for domain BLAST database files.""" file_ext = 'blastdbd5' + allow_datatype_change = False + composite_type = 'basic' + + def __init__(self, **kwd): + Data.__init__(self, **kwd) + self.add_composite_file('blastdb.phr', is_binary=True) + self.add_composite_file('blastdb.pin', is_binary=True) + self.add_composite_file('blastdb.psq', is_binary=True) + self.add_composite_file('blastdb.freq', is_binary=True, optional=True) + self.add_composite_file('blastdb.loo', is_binary=True, optional=True) + self.add_composite_file('blastdb.psd', is_binary=True, optional=True) + self.add_composite_file('blastdb.psi', is_binary=True, optional=True) + self.add_composite_file('blastdb.rps', is_binary=True, optional=True) + self.add_composite_file('blastdb.aux', is_binary=True, optional=True)