Previous changeset 41:0f4669378764 (2018-11-14) Next changeset 43:16e4b61b56e5 (2019-05-09) |
Commit message:
planemo upload for repository https://github.com/peterjc/galaxy_blast/tree/master/tools/ncbi_blast_plus commit 960f4708be7cdd486e4569e7b44eb856b2cad79d-dirty |
modified:
tools/ncbi_blast_plus/blastxml_to_tabular.py tools/ncbi_blast_plus/check_no_duplicates.py tools/ncbi_blast_plus/repository_dependencies.xml tools/ncbi_blast_plus/tool_dependencies.xml |
b |
diff -r 0f4669378764 -r 3f4e7df708f2 tools/ncbi_blast_plus/blastxml_to_tabular.py --- a/tools/ncbi_blast_plus/blastxml_to_tabular.py Wed Nov 14 06:23:31 2018 -0500 +++ b/tools/ncbi_blast_plus/blastxml_to_tabular.py Fri Feb 22 09:58:23 2019 -0500 |
[ |
b'@@ -81,12 +81,14 @@\n else:\n from galaxy import eggs # noqa - ignore flake8 F401\n import pkg_resources\n+\n pkg_resources.require("elementtree")\n from elementtree import ElementTree\n \n if len(sys.argv) == 4 and sys.argv[3] in ["std", "x22", "ext"]:\n # False positive if user really has a BLAST XML file called \'std\' or \'ext\'...\n- sys.exit("""ERROR: The script API has changed, sorry.\n+ sys.exit(\n+ """ERROR: The script API has changed, sorry.\n \n Instead of the old style:\n \n@@ -99,7 +101,8 @@\n For more information, use:\n \n $ python blastxml_to_tabular.py -h\n-""")\n+"""\n+ )\n \n usage = """usage: %prog [options] blastxml[,...]\n \n@@ -113,16 +116,29 @@\n extended column names are supported.\n """\n parser = OptionParser(usage=usage)\n-parser.add_option(\'-o\', \'--output\', dest=\'output\', default=None,\n- help=\'output filename (defaults to stdout)\',\n- metavar="FILE")\n-parser.add_option("-c", "--columns", dest="columns", default=\'std\',\n- help="[std|ext|col1,col2,...] standard 12 columns, extended 25 columns, or list of column names")\n+parser.add_option(\n+ "-o",\n+ "--output",\n+ dest="output",\n+ default=None,\n+ help="output filename (defaults to stdout)",\n+ metavar="FILE",\n+)\n+parser.add_option(\n+ "-c",\n+ "--columns",\n+ dest="columns",\n+ default="std",\n+ help="[std|ext|col1,col2,...] standard 12 columns, "\n+ "extended 25 columns, or list of column names",\n+)\n (options, args) = parser.parse_args()\n \n-colnames = (\'qseqid,sseqid,pident,length,mismatch,gapopen,qstart,qend,\'\n- \'sstart,send,evalue,bitscore,sallseqid,score,nident,positive,\'\n- \'gaps,ppos,qframe,sframe,qseq,sseq,qlen,slen,salltitles\').split(\',\')\n+colnames = (\n+ "qseqid,sseqid,pident,length,mismatch,gapopen,qstart,qend,"\n+ "sstart,send,evalue,bitscore,sallseqid,score,nident,positive,"\n+ "gaps,ppos,qframe,sframe,qseq,sseq,qlen,slen,salltitles"\n+).split(",")\n \n if len(args) < 1:\n sys.exit("ERROR: No BLASTXML input files given; run with --help to see options.")\n@@ -148,7 +164,9 @@\n assert set(colnames).issuperset(cols), cols\n if not cols:\n sys.exit("No columns selected!")\n- extended = max(colnames.index(c) for c in cols) >= 12 # Do we need any higher columns?\n+ extended = (\n+ max(colnames.index(c) for c in cols) >= 12\n+ ) # Do we need any higher columns?\n del out_fmt\n \n for in_file in args:\n@@ -213,7 +231,8 @@\n # <Hit_accession>P56514</Hit_accession>\n # or,\n # <Hit_id>Subject_1</Hit_id>\n- # <Hit_def>gi|57163783|ref|NP_001009242.1| rhodopsin [Felis catus]</Hit_def>\n+ # <Hit_def>gi|57163783|ref|NP_001009242.1|\n+ # rhodopsin [Felis catus]</Hit_def>\n # <Hit_accession>Subject_1</Hit_accession>\n #\n # apparently depending on the parse_deflines switch\n@@ -225,11 +244,15 @@\n # <Hit_accession>2</Hit_accession>\n sseqid = hit.findtext("Hit_id").split(None, 1)[0]\n hit_def = sseqid + " " + hit.findtext("Hit_def")\n- if re_default_subject_id.match(sseqid) and sseqid == hit.findtext("Hit_accession"):\n+ if re_default_subject_id.match(sseqid) and sseqid == hit.findtext(\n+ "Hit_accession"\n+ ):\n # Place holder ID, take the first word of the subject definition\n hit_def = hit.findtext("Hit_def")\n sseqid = hit_def.split(None, 1)[0]\n- if sseqid.startswith("gnl|BL_ORD_ID|") and sseqid == "gnl|BL_ORD_ID|" + hit.findtext("Hit_accession"):\n+ if sseqid.startswith(\n+ "gnl|BL_ORD_ID|"\n+ ) and sseqid == "gnl|BL_ORD_ID|" + hit.findtext("Hit_accession"):\n # Alternative place holder ID, again take the first word of hit_def\n hit_def = '..b'dtext("Hsp_hit-from"), # sstart,\n+ hsp.findtext("Hsp_hit-to"), # send,\n+ evalue, # hsp.findtext("Hsp_evalue") in scientific notation\n+ bitscore, # hsp.findtext("Hsp_bit-score") rounded\n+ ]\n \n if extended:\n try:\n- sallseqid = ";".join(name.split(None, 1)[0] for name in hit_def.split(" >"))\n- salltitles = "<>".join(name.split(None, 1)[1] for name in hit_def.split(" >"))\n+ sallseqid = ";".join(\n+ name.split(None, 1)[0] for name in hit_def.split(" >")\n+ )\n+ salltitles = "<>".join(\n+ name.split(None, 1)[1] for name in hit_def.split(" >")\n+ )\n except IndexError as e:\n- sys.exit("Problem splitting multuple hits?\\n%r\\n--> %s" % (hit_def, e))\n+ sys.exit(\n+ "Problem splitting multuple hits?\\n%r\\n--> %s"\n+ % (hit_def, e)\n+ )\n # print(hit_def, "-->", sallseqid)\n positive = hsp.findtext("Hsp_positive")\n ppos = "%0.2f" % (100 * float(positive) / float(length))\n qframe = hsp.findtext("Hsp_query-frame")\n sframe = hsp.findtext("Hsp_hit-frame")\n if blast_program == "blastp":\n- # Probably a bug in BLASTP that they use 0 or 1 depending on format\n+ # Probably a bug in BLASTP that they use 0 or 1\n+ # depending on format\n if qframe == "0":\n qframe = "1"\n if sframe == "0":\n sframe = "1"\n slen = int(hit.findtext("Hit_len"))\n- values.extend([sallseqid,\n- hsp.findtext("Hsp_score"), # score,\n- nident,\n- positive,\n- hsp.findtext("Hsp_gaps"), # gaps,\n- ppos,\n- qframe,\n- sframe,\n- # NOTE - for blastp, XML shows original seq, tabular uses XXX masking\n- q_seq,\n- h_seq,\n- str(qlen),\n- str(slen),\n- salltitles,\n- ])\n+ values.extend(\n+ [\n+ sallseqid,\n+ hsp.findtext("Hsp_score"), # score,\n+ nident,\n+ positive,\n+ hsp.findtext("Hsp_gaps"), # gaps,\n+ ppos,\n+ qframe,\n+ sframe,\n+ # NOTE - for blastp, XML shows original seq,\n+ # tabular uses XXX masking\n+ q_seq,\n+ h_seq,\n+ str(qlen),\n+ str(slen),\n+ salltitles,\n+ ]\n+ )\n if cols:\n # Only a subset of the columns are needed\n values = [values[colnames.index(c)] for c in cols]\n' |
b |
diff -r 0f4669378764 -r 3f4e7df708f2 tools/ncbi_blast_plus/check_no_duplicates.py --- a/tools/ncbi_blast_plus/check_no_duplicates.py Wed Nov 14 06:23:31 2018 -0500 +++ b/tools/ncbi_blast_plus/check_no_duplicates.py Fri Feb 22 09:58:23 2019 -0500 |
[ |
@@ -31,7 +31,7 @@ if not magic: # Empty file, special case continue - elif magic == b'\x1f\x8b': + elif magic == b"\x1f\x8b": # Gzipped handle = gzip.open(filename, "rt") elif magic[0:1] == b">": |
b |
diff -r 0f4669378764 -r 3f4e7df708f2 tools/ncbi_blast_plus/repository_dependencies.xml --- a/tools/ncbi_blast_plus/repository_dependencies.xml Wed Nov 14 06:23:31 2018 -0500 +++ b/tools/ncbi_blast_plus/repository_dependencies.xml Fri Feb 22 09:58:23 2019 -0500 |
b |
@@ -1,4 +1,4 @@ -<?xml version="1.0"?> +<?xml version="1.0" ?> <repositories description="This requires the BLAST datatype definitions (e.g. the BLAST XML format)."> - <repository changeset_revision="3eada762af11" name="blast_datatypes" owner="devteam" toolshed="https://testtoolshed.g2.bx.psu.edu" /> -</repositories> + <repository changeset_revision="1250aab8b97a" name="blast_datatypes" owner="devteam" toolshed="https://testtoolshed.g2.bx.psu.edu"/> +</repositories> \ No newline at end of file |
b |
diff -r 0f4669378764 -r 3f4e7df708f2 tools/ncbi_blast_plus/tool_dependencies.xml --- a/tools/ncbi_blast_plus/tool_dependencies.xml Wed Nov 14 06:23:31 2018 -0500 +++ b/tools/ncbi_blast_plus/tool_dependencies.xml Fri Feb 22 09:58:23 2019 -0500 |
b |
@@ -1,6 +1,6 @@ -<?xml version="1.0"?> +<?xml version="1.0" ?> <tool_dependency> <package name="blast" version="2.5.0"> - <repository changeset_revision="de5976f2c96d" name="package_blast_plus_2_5_0" owner="iuc" toolshed="https://testtoolshed.g2.bx.psu.edu" /> + <repository changeset_revision="de5976f2c96d" name="package_blast_plus_2_5_0" owner="iuc" toolshed="https://testtoolshed.g2.bx.psu.edu"/> </package> -</tool_dependency> +</tool_dependency> \ No newline at end of file |