annotate README.rst @ 0:dad02776f538

first commit
author Jan Kanis <jan.code@jankanis.nl>
date Wed, 22 Jul 2015 16:32:48 +0200
parents
children 6bdcfd49a90c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
1 Blast2html: Blast XML to HTML conversion tool
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
2 =============================================
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
3
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
4 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.
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
5
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
6 Example output:
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
7
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
8 .. image:: images/blast2html_screenshot1.png
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
9 :alt: Screenshot of sample output
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
10 :align: center
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
11
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
12 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.
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
13
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
14 .. _`NCBI Blast website`: http://blast.ncbi.nlm.nih.gov/Blast.cgi
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
15
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
16
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
17 Galaxy configuration
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
18 --------------------
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
19
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
20 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.
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
21
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
22 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``::
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
23
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
24 sanitize_all_html = False
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
25
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
26 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.
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
27
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
28 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::
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
29
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
30 <unique_id> <database_caption> <base_name_path>
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
31
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
32 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::
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
33
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
34 <unique_id> <database_caption> <base_name_path> <genebank_name> <genebank_link_template>
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
35
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
36 NCBI Blast+ will ignore the extra fields in the file.
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
37
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
38 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::
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
39
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
40 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
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
41
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
42 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.
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
43
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
44
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
45 .. _Galaxy: https://www.galaxyproject.org/
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
46
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
47
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
48 Command line usage
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
49 ------------------
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
50
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
51 ::
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
52
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
53 usage: ./blast2html.py [-i] INPUT [-o OUTPUT] [--genelink-template URL_TEMPLATE] [--dbname DBNAME]
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
54
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
55 Convert a BLAST XML result into a nicely readable html page
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
56
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
57 positional arguments:
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
58 INPUT The input Blast XML file, same as -i/--input
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
59
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
60 optional arguments:
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
61 -h, --help show this help message and exit
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
62 -i INPUT, --input INPUT
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
63 The input Blast XML file
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
64 -o OUTPUT, --output OUTPUT
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
65 The output html file
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
66 --template TEMPLATE The template file to use. Defaults to
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
67 blast_html.html.jinja
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
68 --dbname DBNAME The link text to use for external links to a gene bank
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
69 database. Defaults to 'Gene Bank'
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
70 --genelink-template URL_TEMPLATE
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
71 A link template to link hits to a gene bank webpage.
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
72 The template string is a Python format string. It can
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
73 contain the following replacement elements: {id[N]},
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
74 {fullid}, {defline[N]}, {fulldefline}, {accession},
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
75 where N is a number. id[N] and defline[N] will be
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
76 replaced by the Nth element of the id or defline,
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
77 where '|' is the field separator. The default is 'http
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
78 ://www.ncbi.nlm.nih.gov/nucleotide/{accession}?report=
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
79 genbank&log$=nuclalign', which is a link to the NCBI
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
80 nucleotide database.
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
81 --db-config-dir DB_CONFIG_DIR
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
82 The directory where databases are configured in
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
83 blastdb*.loc files. These files are consulted for
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
84 creating a gene bank link. The files should conform to
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
85 the format that Galaxy's BLAST expect, i.e. tab-
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
86 separated tables (with lines starting with '#'
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
87 ignored), with two extra fields, for a total of five
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
88 fields per line instead of three.. The third field of
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
89 each line should be a database path as used by BLAST.
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
90 The fourth field is the human readable database name,
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
91 and the fifth a template link to the gene bank
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
92 conforming to the syntax for the --genelink-template
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
93 option. Entries in these config files override links
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
94 specified using --genelink-template and --dbname.
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
95
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
96
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
97 Authorship
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
98 ----------
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
99
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
100 This tool was created and published by `The Hyve B.V.`_ open source bioinformatics solutions.
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
101
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
102 .. image:: images/thehyve_logo.png
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
103 :alt: The Hyve
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
104 :align: center
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
105 :target: http://thehyve.nl
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
106
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
107 .. _`The Hyve B.V.`: http://thehyve.nl/
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
108
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
109
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
110 Licensing information
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
111 ---------------------
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
112
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
113 Blast2html is free software: you can redistribute it and/or modify
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
114 it under the terms of the GNU General Public License as published by
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
115 the Free Software Foundation, either version 3 of the License, or
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
116 (at your option) any later version.
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
117
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
118 This program is distributed in the hope that it will be useful,
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
119 but WITHOUT ANY WARRANTY; without even the implied warranty of
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
120 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
121 GNU General Public License for more details.
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
122
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
123 You should have received a copy of the GNU General Public License
dad02776f538 first commit
Jan Kanis <jan.code@jankanis.nl>
parents:
diff changeset
124 along with this program. If not, see <http://www.gnu.org/licenses/>.