0
|
1 <tool id="blast2html_test" name="blast2html_test" version="0.0.14">
|
|
2
|
|
3 <description>Convert BLAST XML to HTML</description>
|
|
4
|
|
5 <requirements>
|
|
6 <requirement name="package" version="0.2">blast2html_venv</requirement>
|
|
7 </requirements>
|
|
8
|
|
9 <command interpreter="python">blast2html.py -i "${input}" -o "${output}" --db-config-dir "${GALAXY_DATA_INDEX_DIR}"</command>
|
|
10
|
|
11 <stdio>
|
|
12 <!-- Any exit code other than 0 is an error -->
|
|
13 <exit_code range="1:" />
|
|
14 <exit_code range=":-1" />
|
|
15 </stdio>
|
|
16
|
|
17 <inputs>
|
|
18 <param format="blastxml" name="input" type="data" label="Source file"/>
|
|
19 </inputs>
|
|
20
|
|
21 <outputs>
|
|
22 <data format="html" name="output" />
|
|
23 </outputs>
|
|
24
|
|
25 <help>
|
|
26 Blast2html: Blast XML to HTML conversion tool
|
|
27 =============================================
|
|
28
|
|
29 This tool accepts Blast XML as input, and creates an HTML page with a human readable version of the result. The output includes graphical displays of where a sequence matches a target and metrics on the quality of the match.
|
|
30
|
|
31 Example output:
|
|
32
|
|
33 .. image:: images/blast2html_screenshot1.png
|
|
34 :alt: Screenshot of sample output
|
|
35 :align: center
|
|
36
|
|
37 The output format is based on the graphical summary pages on the `NCBI Blast website`_. But as the code for generating such pages is not available we implemented our own clone.
|
|
38
|
|
39 .. _`NCBI Blast website`: http://blast.ncbi.nlm.nih.gov/Blast.cgi
|
|
40
|
|
41
|
|
42 Galaxy configuration
|
|
43 --------------------
|
|
44
|
|
45 This tool generates an HTML page from Blast XML input. It can be used as a stand-alone command line tool, but it is meant to be used in workflows in Galaxy_. To use this tool in Galaxy some configuration may be required.
|
|
46
|
|
47 By default Galaxy strips a lot of style information from HTML files before showing them on the screen. The results of this tool will still be somewhat useful but they will be a lot uglier without the styles. You can still download the original generated HTML of course. If you want to view the full result within Galaxy you need to disable this stripping of style information by adding the following line to your Galaxy's ``galaxy.ini``::
|
|
48
|
|
49 sanitize_all_html = False
|
|
50
|
|
51 In order to generate links to a gene bank in the result, you will need to tell blast2html what gene bank to use. If you do not configure a gene bank the result will contain links to the NCBI gene bank, and as a name for the gene bank the generic "Gene Bank" is used. These links will only work if the database you are using uses the same accession codes as the NCBI gene bank. To show links to a different gene bank this needs to be configured in Galaxy.
|
|
52
|
|
53 As at the moment this tool was built Galaxy did not have a good way to specify such configuration directives to tools, we use a slightly ugly solution. The gene bank configuration are added to the NCBI BLAST+ database definition files in Galaxy's ``tool-data`` directory. This directory should contain some files named ``blastdb.loc``, ``blastdb_p.loc``, ``blastdb_d.loc`` etc. that define the databases that the NCBI BLAST+ tool knows about. For BLAST, these files contain three columns of tab-separated data that define the databases. The normal format is::
|
|
54
|
|
55 <unique_id> <database_caption> <base_name_path>
|
|
56
|
|
57 with tabs separating the three components. For blast2html we extend this format with two columns that contain a human-readable gene bank name, and a link template. So each row then contains these tab-separated items::
|
|
58
|
|
59 <unique_id> <database_caption> <base_name_path> <genebank_name> <genebank_link_template>
|
|
60
|
|
61 NCBI Blast+ will ignore the extra fields in the file.
|
|
62
|
|
63 So, for example, for a database named ``nt`` with path ``/depot/data2/galaxy/blastdb/nt/nt.chunk`` that uses NCBI nucleontide database accession codes you can use the following definition line::
|
|
64
|
|
65 nt_02_Dec_2009 nt 02 Dec 2009 /depot/data2/galaxy/blastdb/nt/nt.chunk NCBI Gene Bank http://www.ncbi.nlm.nih.gov/nucleotide/{accession}?report=genbank&log$=nuclalign
|
|
66
|
|
67 The syntax for the link template is the same as that used by the ``--genelink-template`` command line option (see next section): It can contain the following replacement elements: ``{id[N]}``, ``{fullid}``, ``{defline[N]}``, ``{fulldefline}``, ``{accession}``, where ``N`` is a number. ``id[N]`` and ``defline[N]`` will be replaced by the Nth element of the id or defline, where '``|``' is the field separator.
|
|
68
|
|
69
|
|
70 .. _Galaxy: https://www.galaxyproject.org/
|
|
71
|
|
72
|
|
73 Command line usage
|
|
74 ------------------
|
|
75
|
|
76 ::
|
|
77
|
|
78 usage: ./blast2html.py [-i] INPUT [-o OUTPUT] [--genelink-template URL_TEMPLATE] [--dbname DBNAME]
|
|
79
|
|
80 Convert a BLAST XML result into a nicely readable html page
|
|
81
|
|
82 positional arguments:
|
|
83 INPUT The input Blast XML file, same as -i/--input
|
|
84
|
|
85 optional arguments:
|
|
86 -h, --help show this help message and exit
|
|
87 -i INPUT, --input INPUT
|
|
88 The input Blast XML file
|
|
89 -o OUTPUT, --output OUTPUT
|
|
90 The output html file
|
|
91 --template TEMPLATE The template file to use. Defaults to
|
|
92 blast_html.html.jinja
|
|
93 --dbname DBNAME The link text to use for external links to a gene bank
|
|
94 database. Defaults to 'Gene Bank'
|
|
95 --genelink-template URL_TEMPLATE
|
|
96 A link template to link hits to a gene bank webpage.
|
|
97 The template string is a Python format string. It can
|
|
98 contain the following replacement elements: {id[N]},
|
|
99 {fullid}, {defline[N]}, {fulldefline}, {accession},
|
|
100 where N is a number. id[N] and defline[N] will be
|
|
101 replaced by the Nth element of the id or defline,
|
|
102 where '|' is the field separator. The default is 'http
|
|
103 ://www.ncbi.nlm.nih.gov/nucleotide/{accession}?report=
|
|
104 genbank&log$=nuclalign', which is a link to the NCBI
|
|
105 nucleotide database.
|
|
106 --db-config-dir DB_CONFIG_DIR
|
|
107 The directory where databases are configured in
|
|
108 blastdb*.loc files. These files are consulted for
|
|
109 creating a gene bank link. The files should conform to
|
|
110 the format that Galaxy's BLAST expect, i.e. tab-
|
|
111 separated tables (with lines starting with '#'
|
|
112 ignored), with two extra fields, for a total of five
|
|
113 fields per line instead of three.. The third field of
|
|
114 each line should be a database path as used by BLAST.
|
|
115 The fourth field is the human readable database name,
|
|
116 and the fifth a template link to the gene bank
|
|
117 conforming to the syntax for the --genelink-template
|
|
118 option. Entries in these config files override links
|
|
119 specified using --genelink-template and --dbname.
|
|
120
|
|
121
|
|
122 Authorship
|
|
123 ----------
|
|
124
|
|
125 This tool was created and published by `The Hyve B.V.`_ open source bioinformatics solutions.
|
|
126
|
|
127 .. image:: images/thehyve_logo.png
|
|
128 :alt: The Hyve
|
|
129 :align: center
|
|
130 :target: http://thehyve.nl
|
|
131
|
|
132 .. _`The Hyve B.V.`: http://thehyve.nl/
|
|
133
|
|
134
|
|
135 Licensing information
|
|
136 ---------------------
|
|
137
|
|
138 Blast2html is free software: you can redistribute it and/or modify
|
|
139 it under the terms of the GNU General Public License as published by
|
|
140 the Free Software Foundation, either version 3 of the License, or
|
|
141 (at your option) any later version.
|
|
142
|
|
143 This program is distributed in the hope that it will be useful,
|
|
144 but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
145 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
146 GNU General Public License for more details.
|
|
147
|
|
148 You should have received a copy of the GNU General Public License
|
|
149 along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
150 </help>
|
|
151
|
|
152 </tool>
|