Sfoglia il codice sorgente

Uses tripal_blast instead of blast_ui as the module name

Reynold Tan 3 anni fa
parent
commit
f9edf7a7b0
50 ha cambiato i file con 157 aggiunte e 3309 eliminazioni
  1. 0 339
      LICENSE.txt
  2. 0 72
      README.md
  3. 0 12
      blast_ui.info.yml
  4. 0 304
      blast_ui.install
  5. 0 18
      blast_ui.libraries.yml
  6. 0 21
      blast_ui.links.task.yml
  7. 0 57
      blast_ui.module
  8. 0 114
      blast_ui.routing.yml
  9. 0 23
      config/install/blast_ui.settings.yml
  10. 0 17
      css/style-blast-forms.css
  11. 0 112
      css/style-blast-report.css
  12. 0 19
      docs/Makefile
  13. BIN
      docs/_static/hexagon_pattern.png
  14. BIN
      docs/_static/small_logoonly.png
  15. 0 181
      docs/_static/theme_overrides.css
  16. 0 187
      docs/conf.py
  17. 0 13
      docs/dev_guide.rst
  18. 0 71
      docs/dev_guide/contribution.rst
  19. 0 90
      docs/dev_guide/custom_linkouts.rst
  20. 0 6
      docs/dev_guide/custom_styling.rst
  21. 0 10
      docs/index.rst
  22. 0 35
      docs/make.bat
  23. 0 20
      docs/user_guide.rst
  24. 0 53
      docs/user_guide/cvitjs.rst
  25. BIN
      docs/user_guide/features.1.blastui.png
  26. BIN
      docs/user_guide/features.2.tabularlisting.png
  27. BIN
      docs/user_guide/features.3.expandedlisting.png
  28. 0 21
      docs/user_guide/features.rst
  29. BIN
      docs/user_guide/install.1.configure_link.png
  30. BIN
      docs/user_guide/install.2.configurepage.png
  31. BIN
      docs/user_guide/install.3.savebutton.png
  32. 0 50
      docs/user_guide/install.rst
  33. BIN
      docs/user_guide/targetdbs.1.nodeform.png
  34. BIN
      docs/user_guide/targetdbs.2.linkouts.png
  35. BIN
      docs/user_guide/targetdbs.3.regextest.png
  36. BIN
      docs/user_guide/targetdbs.4.externaldb.png
  37. 0 83
      docs/user_guide/targetdbs.rst
  38. 0 18
      docs/user_guide/tripal_daemon.rst
  39. 29 0
      src/Controller/TripalBlastUI.php
  40. 0 27
      src/Controller/TripalBlastUIBlastHelp.php
  41. 0 27
      src/Controller/TripalBlastUIBlastSubmit.php
  42. 0 52
      src/Form/TripalBlastUIBlastSubmitForm copy 2.php
  43. 0 52
      src/Form/TripalBlastUIBlastSubmitForm copy.php
  44. 0 52
      src/Form/TripalBlastUIBlastSubmitForm.php
  45. 0 977
      src/Services/BlastUIBlast.php
  46. 0 174
      templates/template-blast-ui-help.html.twig
  47. 2 2
      templates/template-tripal-blast-ui.html.twig
  48. 11 0
      tripal_blast.info.yml
  49. 44 0
      tripal_blast.module
  50. 71 0
      tripal_blast.routing.yml

+ 0 - 339
LICENSE.txt

@@ -1,339 +0,0 @@
-                    GNU GENERAL PUBLIC LICENSE
-                       Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-                            Preamble
-
-  The licenses for most software are designed to take away your
-freedom to share and change it.  By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users.  This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it.  (Some other Free Software Foundation software is covered by
-the GNU Lesser General Public License instead.)  You can apply it to
-your programs, too.
-
-  When we speak of free software, we are referring to freedom, not
-price.  Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
-  To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
-  For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have.  You must make sure that they, too, receive or can get the
-source code.  And you must show them these terms so they know their
-rights.
-
-  We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
-  Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software.  If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
-  Finally, any free program is threatened constantly by software
-patents.  We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary.  To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
-  The precise terms and conditions for copying, distribution and
-modification follow.
-
-                    GNU GENERAL PUBLIC LICENSE
-   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
-  0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License.  The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language.  (Hereinafter, translation is included without limitation in
-the term "modification".)  Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope.  The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
-  1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
-  2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
-    a) You must cause the modified files to carry prominent notices
-    stating that you changed the files and the date of any change.
-
-    b) You must cause any work that you distribute or publish, that in
-    whole or in part contains or is derived from the Program or any
-    part thereof, to be licensed as a whole at no charge to all third
-    parties under the terms of this License.
-
-    c) If the modified program normally reads commands interactively
-    when run, you must cause it, when started running for such
-    interactive use in the most ordinary way, to print or display an
-    announcement including an appropriate copyright notice and a
-    notice that there is no warranty (or else, saying that you provide
-    a warranty) and that users may redistribute the program under
-    these conditions, and telling the user how to view a copy of this
-    License.  (Exception: if the Program itself is interactive but
-    does not normally print such an announcement, your work based on
-    the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole.  If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works.  But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
-  3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
-    a) Accompany it with the complete corresponding machine-readable
-    source code, which must be distributed under the terms of Sections
-    1 and 2 above on a medium customarily used for software interchange; or,
-
-    b) Accompany it with a written offer, valid for at least three
-    years, to give any third party, for a charge no more than your
-    cost of physically performing source distribution, a complete
-    machine-readable copy of the corresponding source code, to be
-    distributed under the terms of Sections 1 and 2 above on a medium
-    customarily used for software interchange; or,
-
-    c) Accompany it with the information you received as to the offer
-    to distribute corresponding source code.  (This alternative is
-    allowed only for noncommercial distribution and only if you
-    received the program in object code or executable form with such
-    an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it.  For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable.  However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
-  4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License.  Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
-  5. You are not required to accept this License, since you have not
-signed it.  However, nothing else grants you permission to modify or
-distribute the Program or its derivative works.  These actions are
-prohibited by law if you do not accept this License.  Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
-  6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions.  You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
-  7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License.  If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all.  For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices.  Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
-  8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded.  In such case, this License incorporates
-the limitation as if written in the body of this License.
-
-  9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time.  Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number.  If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation.  If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
-  10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission.  For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this.  Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
-                            NO WARRANTY
-
-  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
-  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
-                     END OF TERMS AND CONDITIONS
-
-            How to Apply These Terms to Your New Programs
-
-  If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
-  To do so, attach the following notices to the program.  It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-    <one line to give the program's name and a brief idea of what it does.>
-    Copyright (C) <year>  <name of author>
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License along
-    with this program; if not, write to the Free Software Foundation, Inc.,
-    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
-    Gnomovision version 69, Copyright (C) year name of author
-    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
-    This is free software, and you are welcome to redistribute it
-    under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License.  Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary.  Here is a sample; alter the names:
-
-  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
-  `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
-  <signature of Ty Coon>, 1 April 1989
-  Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs.  If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library.  If this is what you want to do, use the GNU Lesser General
-Public License instead of this License.

+ 0 - 72
README.md

@@ -1,72 +0,0 @@
-![Tripal Dependency](https://img.shields.io/badge/tripal-%3E=3.0-brightgreen)
-[![Tripal Rating Gold Status](https://tripal.readthedocs.io/en/7.x-3.x/_images/Tripal-Gold.png)](https://tripal.readthedocs.io/en/7.x-3.x/extensions/module_rating.html#Gold)
-![GitHub release (latest by date)](https://img.shields.io/github/v/release/tripal/tripal_blast)
-
-[![Build Status](https://travis-ci.org/tripal/tripal_blast.svg?branch=7.x-1.x)](https://travis-ci.org/tripal/tripal_blast)
-[![Maintainability](https://api.codeclimate.com/v1/badges/5071f91a02a3fcafc275/maintainability)](https://codeclimate.com/github/tripal/tripal_blast/maintainability)
-[![Test Coverage](https://api.codeclimate.com/v1/badges/5071f91a02a3fcafc275/test_coverage)](https://codeclimate.com/github/tripal/tripal_blast/test_coverage)
-
-INTRODUCTION
-------------
-This module provides a basic interface to allow your users to utilize your
-server's NCBI BLAST+.
-
-Specifically it provides blast program-specific forms (blastn, blastp, tblastn, 
-blastx are supported). In the future, there will be a single form where you 
-will be able to select either a nucleotide or a protein database to BLAST
-against regardless of the type of query and it will decide which BLAST
-program to use based on the combination of query/database type (ie: if you
-selected a protein database on the nucleotide BLAST form then blastx would
-be used).
-
-BLAST submissions result in the creation of Tripal jobs which then need to run
-from the command-line. This ensures that long running BLASTs will not cause
-page time-outs but does add some management overhead and might result in longer
-waits for users depending on how often you have cron set to run Tripal jobs.
-You can alternatively use the [Tripal Jobs Daemon](https://github.com/tripal/tripal/tree/7.x-3.x/tripal_daemon) 
-to automate running of Tripal Jobs reducing user wait time and your own workload.
-
-The BLAST results page is an expandable summary table with each hit being
-listed as a row in the table with query/hit/e-value information. The row can
-then be expanded to include additional information including the alignment.
-Download formats are allow users to download these results in the familiar 
-tabular, GFF3 or HTML NCBI formats.
-
-Installation
-------------
-1. Install NCBI BLAST+ on your server (Tested with 2.2.26+). There is a
-   package available for Ubuntu to ease installation.
-2. Install this module as you would any Drupal module (ie: download, unpack
-   in sites/all/modules and enable through http://[your site]/admin/modules)
-3. Create "Blast Database" nodes for each dataset you want to make available
-   for your users to BLAST against. BLAST databases should first be created
-   using the command-line makeblastdb program with the -parse_seqids flag.
-   
- It's recommended that you also install the [Tripal Job Daemon](https://github.com/tripal/tripal/tree/7.x-3.x/tripal_daemon) 
- to manage BLAST jobs and ensure they are run soon after being submitted 
- by the user. Without this additional module, administrators will have to 
- execute the tripal jobs either manually or through use of cron jobs.
-
-Documentation   [![Documentation Status](https://readthedocs.org/projects/tripal-blast-ui/badge/?version=latest)](https://tripal-blast-ui.readthedocs.io/en/latest/?badge=latest)
---------------
-
-We have and extensive [user guide](https://tripal-blast-ui.readthedocs.io/en/latest/user_guide.html) and a [developer guide](https://tripal-blast-ui.readthedocs.io/en/latest/dev_guide.html)  available via [readthedocs](https://tripal-blast-ui.readthedocs.io/en/latest/index.html). 
-
-Comparison with other Modules
-------------------------------
-<table>
-<tr><th></th><th><a href="project/tripal_blast">Tripal BLAST UI</a></th><th><a href="project/tripal_blast_analysis">Tripal BLAST Analysis</a></th></tr>
-<tr><th>Provides an interface to execute BLASTs</th><td>Yes</td><td>No</td></tr>
-<tr><th>Display BLAST Results to users</th><td>After BLAST submission</td><td>On associated feature pages</td></tr>
-<tr><th>Load BLAST Results into Chado</th><td>No</td><td>Yes</td></tr>
-</table>
-
-**NOTE: These modules will be combined into a single download available 
-here in the not so distant future. You will still have the flexibility 
-to enable either one or the other or both.**
-
-Future Development
--------------------
- - The ability to blast against 2+ datasets at the same time
- - Ability to Email user when BLAST is done
- - Automatic cleaning up of BLAST job files after 1 week (make time frame configurable)

+ 0 - 12
blast_ui.info.yml

@@ -1,12 +0,0 @@
-name: BLAST UI
-description: Provides a user interface to allow your users to utilize NCBI's BLAST+ on your server
-package: Tripal Extension
-
-type: module
-core: 8.x
-configure: tripal_ui.configure
-project: tripal_blast
-
-dependencies:
-  - libraries:libraries
-

+ 0 - 304
blast_ui.install

@@ -1,304 +0,0 @@
-<?php
-/**
- * @file
- * .install file of BLAST UI.
- *
- * Contains hooks to handle installation of this module.
- *
- * Specifically, a database table (blastdb) is created to store additional information
- * related to blast database nodes such as the name/path to the NCBI BLAST database files
- * and the type (protein or nucleotide) of the database.
- */
-
-
-use Drupal\node\Entity\Node;
-
-/**
- * Implements hook_install().
- * 
- * @see tripal.info
- */
-function blast_ui_install() {
-  // Retreives the Drupal relative directory for a Tripal module.
-  tripal_create_files_dir('tripal_blast');
-}
-
-/**
- * Implements hook_uninstall().
- */
-function blast_ui_uninstall() {
-  // Remove all nodes of type blastdb 
-  $query = \Drupal::entityQuery('node')
-    // Restrict to BLASTDB nodes.
-    ->condition('bundle', 'blastdb')
-    // Restrict to Published nodes.
-    ->condition('status', 1)
-    // Restrict to nodes the current user has permission to view.
-    ->addTag('node_access');
-  
-  $entities = $query->execute();
-
-  // Get all BlastDB nodes and delete them
-  $nodes = Node::loadMultiple(array_keys($entities['node']));
-  foreach ($nodes as $node) {
-    print "Delete node " . $node->title . "\n";
-    $nrs = node_revision_list($node);
-    
-    foreach ($nrs as $nr) {
-      node_revision_delete($nr->vid);
-    }
-    node_delete($node->nid);
-  }
-}
-
-/**
- * Implements hook_schema().
- * Create the blastdb database table for storing addditional info related to blastdb nodes.
- *
- * NOTE: This hook is called via Drupal magic during the installation process and no longer
- * needs to be called explicitly in hook_install().
- */
-function blast_ui_schema() {
-  // A table to keep extra information related to blastdb nodes.
-  $schema['blastdb'] = array(
-    'description' => t('The base table for blastdb node'),
-    'fields' => array(
-      'nid' => array(
-        'description' => t('The primary identifier for a node.'),
-        'type' => 'serial',
-        'unsigned' => true,
-        'not null' => true,
-      ),
-      'name' => array(
-        'description' => t('The human-readable name of the blast database.'),
-        'type' => 'varchar',
-        'length' => 255,
-        'not null' => true,
-      ),
-      'path' => array(
-        'description' => t('The full path and filename prefix of the blast database.'),
-        'type' => 'varchar',
-        'length' => 1023,
-        'not null' => true,
-      ),
-      'dbtype' => array(
-        'description' => t('Type of the blast database. Should be either n for nucleotide or p for protein.'),
-        'type' => 'varchar',
-        'length' => 15,
-        'not null' => true,
-      ),
-      'dbxref_id_regex' => array(
-        'description' => t('The Regular Expression to use to extract the id from the FASTA header of the BLAST database hit.'),
-        'type' => 'text',
-      ),
-      'dbxref_db_id' => array(
-        'description' => t('The Database records from this BLAST Database reference.'),
-        'type' => 'int',
-      ),
-      'dbxref_linkout_type' => array(
-        'description' => t('Type of linkout to be used for this database reference.'),
-        'type' => 'varchar',
-        'length' => 50,
-        'not null' => true,
-        'default' => 'link'
-      ),
-      'cvitjs_enabled' => array(
-        'description' => t('Indicate if CViTjs should be used to display hits on a whole genome'),
-        'type' => 'int',
-        'not null' => false,
-        'default' => 0
-      ),
-    ),
-    
-    'indexes' => array(
-      'name' => array('name'),
-    ),
-    
-    'primary key' => array('nid'),
-    'unique keys' => array(
-       'nid' => array('nid'),
-    ),
-  );
-  
-  // BLAST JOBS
-  // ------------------------
-  // Keeps track of additional information related to tripal blast jobs.
-  $schema['blastjob'] = array(
-    'description' => t('Keeps track of additional information related to tripal blast jobs.'),
-    'fields' => array(
-      'job_id' => array(
-        'description' => t('The Tripal job_id for the blast job.'),
-        'type' => 'int',
-        'unsigned' => true,
-        'not null' => true,
-      ),
-      'blast_program' => array(
-        'description' => t('The program to use to run the blast (ie: blastn, blastp, etc.).'),
-        'type' => 'varchar',
-        'length' => 20,
-        'not null' => true,
-      ),
-      'target_blastdb' => array(
-        'description' => t('The nid of the blastdb used to search against; NULL if target was uploaded.'),
-        'type' => 'int',
-        'unsigned' => true,
-      ),
-      'target_file' => array(
-        'description' => t('The absolute path to the uploaded blast database after it was run through makeblastdb; NULL if target was NOT uploaded.'),
-        'type' => 'text',
-      ),
-      'query_file' => array(
-        'description' => t('The absolute path to the query file.'),
-        'type' => 'text',
-      ),
-      'result_filestub' => array(
-        'description' => t('The absolute path and filename (without extension) of the blast results.'),
-        'type' => 'text',
-      ),
-      'options' => array(
-        'description' => t('A serialized array of options selected for the blast job where the key is the machine name of the option used when calling blast (ie: gapextend) and the value is the value of the option.'),
-        'type' => 'text',
-      ),
-    ),
-    'primary key' => array('job_id'),
-    'foreign keys' => array(
-      'job_id' => array(
-        'table' => 'tripal_jobs',
-        'columns' => array(
-          'job_id' => 'job_id',
-        ),
-      ),
-    ),
-  );
-  
-  return $schema;
-}
-
-
-// UPDATES:
-
-
-/**
- * Make BlastDB type more readable & support Link-outs for BLAST Hits.
- */
-function blast_ui_update_7101() {
-  // Changing the length of the type field to allow it to be more readable.
-  db_change_field('blastdb', 'dbtype', 'dbtype',
-    array(
-        'description' => t('Type of the blast database. Should be either n for nucleotide or p for protein.'),
-        'type' => 'varchar',
-        'length' => 15,
-        'not null' => true,
-    )
-  );
-
-  // Add fields related to Link-outs
-  db_add_field(
-    'blastdb',
-    'dbxref_id_regex',
-    array(
-      'description' => t('The Regular Expression to use to extract the id from the FASTA header of the BLAST database hit.'),
-      'type' => 'text',
-    )
-  );
-  db_add_field(
-    'blastdb',
-    'dbxref_db_id',
-    array(
-      'description' => t('The Database records from this BLAST Database reference.'),
-      'type' => 'int',
-    )
-  );
-}
-
-/**
- * Support complex types of link-outs such as GBrowse & JBrowse coordinate links.
- */
-function blast_ui_update_7102() {
-  db_add_field(
-    'blastdb',
-    'dbxref_linkout_type',
-    array(
-      'description' => t('Type of linkout to be used for this database reference.'),
-      'type' => 'varchar',
-      'length' => 50,
-      'not null' => true,
-      'default' => 'link'
-    )
-  );
-}
-
-/**
- * Add saving of blast job information for recent job list & resubmit functionality.
- */
-function blast_ui_update_7103() {
-  $schema = array();
-
-  // Keeps track of additional information related to tripal blast jobs.
-  $schema['blastjob'] = array(
-    'description' => t('Keeps track of additional information related to tripal blast jobs.'),
-    'fields' => array(
-      'job_id' => array(
-        'description' => t('The Tripal job_id for the blast job.'),
-        'type' => 'int',
-        'unsigned' => true,
-        'not null' => true,
-      ),
-      'blast_program' => array(
-        'description' => t('The program to use to run the blast (ie: blastn, blastp, etc.).'),
-        'type' => 'varchar',
-        'length' => 20,
-        'not null' => true,
-      ),
-      'target_blastdb' => array(
-        'description' => t('The nid of the blastdb used to search against; NULL if target was uploaded.'),
-        'type' => 'int',
-        'unsigned' => true,
-      ),
-      'target_file' => array(
-        'description' => t('The absolute path to the uploaded blast database after it was run through makeblastdb; NULL if target was NOT uploaded.'),
-        'type' => 'text',
-      ),
-      'query_file' => array(
-        'description' => t('The absolute path to the query file.'),
-        'type' => 'text',
-      ),
-      'result_filestub' => array(
-        'description' => t('The absolute path and filename (without extension) of the blast results.'),
-        'type' => 'text',
-      ),
-      'options' => array(
-        'description' => t('A serialized array of options selected for the blast job where the key is the machine name of the option used when calling blast (ie: gapextend) and the value is the value of the option.'),
-        'type' => 'text',
-      ),
-    ),
-    'primary key' => array('job_id'),
-    'foreign keys' => array(
-      'job_id' => array(
-        'table' => 'tripal_jobs',
-        'columns' => array(
-          'job_id' => 'job_id',
-        ),
-      ),
-    ),
-  );
-  
-  // First create the tables.
-  db_create_table('blastjob', $schema['blastjob']);
-}
-
-/**
- * Add fields to blastp table for CViTjs support.
- */
-function blast_ui_update_7104() {
-  db_add_field(
-    'blastdb',
-    'cvitjs_enabled',
-    array(
-      'description' => t('Indicate if CViTjs should be used to display hits on a whole genome'),
-      'type' => 'int',
-      'not null' => false,
-      'default' => 0
-    )
-  );
-}

+ 0 - 18
blast_ui.libraries.yml

@@ -1,18 +0,0 @@
-
-
-# Styles:
-
-
-# Style BLAST reports.
-style-blastreport:
-  version: v1.x
-  css:
-    theme:
-      css/style-blast-report.css: {}
-
-# Style BLAST input form.
-style-blastform:
-  version: v1.x
-  css:
-    theme:
-      css/style-blast-form.css: {}

+ 0 - 21
blast_ui.links.task.yml

@@ -1,21 +0,0 @@
-# Tabs/task items below point to routes defined in
-# @see blast_ui.routing.yml.
-# Order is as they appear in the configuration page (weight).
-
-# General Configuration Tab.
-# Routes to configuration page of this module.
-# /extension/tripal_blast.
-tripal_ui.tab1:
-  title: 'Tripal BLAST: User Interface'
-  route_name: blast_ui.config
-  base_route: blast_ui.config
-  weight: 0
-
-# Tripal BLAST Help Tab.
-# Routes to help page of this module.
-# /extension/tripal_blast/help
-tripal_ui.tab2:
-  title: 'Tripal BLAST: Help'
-  route_name: blast_ui.help
-  base_route: blast_ui.config
-  weight: 1

+ 0 - 57
blast_ui.module

@@ -1,57 +0,0 @@
-<?php
-/**
- * @file
- * .module file of BLAST UI.
- */
-
-use Drupal\Core\Url;
-
-/**
- * Implements hook_theme().
- * Used by BLAST UI submission forms.
- *
- * @see templates in /templates
- */
-function blast_ui_theme($existing, $type, $theme, $path) {  
-  $context_links = [
-    // blast/nucleotide.
-    'link_Nucleotide' => \Drupal::l(t('Nucleotide'), Url::fromRoute('blast_ui.nucleotide')),
-    // blast/protein.
-    'link_Protein'    => \Drupal::l(t('Protein'), Url::fromRoute('blast_ui.protein')),
-    
-    // NUCLEOTIDE PROGRAM.
-    // blast/nucleotide/nucleotide
-    'link_blastn'     => \Drupal::l(t('blastn'), Url::fromRoute('blast_ui.nucleotide_nucleotide')),
-    // blast/nucleotide/protein
-    'link_blastx'     => \Drupal::l(t('blastx'), Url::fromRoute('blast_ui.nucleotide_protein')),
-    
-    // PROTEIN PROGRAM.
-    // blast/protein/nucleotide.
-    'link_tblastn'    => \Drupal::l(t('tblastn'), Url::fromRoute('blast_ui.protein_nucleotide')),
-    // blast/protein/protein.
-    'link_blastp'     => \Drupal::l(t('blastp'), Url::fromRoute('blast_ui.protein_protein')),
-    
-    // MISC/ADMIN. 
-    'link_config'     => \Drupal::l(t('configuration'), Url::fromUri('admin/tripal/extension/tripal_blast/blast_ui')),
-    'link_jobs'       => \Drupal::l(t('tripal jobs'), Url::fromUri('blast_ui.protein_nucleotide')), 
-    'link_nodeadd'    => \Drupal::l(t('create BLAST database'), Url::fromUri('node/add/blastdb')),
-    'link_dbadd'      => \Drupal::l(t('configuration'), Url::fromUri('admin/tripal/chado/tripal_db/add')),
-    'link_dbfields'   => \Drupal::l(t('drupal field API'), Url::fromUri('admin/structure/types/manage/blastdb/fields'))
-  ];
-
-  $variables = [
-    // BLAST UI Menupage.
-    'theme-blast-ui-menupage' => [
-      'variables' => ['context_links' => $context_links],
-      'template'  => 'template-blast-ui-menupage',
-    ],
-    
-    // BLAST Help page.
-    'theme-blast-ui-help' => [
-      'variables' => ['context_links' => $context_links],
-      'template'  => 'template-blast-ui-help',
-    ],
-  ];
-
-  return $variables;
-}

+ 0 - 114
blast_ui.routing.yml

@@ -1,114 +0,0 @@
-# This route is for single all-in-one BLAST submission form.
-blast_ui.blast:
-  path: 'blast'
-  defaults:
-    _title: 'Tripal BLAST'
-    _controller: '\Drupal\blast_ui\Controller\TripalBlastUIBlastSubmit::content'
-  requirements:
-    _permission: 'administer tripal'
-
-
-# Routes below are for query-based type BLAST submission forms.
-
-
-# NUCLEOTIDE
-blast_ui.nucleotide:
-  path: 'blast/nucleotide'
-  defaults:
-    _title: 'Tripal BLAST: Nucleotide Query'
-#    _form: '\Drupal\blast_ui\Form\TripalBlastUIBlastNucleotideSubmitForm'
-  requirements:
-    _permission: 'administer tripal'
-
-# PROTEIN
-blast_ui.protein:
-  path: 'blast/protein'
-  defaults:
-    _title: 'Tripal BLAST: Protein Query'
-#    _form: '\Drupal\blast_ui\Form\TripalBlastUIBlastProteinSubmitForm'
-  requirements:
-    _permission: 'administer tripal'
-
-
-# Routes below are for BLAST-program-based submission form.
-
-
-# NUCLEOTIDE PROGRAM
-blast_ui.nucleotide_nucleotide:
-  path: 'blast/nucleotide/nucleotide'
-  defaults:
-    _title: 'Tripal BLAST: BLASTn'
-#    _form: '\Drupal\blast_ui\Form\TripalBlastUIBlastNucleotideProgramNucleotideSubmitForm'
-  requirements:
-    _permission: 'administer tripal'
-
-blast_ui.nucleotide_protein:
-  path: 'blast/nucleotide/protein'
-  defaults:
-    _title: 'Tripal BLAST: BLASTx'
-#    _form: '\Drupal\blast_ui\Form\TripalBlastUIBlastNucleotideProgramProteinSubmitForm'
-  requirements:
-    _permission: 'administer tripal'
-
-# PROTEIN PROGRAM
-blast_ui.protein_nucleotide:
-  path: 'blast/protein/nucleotide'
-  defaults:
-    _title: 'Tripal BLAST: tBLASTn'
-#    _form: '\Drupal\blast_ui\Form\TripalBlastUIBlastProteinProgramNucleotideSubmitForm'
-  requirements:
-    _permission: 'administer tripal'
-
-blast_ui.protein_protein:
-  path: 'blast/protein/protein'
-  defaults:
-    _title: 'Tripal BLAST: BLASTp'
-#    _form: '\Drupal\blast_ui\Form\TripalBlastUIBlastProteinProgramProtienSubmitForm'
-  requirements:
-    _permission: 'administer tripal'
-
-
-# This route handles the BLAST result page.
-
-
-blast_ui.report:
-  path: 'blast/report'
-  defaults:
-    _title: 'Tripal BLAST: Results'
-#    _controller: '\Drupal\blast_ui\Controller\TripalBlastUIBlastReport::content'
-  requirements:
-    _permission: 'administer tripal'
-
-# This route is for Database Node (BLAST DB Node).
-blast_ui.blastdb:
-  path: 'admin/tripal/extension/tripal_blast/node__blastdb'
-  defaults:
-    _title: 'Tripal BLAST DB Node'
-#    _controller: '\Drupal\blast_ui\Controller\TripalBlastUIBlastDB::content'
-  requirements:
-    _permission: 'administer tripal'
-
-
-# Route items below are rendered as linked task (tabs).
-# Order is as they appear in configuration page.
-# @see blast_ui.links.task.yml
-
-
-# This route is used to to configure this module.
-# It is defined in the configuration key of this module's info file.
-blast_ui.config:
-  path: 'admin/tripal/extension/tripal_blast/blast_ui'
-  defaults:
-    _title: 'Tripal BLAST User Interface'
-#    _form: '\Drupal\blast_ui\Form\TripalBlastUIConfigurationForm'
-  requirements:
-    _permission: 'administer tripal'
-
-# This route (configuration) is the help page for using this module.
-blast_ui.help:
-  path: 'admin/tripal/extension/tripal_blast/help'
-  defaults:
-    _title: 'Tripal BLAST Help'
-    _controller: '\Drupal\blast_ui\Controller\TripalBlastUIBlastHelp::content'
-  requirements:
-    _permission: 'administer tripal'

+ 0 - 23
config/install/blast_ui.settings.yml

@@ -1,23 +0,0 @@
-# BLAST path.
-blast_path:
-# BLAST threads.
-blast_threads:
-# Value.
-eVal:
-# Range.
-qRange:
-
-# Allow query upload.
-blast_ui_allow_query_upload:
-# Allow target upload.
-blast_ui_allow_target_upload:
-# Nucleotide example sequence.
-blast_ui_nucleotide_example_sequence:
-# Protien example sequence.
-blast_ui_protein_example_sequence:
-# Max result displayed.
-blast_ui_max_results_displayed:
-# Embed CvitJS.
-blast_ui_cvitjs_enabled:
-# Warning text.
-blast_ui_warning_text:

+ 0 - 17
css/style-blast-forms.css

@@ -1,17 +0,0 @@
-/**
- * @file
- * Handles CSS Themeing of the BLAST input forms.
- */
-
-
-div.center {
-  margin-left: auto;
-  margin-right: auto;
-  width: 70%;
-}
-
-.blastdb-extra-info {
-  padding: 10px;
-  border: 1px solid #be7;
-  background-color: #f8fff0;
-}

+ 0 - 112
css/style-blast-report.css

@@ -1,112 +0,0 @@
-/**
- * @file
- * Handles CSS Themeing of the BLAST Results
- */
-
-
-/* -- Ensure users see lack of results. */
-p.blast-no-results {
-  color: red;
-  font-weight: bold;
-  font-style: italic;
-}
-
-/* -- Theme the table of results */
-table#blast_report th {
-  text-align: left;
-}
-
-table#blast_report tr td {
-  vertical-align : top;
-}
-
-table#blast_report tr.odd td {
-  cursor:pointer;
-  vertical-align : top;
-}
-
-table#blast_report .arrow {
-  background:transparent url('../images/arrows.png') no-repeat scroll 0px -16px;
-  width:16px;
-  height:16px;
-  display:block;
-}
-
-table#blast_report div.up {
-  background-position:0px 0px;
-}
-
-table#blast_report td.number, #blast_report th.number {
-  width: 10px;
-  border-left: none;
-}
-
-table#blast_report td.evalue, #blast_report th.evalue {
-  width: 100px;
-}
-
-table#blast_report td.arrow-col, #blast_report th.arrow-col {
-  width: 10px;
-  border-right: none;
-}
-
-
-/* -- Alignment */
-table#blast_report tr.alignment-row .title{
-  font-weight: bold;
-}
-
-table#blast_report tr.alignment-row .hsp-title{
-  padding-top: 15px;
-  font-weight: bold;
-}
-
-table#blast_report tr.alignment-row{
-  width: 100%;
-}
-
-table#blast_report .alignment {
-  width: 625px;
-}
-
-table#blast_report .alignment-title {
-  font-weight: bold;
-}
-
-table#blast_report div.alignment-row{
-  padding: 10px 30px;
-  font-family: monospace;
-  white-space: nowrap;
-}
-
-table#blast_report div.alignment-subrow{
-  padding-bottom: 15px;
-}
-
-
-/* CViTjs support */
-.blast-top:after {
-   clear: both;
-   display: table;
-   content: "";
-}
-
-.blast-job-info {
-  float: left;
-  margin-bottom: 25px;
-}
-
-.cvitjs {
-  float: left;
-  margin-top: 10px;
-  margin-bottom: 25px;
-}
-
-.cvitjs #cvit-div{
-  padding: 5px 0 0 0;
-}
-
-.report-table {
-  clear: both;
-  position: static;
-}

+ 0 - 19
docs/Makefile

@@ -1,19 +0,0 @@
-# Minimal makefile for Sphinx documentation
-#
-
-# You can set these variables from the command line.
-SPHINXOPTS    =
-SPHINXBUILD   = sphinx-build
-SOURCEDIR     = .
-BUILDDIR      = _build
-
-# Put it first so that "make" without argument is like "make help".
-help:
-	@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
-
-.PHONY: help Makefile
-
-# Catch-all target: route all unknown targets to Sphinx using the new
-# "make mode" option.  $(O) is meant as a shortcut for $(SPHINXOPTS).
-%: Makefile
-	@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

BIN
docs/_static/hexagon_pattern.png


BIN
docs/_static/small_logoonly.png


+ 0 - 181
docs/_static/theme_overrides.css

@@ -1,181 +0,0 @@
-/* override table width restrictions
-See: https://rackerlabs.github.io/docs-rackspace/tools/rtd-tables.html
- */
-@media screen and (min-width: 767px) {
-
-   .wy-table-responsive table td {
-      white-space: normal !important;
-   }
-
-   .wy-table-responsive {
-      overflow: visible !important;
-   }
-}
-
-/**
- * Buttons on Extension Module pages.
- */
-#administrative .section p:last-child a,
-  #analysis-annotation .section p:last-child a,
-  #data-loading-collection .section p:last-child a,
-  #developer-tools .section p:last-child a,
-  #third-party-integration .section p:last-child a,
-  #searching .section p:last-child a,
-  #visualization-display .section p:last-child a {
-   font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
-   display: inline-block;
-   vertical-align: middle;
-   text-align: center;
-   border-radius: 4px;
-   margin-bottom: 20px;
-   margin-right: 8px;
-   -webkit-font-smoothing: antialiased;
-   letter-spacing: 0.03em;
-   font-weight: 500;
-   line-height: 14px;
-   font-size: 14px;
-   padding: 9px 10px;
-   color: #666666;
-   background: #FFFFFF;
-   background: -webkit-linear-gradient(top, #FFFFFF, #f1f1f1);
-   border: 1px solid #c8c8c8;
-   box-shadow: 0 1px 0px #e9e9e9;
- }
- #administrative .section p:last-child a:hover,
-   #analysis-annotation .section p:last-child a:hover,
-   #data-loading-collection .section p:last-child a:hover,
-   #developer-tools .section p:last-child a:hover,
-   #third-party-integration .section p:last-child a:hover,
-   #searching .section p:last-child a:hover,
-   #visualization-display .section p:last-child a:hover  {
-  background: -webkit-linear-gradient(top, #FFFFFF, #e6e6e6);
-}
-
-/**
- * BRANDING
- */
-
-/* Sidebar Title */
-.wy-side-nav-search {
-  background: none !important;
-}
-.wy-side-nav-search input[type="text"] {
-  border-color: black;
-}
-.wy-nav-side {
-  color: #CCCCCC !important;
-  background: #2D2D34 !important;
-  background-image: url("hexagon_pattern.png") !important;
-  background-repeat: repeat !important;
-  background: -webkit-linear-gradient(left, $light-grey , $gray-base) !important;
-  background: linear-gradient(to right, $light-grey , $gray-base) !important;
-}
-/* Logo */
-.fa-home::before, .icon-home::before {
-  content: url('small_logoonly.png')
-}
-/* Sidebar TOC */
-.wy-menu-vertical li.current {
-  color: #CCCCCC;
-  border-color: black;
-  background: rgba(0,0,0,0.5);
-}
-.wy-menu-vertical li.toctree-l1.current > a {
-  color: black;
-  border-color: whitesmoke;
-  background-color: whitesmoke;
-}
-.wy-menu-vertical li.toctree-l2.current > a,
-  .wy-menu-vertical li.toctree-l2.current li.toctree-l3 > a,
-  .wy-menu-vertical li.toctree-l3.current li.toctree-l4 > a {
-    color: #CCCCCC;
-    border-color: black;
-    background-color: rgba(0,0,0,0.05);
-}
-.wy-menu-vertical li.current a:hover,
-  .wy-menu-vertical li.toctree-l1.current > a:hover,
-  .wy-menu-vertical li.toctree-l2.current > a:hover,
-  .wy-menu-vertical li.toctree-l2.current li.toctree-l3 > a:hover,
-  .wy-menu-vertical li.toctree-l3.current li.toctree-l4 > a:hover {
-    color: white;
-    border-color: black;
-    font-weight: bold;
-    background-color: rgba(0,0,0);
-}
-.wy-menu-vertical li.toctree-l1 a,
-  .wy-menu-vertical li.toctree-l2 a,
-  .wy-menu-vertical li.toctree-l3 a,
-  .wy-menu-vertical li.toctree-l4 a {
-    color: #CCCCCC;
-    border-color: black;
-}
-/* Main Content */
-.wy-nav-content-wrap {
-  background: whitesmoke;
-}
-a, a:hover {
-  color: #990000;
-}
-a:visited {
-  color: #cc0000;
-}
-a.icon-home:visited {
-  color: #ffffff;
-}
-/* Code blocks */
-.highlight {
-  background: #e1f0db;
-}
-/* Default Notes */
-.wy-alert.wy-alert-info,
-  .rst-content .note,
-  .rst-content .wy-alert-info.attention,
-  .rst-content .wy-alert-info.caution,
-  .rst-content .wy-alert-info.danger,
-  .rst-content .wy-alert-info.error,
-  .rst-content .wy-alert-info.hint,
-  .rst-content .wy-alert-info.important,
-  .rst-content .wy-alert-info.tip,
-  .rst-content .wy-alert-info.warning,
-  .rst-content .seealso, .rst-content
-  .wy-alert-info.admonition-todo,
-  .rst-content .wy-alert-info.admonition {
-    background: #d9d9d9;
-}
-.wy-alert.wy-alert-info
-  .wy-alert-title,
-  .rst-content .note .wy-alert-title,
-  .rst-content .wy-alert-info.attention .wy-alert-title,
-  .rst-content .wy-alert-info.caution .wy-alert-title,
-  .rst-content .wy-alert-info.danger .wy-alert-title,
-  .rst-content .wy-alert-info.error .wy-alert-title,
-  .rst-content .wy-alert-info.hint .wy-alert-title,
-  .rst-content .wy-alert-info.important .wy-alert-title,
-  .rst-content .wy-alert-info.tip .wy-alert-title,
-  .rst-content .wy-alert-info.warning .wy-alert-title,
-  .rst-content .seealso .wy-alert-title,
-  .rst-content .wy-alert-info.admonition-todo .wy-alert-title,
-  .rst-content .wy-alert-info.admonition .wy-alert-title,
-  .wy-alert.wy-alert-info .rst-content .admonition-title,
-  .rst-content .wy-alert.wy-alert-info .admonition-title,
-  .rst-content .note .admonition-title,
-  .rst-content .wy-alert-info.attention .admonition-title,
-  .rst-content .wy-alert-info.caution .admonition-title,
-  .rst-content .wy-alert-info.danger .admonition-title,
-  .rst-content .wy-alert-info.error .admonition-title,
-  .rst-content .wy-alert-info.hint .admonition-title,
-  .rst-content .wy-alert-info.important .admonition-title,
-  .rst-content .wy-alert-info.tip .admonition-title,
-  .rst-content .wy-alert-info.warning .admonition-title,
-  .rst-content .seealso .admonition-title, .rst-content
-  .wy-alert-info.admonition-todo .admonition-title,
-  .rst-content .wy-alert-info.admonition .admonition-title {
-    background: #737373;
-}
-/* Note Warnings */
-.wy-alert.wy-alert-warning .wy-alert-title, .rst-content .wy-alert-warning.note .wy-alert-title, .rst-content .attention .wy-alert-title, .rst-content .caution .wy-alert-title, .rst-content .wy-alert-warning.danger .wy-alert-title, .rst-content .wy-alert-warning.error .wy-alert-title, .rst-content .wy-alert-warning.hint .wy-alert-title, .rst-content .wy-alert-warning.important .wy-alert-title, .rst-content .wy-alert-warning.tip .wy-alert-title, .rst-content .warning .wy-alert-title, .rst-content .wy-alert-warning.seealso .wy-alert-title, .rst-content .admonition-todo .wy-alert-title, .rst-content .wy-alert-warning.admonition .wy-alert-title, .wy-alert.wy-alert-warning .rst-content .admonition-title, .rst-content .wy-alert.wy-alert-warning .admonition-title, .rst-content .wy-alert-warning.note .admonition-title, .rst-content .attention .admonition-title, .rst-content .caution .admonition-title, .rst-content .wy-alert-warning.danger .admonition-title, .rst-content .wy-alert-warning.error .admonition-title, .rst-content .wy-alert-warning.hint .admonition-title, .rst-content .wy-alert-warning.important .admonition-title, .rst-content .wy-alert-warning.tip .admonition-title, .rst-content .warning .admonition-title, .rst-content .wy-alert-warning.seealso .admonition-title, .rst-content .admonition-todo .admonition-title, .rst-content .wy-alert-warning.admonition .admonition-title {
-  background: #e6b800;
-}
-.wy-alert.wy-alert-warning, .rst-content .wy-alert-warning.note, .rst-content .attention, .rst-content .caution, .rst-content .wy-alert-warning.danger, .rst-content .wy-alert-warning.error, .rst-content .wy-alert-warning.hint, .rst-content .wy-alert-warning.important, .rst-content .wy-alert-warning.tip, .rst-content .warning, .rst-content .wy-alert-warning.seealso, .rst-content .admonition-todo, .rst-content .wy-alert-warning.admonition {
-  background: #FcFde6;
-}

+ 0 - 187
docs/conf.py

@@ -1,187 +0,0 @@
-# -*- coding: utf-8 -*-
-#
-# Configuration file for the Sphinx documentation builder.
-#
-# This file does only contain a selection of the most common options. For a
-# full list see the documentation:
-# http://www.sphinx-doc.org/en/master/config
-
-# -- PHP highlighting ---------------------------------------------------------
-#see: https://www.sitepoint.com/using-sphinx-for-php-project-documentation/
-
-from sphinx.highlighting import lexers
-from pygments.lexers.web import PhpLexer
-lexers["php"] = PhpLexer(startinline=True, linenos=1)
-lexers["php-annotations"] = PhpLexer(startinline=True, linenos=1)
-
-# -- Path setup --------------------------------------------------------------
-
-# If extensions (or modules to document with autodoc) are in another directory,
-# add these directories to sys.path here. If the directory is relative to the
-# documentation root, use os.path.abspath to make it absolute, like shown here.
-#
-# import os
-# import sys
-# sys.path.insert(0, os.path.abspath('.'))
-
-
-# -- Project information -----------------------------------------------------
-
-project = u'Tripal BLAST'
-copyright = u'2018, University of Saskatchewan with the Legume Federation'
-author = u'University of Saskatchewan with the Legume Federation'
-
-# The short X.Y version
-version = u''
-# The full version, including alpha/beta/rc tags
-release = u''
-
-
-# -- General configuration ---------------------------------------------------
-
-# If your documentation needs a minimal Sphinx version, state it here.
-#
-# needs_sphinx = '1.0'
-
-# Add any Sphinx extension module names here, as strings. They can be
-# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
-# ones.
-extensions = [
-]
-
-# Add any paths that contain templates here, relative to this directory.
-templates_path = ['_templates']
-
-# The suffix(es) of source filenames.
-# You can specify multiple suffix as a list of string:
-#
-# source_suffix = ['.rst', '.md']
-source_suffix = '.rst'
-
-# The master toctree document.
-master_doc = 'index'
-
-# The language for content autogenerated by Sphinx. Refer to documentation
-# for a list of supported languages.
-#
-# This is also used if you do content translation via gettext catalogs.
-# Usually you set "language" from the command line for these cases.
-language = None
-
-# List of patterns, relative to source directory, that match files and
-# directories to ignore when looking for source files.
-# This pattern also affects html_static_path and html_extra_path.
-exclude_patterns = [u'_build', 'Thumbs.db', '.DS_Store']
-
-# The name of the Pygments (syntax highlighting) style to use.
-pygments_style = None
-
-
-# -- Options for HTML output -------------------------------------------------
-
-# The theme to use for HTML and HTML Help pages.  See the documentation for
-# a list of builtin themes.
-#
-html_theme = 'sphinx_rtd_theme'
-
-# Theme options are theme-specific and customize the look and feel of a theme
-# further.  For a list of options available for each theme, see the
-# documentation.
-#
-# html_theme_options = {}
-
-# Add any paths that contain custom static files (such as style sheets) here,
-# relative to this directory. They are copied after the builtin static files,
-# so a file named "default.css" will overwrite the builtin "default.css".
-html_static_path = ['_static']
-
-# Override the base theme.
-# We add the stylesheet this way so that it's loaded after the default.css
-# See https://docs.readthedocs.io/en/latest/guides/adding-custom-css.html
-def setup(app):
-    app.add_stylesheet('theme_overrides.css');
-
-# Custom sidebar templates, must be a dictionary that maps document names
-# to template names.
-#
-# The default sidebars (for documents that don't match any pattern) are
-# defined by theme itself.  Builtin themes are using these templates by
-# default: ``['localtoc.html', 'relations.html', 'sourcelink.html',
-# 'searchbox.html']``.
-#
-# html_sidebars = {}
-
-
-# -- Options for HTMLHelp output ---------------------------------------------
-
-# Output file base name for HTML help builder.
-htmlhelp_basename = 'TripalBLASTdoc'
-
-
-# -- Options for LaTeX output ------------------------------------------------
-
-latex_elements = {
-    # The paper size ('letterpaper' or 'a4paper').
-    #
-    # 'papersize': 'letterpaper',
-
-    # The font size ('10pt', '11pt' or '12pt').
-    #
-    # 'pointsize': '10pt',
-
-    # Additional stuff for the LaTeX preamble.
-    #
-    # 'preamble': '',
-
-    # Latex figure (float) alignment
-    #
-    # 'figure_align': 'htbp',
-}
-
-# Grouping the document tree into LaTeX files. List of tuples
-# (source start file, target name, title,
-#  author, documentclass [howto, manual, or own class]).
-latex_documents = [
-    (master_doc, 'TripalBLAST.tex', u'Tripal BLAST Documentation',
-     u'University of Saskatchewan with the Legume Federation', 'manual'),
-]
-
-
-# -- Options for manual page output ------------------------------------------
-
-# One entry per manual page. List of tuples
-# (source start file, name, description, authors, manual section).
-man_pages = [
-    (master_doc, 'tripalblast', u'Tripal BLAST Documentation',
-     [author], 1)
-]
-
-
-# -- Options for Texinfo output ----------------------------------------------
-
-# Grouping the document tree into Texinfo files. List of tuples
-# (source start file, target name, title, author,
-#  dir menu entry, description, category)
-texinfo_documents = [
-    (master_doc, 'TripalBLAST', u'Tripal BLAST Documentation',
-     author, 'TripalBLAST', 'One line description of project.',
-     'Miscellaneous'),
-]
-
-
-# -- Options for Epub output -------------------------------------------------
-
-# Bibliographic Dublin Core info.
-epub_title = project
-
-# The unique identifier of the text. This can be a ISBN number
-# or the project homepage.
-#
-# epub_identifier = ''
-
-# A unique identification for the text.
-#
-# epub_uid = ''
-
-# A list of files that should not be packed into the epub file.
-epub_exclude_files = ['search.html']

+ 0 - 13
docs/dev_guide.rst

@@ -1,13 +0,0 @@
-
-Developer Guide
-================
-
-A guide for module developers on how to customize and/or extend Tripal BLAST UI.
-
-.. toctree::
-   :maxdepth: 2
-   :caption: Contents:
-
-   dev_guide/custom_linkouts
-   dev_guide/custom_styling
-   dev_guide/contribution

+ 0 - 71
docs/dev_guide/contribution.rst

@@ -1,71 +0,0 @@
-Contribution Guidelines
-========================
-
-The following guidelines are meant to encourage contribution to Tripal BLAST UI source-code on GitHub by making the process open, transparent and collaborative.
-
-Github Communication Tips
----------------------------
-- Don't be afraid to mention people (@username) who are knowledgeable on the topic or invested.  *We are academics and overcommitted, it's too easy for issues to go unanswered: don't give up on us!*
-- Likewise, don't be shy about bumping an issue if no one responds after a few days. *Balancing responsibilities is hard.*
-- Want to get more involved? Issues marked with "Good beginner issue" are a good place to start if you want to try your hand at submitting a PR.
-- Everyone is encouraged/welcome to comment on the issue queue! Tell us if you
-
-    - are experiencing the same problem
-    - have tried a suggested fix
-    - know of a potential solution or work-around
-    - have an opinion, idea or feedback of any kind!
-
-- Be kind when interacting with others on Github! (see Code of Conduct below for further guidelines). We want to foster a welcoming, inclusive community!
-
-    - Constructive criticism is welcome and encouraged but should be worded such that it is helpful :-) Direct criticism towards the idea or solution rather than the person and focus on alternatives or improvements.
-
-Bugs
------
-- Every bug **should** be reported as a Github issue.
-
-    - Even if a bug is found by a committer who intends to fix it themselves immediately, they **should** create an issue and assign it to themselves to show their intent.
-
-- Please follow the issue templates as best you can.  This information makes discussion easier and helps us resolve the problem faster.
-
-    - Also provide as much information as possible :-)  Screenshots or links to the issue on a development site can go a long way!
-
-Feature Requests
-------------------
-- Every feature request should start as an issue so that discussion is encouraged :-)
-- Please provide the following information (bold is required; underlined strengthens your argument):
-
-    - **Use Case:** fully describe why you need/want this feature
-    - Generally Applicable: Why do you feel this is generally applicable? Suggest other use cases if possible. Mention (@) others that might want/need this feature.
-    - Implementation: Describe a possible implementation. Bonus points for configuration, use of ontologies, ease of use, permission control, security considerations
-
-- All features **should** be optional so that site admin can choose to make it available to their users.
-
-    - When applicable, new features should be designed such that site admin can disable them.
-    - Bonus points: for making new features configurable and easily themed.
-
-Pull Request (PR) Guideline
-----------------------------
-The goal of this document is to make it easy for **A)** contributors to make pull requests that will be accepted, and **B)** Tripal committers to determine if a pull request should be accepted.
-- PRs that address a specific issue **must** link to the related issue page.
-
-    - Really in almost every case, there should be an issue for a PR.  This allows feedback and discussion before the coding happens.  Not grounds to reject, but encourage users to create issues at start of their PR.  Better late than never :).
-
-- Each PR **must** be tested/approved by at least one "trusted committer."
-
-    - Testers **should** describe how the testing was performed if applicable (allows others to replicate the test).
-    - Our guiding philosophy is to encourage open contribution.  With this in mind, committers should **work with contributors** to resolve issues in their PRs.  PRs that will not be merged should be closed, **transparently citing** the reason for closure.  In an ideal world, features that would be closed are discouraged at the **issue phase** before the code is written!
-    - The pull request branch should be deleted after merging (if not from a forked repository) by the person who performs the merge.
-
-- PRs **should** pass all Travis-CI tests before they are merged.
-- Branches **should** follow the following format: [issue\_number]-[short\_description]
-- **Must** follow `Drupal code standards: <https://www.drupal.org/docs/develop/standardshttps://www.drupal.org/docs/develop/standards>`_
-- PRs for new feature should remain open until adequately discussed (see guidelines below).
-
-.. note::
-
-  If you need more instructions creating a pull request, see for example the `KnowPulse workflow <https://github.com/UofS-Pulse-Binfo/KnowPulse/blob/master/Workflow.md)>`_
-
-Code of Conduct
-----------------
-
-- Be nice!  If that's insufficient, Tripal community defers to https://www.contributor-covenant.org/

+ 0 - 90
docs/dev_guide/custom_linkouts.rst

@@ -1,90 +0,0 @@
-Custom Link-outs
-=================
-
-In Tripal BLAST "Linkouts" refer to changing the hit name in the BLAST results table to a link. This link usually gives the user additional information and may link to pages in your Tripal site, external websites or genome browsers. You can configure link-outs per BLAST Database and depending on the type, many link-outs support regular expression for extracting parts of the name. The types provided by Tripal BLAST also require you select a Tripal Database (Tripal > Chado Modules > Databases) which contains the URL information for the link. If the link-out types supplied by Tripal BLAST do not fit your needs you can create a custom type using the documentation below.
-
-To create custom link-outs for Tripal BLAST you need to first create your own Drupal module. If you are unfamiliar with this process there are a number of good tutorial available in addition to the Drupal Documentation.
-
-Once you have a custom module you need to implement hook_blast_linkout_info() to tell Tripal BLAST about your custom link-out. You do this by creating a function with the name of your module replacing the word "hook". For example:
-
-.. code-block:: php
-
-  /**
-   * Implements hook_blast_linkout_info().
-   * Provides a custom link-out type for my institutes genome browser.
-   */
-  function mymodule_blast_linkout_info() {
-    $types = array();
-
-    $types['mybrowser'] = array(
-      // Human-readable Type name to display to users in the BLAST Database
-      // create/edit form.
-      'name' => 'UofS Browser',
-      // The function used to generate the URL to be linked to.
-      // This function will have full access to the blast hit and database
-      // prefix information and is expected to return a URL.
-      'process function' => 'mymodule_generate_linkout_mybrowser',
-      // Help text to show in the BLAST Database create/edit form so that
-      // users will know how to use this link-out type. Specifically, info
-      // about your assumptions for the URL prefix are very helpful.
-      // HTML is aloud but do not enclose in <p>.
-      'help' => 'This type assumes your blast database is the reference for one
-        of the University of Saskatchewan Genome Browsers and that you have selected
-        the Tripal Database referencing that browser below.',
-      // Whether or not the link-out requires additional fields from the nodes.
-      'require_regex' => TRUE,
-      'require_db' => TRUE,
-    );
-
-    return $types;
-  }
-
-Next you need to implement the process function that you indicated. This function is given a number of variables providing information about the hit, etc. and is expected to generate a fully rendered link based on that information. For example,
-
-.. code-block:: php
-
-  /**
-   * Generate a link to the UofS Genome Browser for a given hit.
-   *
-   * @param $url_prefix
-   *   The URL prefix for the BLAST Database queried.
-   * @param $hit
-   *   The blast XML hit object. This object has the following keys based on the
-   *   XML: Hit_num, Hit_id, Hit_def, Hit_accession, Hit_len and Hit_hsps.
-   *   Furthermore, a linkout_id key has beek added that contains the part of the
-   *   Hit_def extracted using a regex provided when the blastdb node was created.
-   * @param $info
-   *   Additional information that may be useful in creating a link-out. Includes:
-   *    - query_name: the name of the query sequence.
-   *    - score: the score of the blast hit.
-   *    - e-value: the e-value of the blast hit.
-   * @param $options
-   *   Any additional options needed to determine the type of link-out. None are
-   *   supported by this particular link-out type.
-   *
-   * @return
-   *   An html link.
-   */
-  function tripal_blast_generate_linkout_link($url_prefix, $hit, $info, $options = array()) {
-
-    if (isset($hit->{'linkout_id'})) {
-
-      // This is where you would generate your link. If your link requires query parameters
-      // then we suggest you use l() $options['query'] to encode them rather than appending
-      // them to the URL prefix directly.
-      // This StackExchange question shows a good example:
-      //   http://drupal.stackexchange.com/questions/38663/how-to-add-additional-url-parameters
-      $hit_url = $url_prefix . $hit->{'linkout_id'};
-
-      // See the documentation for l():
-      //  https://api.drupal.org/api/drupal/includes%21common.inc/function/l/7
-      return l(
-        $hit->{'linkout_id'},
-        $hit_url,
-        array('attributes' => array('target' => '_blank'))
-      );
-    }
-    else {
-      return FALSE;
-    }
-  }

+ 0 - 6
docs/dev_guide/custom_styling.rst

@@ -1,6 +0,0 @@
-Custom Styling
-===============
-
-The BLAST module forms can be styled using CSS stylesheets in your own theme. By default it will use the default form themeing provided by your particular Drupal site allowing it to feel consistent with the look-and-feel of your Tripal site without customization being needed.
-
-Additionally, the results page, waiting pages and the alignment section of the results page have their own template files (``blast_report.tpl.php``, ``blast_report_pending.tpl.php``, and ``blast_report_alignment_row.tpl.php``, respectively) which can easily be overridden in your own theme providing complete control over the look of the BLAST results.

+ 0 - 10
docs/index.rst

@@ -1,10 +0,0 @@
-
-Tripal BLAST Documentation!
-===========================
-
-.. toctree::
-   :maxdepth: 2
-   :caption: Contents:
-
-   user_guide
-   dev_guide

+ 0 - 35
docs/make.bat

@@ -1,35 +0,0 @@
-@ECHO OFF
-
-pushd %~dp0
-
-REM Command file for Sphinx documentation
-
-if "%SPHINXBUILD%" == "" (
-	set SPHINXBUILD=sphinx-build
-)
-set SOURCEDIR=.
-set BUILDDIR=_build
-
-if "%1" == "" goto help
-
-%SPHINXBUILD% >NUL 2>NUL
-if errorlevel 9009 (
-	echo.
-	echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
-	echo.installed, then set the SPHINXBUILD environment variable to point
-	echo.to the full path of the 'sphinx-build' executable. Alternatively you
-	echo.may add the Sphinx directory to PATH.
-	echo.
-	echo.If you don't have Sphinx installed, grab it from
-	echo.http://sphinx-doc.org/
-	exit /b 1
-)
-
-%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
-goto end
-
-:help
-%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
-
-:end
-popd

+ 0 - 20
docs/user_guide.rst

@@ -1,20 +0,0 @@
-User's Guide
-=============
-
-This module provides a basic interface to allow your users to utilize your server's NCBI BLAST+.
-
-Specifically it provides blast program-specific forms (blastn, blastp, tblastn, blastx are supported). In the future, there will be a single form where you will be able to select either a nucleotide or a protein database to BLAST against regardless of the type of query and it will decide which BLAST program to use based on the combination of query/database type (ie: if you selected a protein database on the nucleotide BLAST form then blastx would be used).
-
-BLAST submissions result in the creation of Tripal jobs which then need to run from the command-line. This ensures that long running BLASTs will not cause page time-outs but does add some management overhead and might result in longer waits for users depending on how often you have cron set to run Tripal jobs. You can alternatively use the Tripal Jobs Daemon to automate running of Tripal Jobs reducing user wait time and your own workload.
-
-The BLAST results page is an expandable summary table with each hit being listed as a row in the table with query/hit/e-value information. The row can then be expanded to include additional information including the alignment. Download formats are allow users to download these results in the familiar tabular, GFF3 or HTML NCBI formats.
-
-.. toctree::
-   :maxdepth: 2
-   :caption: Contents:
-
-   user_guide/features
-   user_guide/install
-   user_guide/tripal_daemon
-   user_guide/targetdbs
-   user_guide/cvitjs

+ 0 - 53
docs/user_guide/cvitjs.rst

@@ -1,53 +0,0 @@
-
-Whole Genome BLAST Hit Visualization (CViTjs)
-=============================================
-
-1. `Download CViTjs <https://github.com/LegumeFederation/cvitjs>`_ and copy the code to your webserver. It needs to be placed in ``[your drupal root]/sites/all/libraries``. To download, execute the git command inside the ``libraries/`` directory:
-
-.. code:: bash
-
-  git clone https://github.com/LegumeFederation/cvitjs.git
-
-2. CViTjs will have a config file in its root directory named ``cvit.conf``. This file provides information for whole genome visualization for each genome BLAST target. Make sure the config file can be edited by your web server.
-3. Enable CViTjs from the BLAST module administration page.
-4. Edit the configuration file to define each genome target. These will look like:
-
-.. code:: yaml
-
-  [data.Cajanus cajan - genome]
-  conf = data/cajca/cajca.conf
-  defaultData = data/cajca/cajca.gff
-
-Where:
-
- - the section name, "data.Cajanus cajan - genome", consists of "data." followed by the name of the BLAST target node,
- - the file "cajca.conf" is a cvit configuration file which describes how to draw the chromosomes and BLAST hits on the Cajanus cajan genome,
- - and the file "cajca.gff" is a GFF3 file that describes the Cajanus cajan chromosomes.
-
-At the top of the configuration file there must be a [general] section that defines the default data set. For example:
-
-.. code:: yaml
-
-    [general]
-    data_default = data.Cajanus cajan - genome
-
-5. Edit the nodes for each genome target (nodes of type "BLAST Database") and enable whole genome visualization. Remember that the names listed in the CViTjs config file must match the BLAST node name. In the example above, the BLAST database node for the Cajanus cajan genome assembly is named "Cajanus cajan - genome"
-
-Notes
-------
-
-- The .conf file for each genome can be modified to suit your needs and tastes. See the sample configuration file, data/test1/test1.conf, and the `CViTjs documentation <https://github.com/LegumeFederation/cvitjs#using-cvitjs>`_.
-- Each blast target CViTjs configuration file must define how to visualize blast hits or you will not see them.
-
-.. code:: yaml
-
-  [blast]
-  feature = BLASTRESULT:match_part
-  glyph   = position
-  shape = rect
-  color   = #FF00FF
-  width = 5
-
-
-- You will have to put the target-specific conf and gff files (e.g. ``cajca.conf`` and ``cjca.gff``) on your web server, in the directory, ``sites/all/libraries/cvitjs/data``. You may choose to group files for each genome into subdirectories, for example, ``sites/all/libraries/cvitjs/data/cajca``.
-- It is important to make sure that ``cvit.conf`` points to the correct data directory and the correct ``.gff`` and ``.conf`` files for the genome in question. For more information about how to create the ``.gff`` file, see the `documentation <https://github.com/LegumeFederation/cvitjs#how-to>`_.

BIN
docs/user_guide/features.1.blastui.png


BIN
docs/user_guide/features.2.tabularlisting.png


BIN
docs/user_guide/features.3.expandedlisting.png


+ 0 - 21
docs/user_guide/features.rst

@@ -1,21 +0,0 @@
-
-Highlighted Functionality
-==========================
-
-- Supports blastn, blastp, tblastn, and blastx with separate forms depending upon the query type.
-- Simple interface allowing users to paste or upload a query sequence and then select from available databases. Additionally, a FASTA file can be uploaded for use as a database to BLAST against.
-
-.. image:: features.1.blastui.png
-
-- Tabular Results listing with alignment information and multiple download formats (HTML, TSV, GFF3, XML) available.
-
-.. image:: features.2.tabularlisting.png
-
-- Completely integrated with Tripal Jobs providing administrators with a way to track BLAST jobs and ensuring long running BLASTs will not cause page time-outs
-- BLAST databases are made available to the module by creating Drupal Pages describing them. This allows administrators to use the Drupal Field API to add any information they want to these pages and to control which databases are available to a given user based on native Drupal permissions.
-- BLAST database records can be linked to an external source with more information (ie: NCBI) per BLAST database.
-- Per Query result diagrams visualizing the HSPs to help users better evaluate hit quality.
-
-.. image:: features.3.expandedlisting.png
-
-- Optional Whole Genome diagrams visualizing the distribution of hits which are configurable per Blast Database.

BIN
docs/user_guide/install.1.configure_link.png


BIN
docs/user_guide/install.2.configurepage.png


BIN
docs/user_guide/install.3.savebutton.png


+ 0 - 50
docs/user_guide/install.rst

@@ -1,50 +0,0 @@
-
-Installation
-=============
-
-QuickStart
------------
-1. Install NCBI BLAST+ on your server (Tested with 2.2.26+). There is a package available for Ubuntu to ease installation.
-2. Install this module as you would any Drupal module (ie: download, unpack in ``sites/all/modules`` and enable through ``http://[your site]/admin/modules``)
-3. Create "Blast Database" nodes for each dataset you want to make available for your users to BLAST against. BLAST databases should first be created using the command-line ``makeblastdb`` program with the ``-parse_seqids`` flag.
-4. It's recommended that you also install the Tripal Job Daemon to manage BLAST jobs and ensure they are run soon after being submitted by the user. Without this additional module, administrators will have to execute the tripal jobs either manually or through use of cron jobs.
-
-Install NCBI BLAST+
---------------------
-
-See `NCBI's Standalone BLAST Setup for Unix <https://www.ncbi.nlm.nih.gov/books/NBK52640/>`_ for extended instructions.
-
-Install Tripal BLAST
----------------------
-
-This module is available as a project on Drupal.org. As such, the preferred method of installation is using Drush:
-
-.. code:: bash
-
-  cd /var/www/html
-  drush pm-download tripal_blast libraries
-
-The above command downloads the module into the expected directory (e.g. ``/var/www/html/sites/all/modules/tripal_blast``). Next we need to install the module:
-
-.. code:: bash
-
-  drush pm-enable blast_ui
-
-Now that the module is installed, we just need to configure it!
-
-Configure Tripal BLAST
------------------------
-
-Navigate to Administration Toolbar > Modules and scroll down to BLAST UI (under "Tripal Extensions"). Then click on the configure link as shown below:
-
-.. image:: install.1.configure_link.png
-
-This will take you to the Tripal BLAST configuration form. The only required settings is the "path of the BLAST program". This should be set to the absolute path to the blastn executable and should include the final slash but not the program itself (e.g. ``/usr/bin/``).
-
-.. image:: install.2.configurepage.png
-
-The remaining configuration options allow you to customize Tripal BLAST UI to your own specific needs. For example, you can use the options under "Allow file upload" to allow users to allow FASTA files for either the query and/or the target database. Additionally, you can set the example sequences, protect against large jobs by limiting the number of results and/or add a warning to the top of the blast form.
-
-Don't forget to click the "Save Configuration" button at the bottom of the page to ensure your changes are saved!
-
-.. image:: install.3.savebutton.png

BIN
docs/user_guide/targetdbs.1.nodeform.png


BIN
docs/user_guide/targetdbs.2.linkouts.png


BIN
docs/user_guide/targetdbs.3.regextest.png


BIN
docs/user_guide/targetdbs.4.externaldb.png


+ 0 - 83
docs/user_guide/targetdbs.rst

@@ -1,83 +0,0 @@
-Blast Target Databases
-=======================
-
-"Target Database" is the BLAST terminology for a database you want your users to be able to BLAST against. For example, on the NCBI Blast website they have a nucleotide and protein target database.
-
-Creating Blast Indicies
-------------------------
-
-This section provides instructions for how to prepare a FASTA file for use with BLAST. We use the MCBI+ Blast command `formatdb` which should have been installed along-side the other blast command-line tools. The following command can be used to create a nucleotide database from the fasta file ``my_nucleotide.fasta`` where resulting files have the name ``Genus_species_version_genome``.
-
-.. code:: bash
-
-  formatdb -p F -o T -i my_nucleotide.fasta -t Genus_species_version_genome -n Genus_species_version_genome
-
-.. note::
-
-  The following indicates what each paramter does:
-
-  .. code::
-
-    formatdb --help
-
-    formatdb 2.2.26   arguments:
-    -t  Title for database file [String]  Optional
-    -i  Input file(s) for formatting [File In]  Optional
-    -n  Base name for BLAST files [String]  Optional
-    -p  Type of file [T/F]  Optional
-       T - protein
-       F - nucleotide
-    -o  Parse options
-        T - True: Parse SeqId and create indexes.
-        F - False: Do not parse SeqId. Do not create indexes.
-
-Add Blast Database
--------------------
-
-To add one to the "BLAST Databases" drop-down on the Blast program forms, in the "Navigation" menu go to "Add Content" > "Blast Database". Then fill out the form with the human readable name of your blast database (shown to the user in the drop-down) and the path to the blast database (passed to NCBI Blast).
-
-.. image:: targetdbs.1.nodeform.png
-
-For example, the above form will add "Tripalus Databasica Genome v1.0" to the "BLAST Databases" drop-down on the Nucleotide BLAST (blastn) form.
-
-Linkouts
---------
-
-These settings will be used to transform the hit name into a link to additional information.
-
-.. image:: targetdbs.2.linkouts.png
-
-Linkout Type
-^^^^^^^^^^^^^
-
-The linkout type determines how the URL will be formed. When configuring the linkouts for a given blast database, you first choose the type (i.e. Generic, GBrowse, JBrowse) based on the descriptions above. This is very dependent upon the FASTA headers used to create the BLAST database.
-
- - **Generic Link**: Creates a generic link using a Tripal External Database and the backbone names from the blast database.
- - **GBrowse Link**: Creates a link to highlight blast results on an existing GBrowse. This requires the blast database consist of backbone sequences of the same name and version as the GBrowse instance.
- - **JBrowse Link**: Creates a link to highlight blast results on an existing JBrowse. This requires the blast database consist of backbone sequences of the same name and version as the JBrowse instance.
-
-.. warning::
-
-  You cannot use the **GBrowse and JBrowse linkout types** unless your target BLAST database consists of the same records with the same names as the backbone of your GBrowse/JBrowse instance. For example, if your JBrowse instance consists of Lens culinaris genome v1.0 with LcChr1, LcChr2, etc. then your BLAST database must consist of the exact same genome version with the original FASTA record containing `>LcChr1`.
-
-.. note ::
-
-  **Generic linkouts** are great for linking BLAST results to either your own Tripal pages or external pages such as NCBI Genbank.
-
-FASTA Header Format
-^^^^^^^^^^^^^^^^^^^^
-
-This section is for indicating the format of the original FASTA record used to create the blast database. For example, if you downloaded a FASTA file from NCBI Genbank and then used `formatdb` to make it your target BLAST database, then you want to choose "NCBI Genbank" as the **FASTA Header Format**.
-
-If you have a FASTA header that doesn't match any of those below, then you can choose **Custom Format** and enter your own `PHP-compliant regular expression <http://php.net/manual/en/reference.pcre.pattern.syntax.php>`_`. The regular expression should include the opening and closing forward slashes (i.e. ``/``) and curved brackets around the section you would like to be used for the linkout (e.g. ``/^>.*(LcChr\d+).*$/``) if you would like to capture LcChr1, LcChr2, etc. It is always a good idea to test your regular expression using `online tools <https://www.phpliveregex.com/>`_.
-
-.. image:: targetdbs.3.regextest.png
-
-External Database
-^^^^^^^^^^^^^^^^^^
-
-This section uses the Tripal API, (i.e. Tripal External Databases) to allow you to choose the URL prefix for your linkouts. A Tripal External Database consists of a label, which is shown in the drop-down, and both a URL and URL prefix. The URL prefix will be used with the record name extracted using the FASTA header settings above to create the linkout for your users. If the Tripal External Database already exists on your Tripal site, simply select it from the drop-down.
-
-If it does not already exist then you must first create it by going Administration > Tripal > Data Loaders > Chado Databases > Add Database. The most important elements are the "Database Name", which will appear in the drop-down on the "Blast Database" page once you refresh it and the "URL Prefix" which will be used to create the linkout. For more information on configuring Tripal databases, see the `Tripal User's Guide <https://tripal.readthedocs.io/en/latest/user_guide/example_genomics/cross_refs.html>`_.
-
-.. image:: targetdbs.4.externaldb.png

+ 0 - 18
docs/user_guide/tripal_daemon.rst

@@ -1,18 +0,0 @@
-
-Running Jobs Automatically
-===========================
-
-BLAST submissions result in the creation of Tripal jobs which then need to run from the command-line. This ensures that long running BLASTs will not cause page time-outs but does add some management overhead and might result in longer waits for users depending on how often you have cron set to run Tripal jobs. You can alternatively use the Tripal Jobs Daemon to automate running of Tripal Jobs reducing user wait time and your own workload.
-
-.. note::
-
-  `Tripal Daemon Documentation <https://tripal.readthedocs.io/en/latest/user_guide/job_management.html>`_
-
-.. warning::
-
-  If you find jobs are not running automatically, you may need to restart the Tripal Daemon. This is also necessary after a server restart. Navigate to your drupal root (e.g. ``/var/www/html``) on the command-line and run:
-
-  .. code:: bash
-
-    drush trpjob-daemon stop
-    drush trpjob-daemon start

+ 29 - 0
src/Controller/TripalBlastUI.php

@@ -0,0 +1,29 @@
+<?php
+/**
+ * @file 
+ * This route is for single all-in-one BLAST user interface.
+ * Choices of query type, protein or nucleotide, outlined in this page.
+ */
+
+namespace Drupal\tripal_blast\Controller;
+
+use Drupal\Core\Controller\ControllerBase;
+
+/**
+ * Defines TripalBlastUI class.
+ * 
+ */
+class TripalBlastUI extends ControllerBase {
+  /**
+   * Returns a render-able array to create Tripal BLAST UI elements.
+   * A list of variables (context links presented in the interface) is used
+   * and is defined in the hook_theme implementation of this module.
+   * @see hook_theme in tripal_blast.module.
+   */
+  public function content() {
+    return [
+      // Tripal BLAST UI page theme.
+      '#theme' => 'theme-tripal-blast-ui'
+    ];  
+  }    
+}

+ 0 - 27
src/Controller/TripalBlastUIBlastHelp.php

@@ -1,27 +0,0 @@
-<?php
-/**
- * @file 
- * Construct BLAST UI Help Page.
- */
-
-namespace Drupal\blast_ui\Controller;
-
-use Drupal\Core\Controller\ControllerBase;
-
-/**
- * Defines TripalBlastUIBlastHelp class.
- */
-class TripalBlastUIBlastHelp extends ControllerBase {
-  /**
-   * Returns a render-able array for submission form.
-   */
-  public function content() {
-    return [
-      '#theme' => 'theme-blast-ui-help',
-      '#attached' => [
-        'library' => [],
-        'drupalSettings' => []
-      ]      
-    ];  
-  }    
-}

+ 0 - 27
src/Controller/TripalBlastUIBlastSubmit.php

@@ -1,27 +0,0 @@
-<?php
-/**
- * @file 
- * Construct single all-in-one BLAST submission form.
- */
-
-namespace Drupal\blast_ui\Controller;
-
-use Drupal\Core\Controller\ControllerBase;
-
-/**
- * Defines TripalBlastUIBlastSubmit class.
- */
-class TripalBlastUIBlastSubmit extends ControllerBase {
-  /**
-   * Returns a render-able array for submission form.
-   */
-  public function content() {
-    return [
-      '#theme' => 'theme-blast-ui-menupage',
-      '#attached' => [
-        'library' => [],
-        'drupalSettings' => []
-      ]      
-    ];  
-  }    
-}

+ 0 - 52
src/Form/TripalBlastUIBlastSubmitForm copy 2.php

@@ -1,52 +0,0 @@
-<?php
-/**
- * @file 
- * Construct configuration form of this module.
- */
-
-namespace Drupal\blast_ui\Form;
-
-use Drupal\Core\Form\ConfigFormBase;
-use Drupal\Core\Form\FormStateInterface;
-
-/**
- * Defines TripalBlastUIBlastSubmitForm class.
- * All-in-one BLAST submission form.
- */
-class TripalBlastUIBlastSubmitForm extends ConfigFormBase {
-  const SETTINGS = 'blast_ui.settings';
-  
-  /**
-   * {@inheritdoc}
-   */
-  public function getFormId() {
-    return 'blast_ui_admin_settings';
-  }
-
-  /**
-   * {@inheritdoc}
-   */
-  protected function getEditableConfigNames() {
-    return [
-      static::SETTINGS,
-    ];
-  }
-
-  /**
-   * {@inheritdoc}
-   * Build form.
-   */
-  public function buildForm(array $form, FormStateInterface $form_state) {
-       
-    return parent::buildForm($form, $form_state);
-  }
-
-  /**
-   * {@inheritdoc}
-   * Save configuration.
-   */
-  public function submitForm(array &$form, FormStateInterface $form_state) {
-
-    return parent::submitForm($form, $form_state);
-  }
-}

+ 0 - 52
src/Form/TripalBlastUIBlastSubmitForm copy.php

@@ -1,52 +0,0 @@
-<?php
-/**
- * @file 
- * Construct configuration form of this module.
- */
-
-namespace Drupal\blast_ui\Form;
-
-use Drupal\Core\Form\ConfigFormBase;
-use Drupal\Core\Form\FormStateInterface;
-
-/**
- * Defines TripalBlastUIBlastSubmitForm class.
- * All-in-one BLAST submission form.
- */
-class TripalBlastUIBlastSubmitForm extends ConfigFormBase {
-  const SETTINGS = 'blast_ui.settings';
-  
-  /**
-   * {@inheritdoc}
-   */
-  public function getFormId() {
-    return 'blast_ui_admin_settings';
-  }
-
-  /**
-   * {@inheritdoc}
-   */
-  protected function getEditableConfigNames() {
-    return [
-      static::SETTINGS,
-    ];
-  }
-
-  /**
-   * {@inheritdoc}
-   * Build form.
-   */
-  public function buildForm(array $form, FormStateInterface $form_state) {
-       
-    return parent::buildForm($form, $form_state);
-  }
-
-  /**
-   * {@inheritdoc}
-   * Save configuration.
-   */
-  public function submitForm(array &$form, FormStateInterface $form_state) {
-
-    return parent::submitForm($form, $form_state);
-  }
-}

+ 0 - 52
src/Form/TripalBlastUIBlastSubmitForm.php

@@ -1,52 +0,0 @@
-<?php
-/**
- * @file 
- * Construct configuration form of this module.
- */
-
-namespace Drupal\blast_ui\Form;
-
-use Drupal\Core\Form\ConfigFormBase;
-use Drupal\Core\Form\FormStateInterface;
-
-/**
- * Defines TripalBlastUIBlastSubmitForm class.
- * All-in-one BLAST submission form.
- */
-class TripalBlastUIBlastSubmitForm extends ConfigFormBase {
-  const SETTINGS = 'blast_ui.settings';
-  
-  /**
-   * {@inheritdoc}
-   */
-  public function getFormId() {
-    return 'blast_ui_admin_settings';
-  }
-
-  /**
-   * {@inheritdoc}
-   */
-  protected function getEditableConfigNames() {
-    return [
-      static::SETTINGS,
-    ];
-  }
-
-  /**
-   * {@inheritdoc}
-   * Build form.
-   */
-  public function buildForm(array $form, FormStateInterface $form_state) {
-       
-    return parent::buildForm($form, $form_state);
-  }
-
-  /**
-   * {@inheritdoc}
-   * Save configuration.
-   */
-  public function submitForm(array &$form, FormStateInterface $form_state) {
-
-    return parent::submitForm($form, $form_state);
-  }
-}

+ 0 - 977
src/Services/BlastUIBlast.php

@@ -1,977 +0,0 @@
-<?php
-/**
- * @file 
- * Contains more generally applicable functions as well as some meant to help developers
- * Plug-in to the BLAST UI functionality
- */
-
-namespace Drupal\blast_ui\Services;
-
-use Drupal\node\Entity\Node;
-
-/**
- * Class TripalD3ColorScheme
- */
-class BlastUIBlast {
-  
-  /**
-   * Get a specific BlastDB.
-   *
-   * @param $identifiers
-   *   An array of identifiers used to determine which BLAST DB to retrieve. 
-   *
-   * @return
-   *   A fully-loaded BLAST DB Node  
-   */  
-  public function getBLASTDatabase($identifiers) {
-    $node = FALSE;
-
-    if (isset($identifiers['nid'])) {
-      $node = Node::load($identifiers['nid']);
-    }
-    elseif (isset($identifiers['name'])) {
-      $nid = db_query('SELECT nid FROM {blastdb} WHERE name=:name', [':name' => $identifiers['name']])
-        ->fetchField();
-      $node = Node::load($nid);
-  
-    } elseif (isset($identifiers['path'])) {
-      $nid = db_query('SELECT nid FROM {blastdb} WHERE path LIKE :path', [':path' => db_like($identifiers['path']) . '%'])
-        ->fetchField();
-      $node = Node::load($nid);  
-    }
-  
-    return $node;
-  }
-
-  /**
-   * Returns a list BLAST DATABASE options
-   *
-   * @param $type
-   *   The type of BLAST dabases to restrict the list to (ie: n: nucleotide or p: protein)
-   *
-   * @return
-   *   An array where the nid is the key and the value is the human-readable name of the option
-   */
-  public function getBLASTDatabaseOptions($type) {
-    global $user;
-  
-    // Get all BlastDB nodes
-    $nodes = getBLASTDatabaseNodes();
-  
-    // Support obsolete database type n/p
-    $obs_type = '';
-    if ($type == 'protein') {
-      $obs_type = 'p';
-    }
-    else {
-      $obs_type = 'n';
-    }
-  
-    $options = [];
-    foreach ($nodes as $node) {
-      if ( isset($node) && isset($node->db_dbtype) ) {
-        if ( ($node->db_dbtype == $type) OR ($node->db_dbtype == $obs_type) ) {
-          $options[$node->nid] = $node->db_name;
-        }
-      }
-    }
-  
-    // Sort alphabetically
-    asort($options);
-  
-    return $options;
-  }  
-
-  /**
-   * Returns all blast database nodes.
-   *
-   * @return
-   *   An array of nodes.
-   */
-  public function getBLASTDatabaseNodes() {
-    // Use the Entity API to get a list of BLAST Nodes to load
-    // We use this function in order respect node access control so that
-    // administrators can use this module in combination with a node access module
-    // of their choice to limit access to specific BLAST databases.
-    $query = \Drupal::entityQuery('node')
-      // Restrict to BLASTDB nodes.
-      ->condition('bundle', 'blastdb')
-      // Restrict to Published nodes.
-      ->condition('status', 1)
-      // Restrict to nodes the current user has permission to view.
-      ->addTag('node_access');
-    
-    $entities = $query->execute();
-
-    // Get all BlastDB nodes
-    return Node::loadMultiple(array_keys($entities['node']));
-  }  
-
-  /**
-   * Retrieve all the information for a blast job in a standardized node-like format.
-   *
-   * @param $job_id
-   *   The non-encoded tripal job_id.
-   * @retun
-   *   An object describing the blast job.
-   */
-  public function getBLASTJob($job_id) {
-    $blastjob = db_query('SELECT * FROM blastjob WHERE job_id=:id', array(':id' => $job_id))
-      ->fetchObject();
-  
-    if (!$blastjob) {
-      return false;
-    }
-  
-    $tripal_job = tripal_get_job($job_id);
-  
-    $job = new stdClass();
-    $job->job_id  = $job_id;
-    $job->program = $blastjob->blast_program;
-    $job->options = unserialize($blastjob->options);
-    $job->date_submitted = $tripal_job->submit_date;
-    $job->date_started   = $tripal_job->start_time;
-    $job->date_completed = $tripal_job->end_time;
-  
-    // TARGET BLAST DATABASE.
-    // If a provided blast database was used then load details.
-    if ($blastjob->target_blastdb ) {
-      $job->blastdb = $this->getBLASTDatabase(['nid' => $blastjob->target_blastdb]);
-    }
-    // Otherwise the user uploaded their own database so provide what information we can.
-    else {
-      $job->blastdb = new stdClass();
-      $job->blastdb->db_name = 'User Uploaded';
-      $job->blastdb->db_path = $blastjob->target_file;
-      $job->blastdb->linkout = new stdClass();
-      $job->blastdb->linkout->none = TRUE;
-  
-      if ($job->program == 'blastp' OR $job->program == 'tblastn') {
-        $job->blastdb->db_dbtype = 'protein';
-      }
-      else {
-        $job->blastdb->db_dbtype = 'nucleotide';
-      }
-    }
-  
-    // FILES.
-    $job->files = new stdClass();
-    $job->files->query  = $blastjob->query_file;
-    $job->files->target = $blastjob->target_file;
-    $job->files->result = new stdClass();
-    $job->files->result->archive = $blastjob->result_filestub . '.asn';
-    $job->files->result->xml     = $blastjob->result_filestub . '.xml';
-    $job->files->result->tsv     = $blastjob->result_filestub . '.tsv';
-    $job->files->result->html    = $blastjob->result_filestub . '.html';
-    $job->files->result->gff     = $blastjob->result_filestub . '.gff';
-  
-    return $job;
-  }  
-
-  /**
-   * Run BLAST (should be called from the command-line)
-   *
-   * @param $program
-   *   Which BLAST program to run (ie: 'blastn', 'tblastn', tblastx', 'blastp','blastx')
-   * @param $query
-   *   The full path and filename of the query FASTA file
-   * @param $database
-   *   The full path and filename prefix (excluding .nhr, .nin, .nsq, etc.)
-   * @param $output_filestub
-   *   The filename (not including path) to give the results. Should not include file type suffix
-   * @param $options
-   *   An array of additional option where the key is the name of the option used by
-   *   BLAST (ie: 'num_alignments') and the value is relates to this particular
-   *   BLAST job (ie: 250)
-   */
-  public function runBLASTTripalJob($program, $query, $database, $output_filestub, $options, $job_id = NULL) {
-    $output_file      = $output_filestub . '.asn';
-    $output_file_xml  = $output_filestub . '.xml';
-    $output_file_tsv  = $output_filestub . '.tsv';
-    $output_file_html = $output_filestub . '.html';
-    $output_file_gff  = $output_filestub . '.gff';
-  
-    print "\nExecuting $program\n\n";
-    print "Query: $query\n";
-    print "Database: $database\n";
-    print "Results File: $output_file\n";
-  
-    print "Options:\n";
-  
-    // Allow administrators to use an absolute path for these commands.
-    // Defaults to using $PATH.
-    $blast_path = variable_get('blast_path', '');
-    $blast_threads = variable_get('blast_threads', 1);
-  
-    // Strip the extension off the BLAST target
-    $suffix = ['.ndb', '.nhr', '.nin', '.not', '.nsq', '.ntf', '.nto',
-      '.pdb', '.phr', '.pin', '.pot', '.psq', '.ptf', '.pto'];
-    $database = str_replace($suffix, '', $database);
-  
-    // Check that the database exists before trying to execute the job.
-    if (!(file_exists($database . '.nsq') OR file_exists($database . '.psq'))) {
-      tripal_report_error(
-        'blast_ui',
-        TRIPAL_ERROR,
-        "Unable to find the BLAST database (ie: @db). Please ensure you have supplied the absolute path not including the file format endings.",
-        ['@db' => $database],
-        ['print' => TRUE]
-      );
-
-      return FALSE;
-    }
-  
-    // The BLAST executeable.
-    $program = $blast_path . $program;
-    if (!file_exists($program)) {
-      tripal_report_error(
-        'blast_ui',
-        TRIPAL_ERROR,
-        "Unable to find the BLAST executable (ie: /usr/bin/blastn). This can be changed in the admin settings; you supplied: @command",
-        ['@command' => $program],
-        ['print' => TRUE]
-      );
-
-      return FALSE;
-    }
-  
-    // The blast db formatter executable.
-    $blast_formatter_command = $blast_path . 'blast_formatter';
-    if (!file_exists($blast_formatter_command)) {
-      tripal_report_error(
-        'blast_ui',
-        TRIPAL_ERROR,
-        "Unable to find the BLAST Formatter executable (ie: /usr/bin/blast_formatter). This can be changed in the admin settings; you supplied: @command",
-        ['@command' => $blast_formatter_command],
-        ['print' => TRUE]
-      );
-
-      return FALSE;
-    }
-  
-    // Note: all variables are escaped (adds single quotes around their values) for security reasons.
-    $blast_cmd = escapeshellarg($program) . ' -query ' . escapeshellarg($query) . ' -db ' . escapeshellarg($database) . ' -out ' . escapeshellarg($output_file) . ' -outfmt=11';
-    if (!empty($options)) {
-      foreach ($options as $opt => $val) {
-        $val = trim($val);
-        if (!empty($val)) {
-          print "\t$opt: $val\n";
-          // We want to escape all the option values since they were supplied via
-          // user input. These values should also have been checked in the
-          // advanced form _validate functions but this adds an extra layer of
-          // protection.
-          $blast_cmd .= ' -' . escapeshellarg($opt) . ' ' . escapeshellarg($val);
-        }
-      }
-    }
-  
-   // Setting the value of threads by admin page
-   $blast_cmd .= ' -num_threads ' . escapeshellarg($blast_threads);
-  
-    print "\nExecuting the following BLAST command:\n" . $blast_cmd . "\n";
-  
-    system($blast_cmd);
-  
-    if (!file_exists($output_file)) {
-      tripal_report_error(
-        'blast_ui',
-        TRIPAL_ERROR,
-        "BLAST did not complete successfully as is implied by the lack of output file (%file). The command run was @command",
-        ['%file' => $output_file, '@command' => $blast_cmd],
-        ['print' => TRUE]
-      );
-
-      return FALSE;
-    }
-  
-    print "\nGenerating additional download formats...\n";
-  
-    print "\tXML\n";
-    $format_cmd = escapeshellarg($blast_formatter_command) . ' -archive ' . escapeshellarg($output_file) . ' -outfmt 5 -out ' . escapeshellarg($output_file_xml);
-    print "\t\tExecuting $format_cmd\n\n";
-    system($format_cmd);
-    if (!file_exists($output_file_xml)) {
-      tripal_report_error(
-        'blast_ui',
-        TRIPAL_ERROR,
-        "Unable to convert BLAST ASN.1 archive to XML (%archive => %file).",
-        ['%archive' => $output_file, '%file' => $output_file_xml],
-        ['print' => TRUE]
-      );
-    }
-  
-    print "\tTab-delimited\n";
-    $format_cmd = escapeshellarg($blast_formatter_command) . ' -archive ' . escapeshellarg($output_file) . ' -outfmt 7 -out ' . escapeshellarg($output_file_tsv);
-    print "\t\tExecuting $format_cmd\n\n";
-    system($format_cmd);
-    if (!file_exists($output_file_tsv)) {
-      tripal_report_error(
-        'blast_ui',
-        TRIPAL_WARNING,
-        "Unable to convert BLAST ASN.1 archive to Tabular Output (%archive => %file).",
-        ['%archive' => $output_file, '%file' => $output_file_tsv],
-        ['print' => TRUE]
-      );
-    }
-  
-    print "\tGFF\n";
-    convert_tsv2gff3($output_file_tsv,$output_file_gff);
-  
-    if (!file_exists($output_file_gff)) {
-      tripal_report_error(
-        'blast_ui',
-        TRIPAL_WARNING,
-        "Unable to convert BLAST Tabular Output to GFF Output (%archive => %file).",
-        ['%archive' => $output_file, '%file' => $output_file_gff],
-        ['print' => TRUE]
-      );
-    }
-  
-    print "\tHTML (includes alignments)\n";
-    $format_cmd = escapeshellarg($blast_formatter_command) . ' -archive ' . escapeshellarg($output_file) . ' -outfmt 0 -out ' . escapeshellarg($output_file_html) . ' -html';
-    print "\t\tExecuting $format_cmd\n\n";
-    system($format_cmd);
-    if (!file_exists($output_file_tsv)) {
-      tripal_report_error(
-        'blast_ui',
-        TRIPAL_WARNING,
-        "Unable to convert BLAST ASN.1 archive to HTML Output (%archive => %file).",
-        ['%archive' => $output_file, '%file' => $output_file_html],
-        ['print' => TRUE]
-      );
-    }
-  
-    print "\nDone!\n";
-  }  
-
-  /**
-   * FASTA validating parser
-   *
-   * A sequence in FASTA format begins with a single-line description, followed
-   * by lines of sequence data.The description line is distinguished from the
-   * sequence data by a greater-than (">") symbol in the first column. The word
-   * following the ">" symbol is the identifier of the sequence, and the rest of
-   * the line is the description (both are optional). There should be no space
-   * between the ">" and the first letter of the identifier. The sequence ends
-   * if another line starting with a ">" appears which indicates the start of
-   * another sequence.
-   *
-   * @param $type
-   *   The type of sequence to be validated (ie: either nucleotide or protein).
-   * @param $sequence
-   *  A string of characters to be validated.
-   *
-   * @return
-   *  Return a boolean. 1 if the sequence does not pass the format valifation stage and 0 otherwise.
-   *
-   */
-  function validateFASTASequence($type, $sequence) {
-    //Includes IUPAC codes.
-    $fastaSeqRegEx = ($type == 'nucleotide')
-                     ? '/^[ATCGNUKMBVSWDYRHatcgnukmbvswdyrh\[\/\]\s\n\r]*$/'
-                     : '/^[acdefghiklmnpqrstvwyACDEFGHIKLMNPQRSTVWY\*\-\s\n\r]*$/';
-    $defRegEx      = '/^>\S.*/';
-  
-    // For each line of the sequence.
-    foreach (explode("\n", $sequence) as $line) {
-  
-      // Is this a definition line?
-      if ($line[0] == '>') {
-        if (!preg_match($defRegEx, $line)) {
-          return FALSE;
-        }
-      }
-      // Otherwise it's a sequence line
-      else {
-        if (!preg_match($fastaSeqRegEx, $line)) {
-          return FALSE;
-        }
-      }
-    }
-  
-    return TRUE;
-  }
-
-  /**
-   * Retrieve the regex to capture the Link-out Accession from the Hit Def.
-   *
-   * @param $nid
-   *   The node ID of the BLAST database the hit is from.
-   * @param $options
-   *   An array of options that can be passed to this function. Supported
-   *   options include:
-   *    -
-   *
-   * @return
-   *   A PHP regex for use with preg_match to cature the Link-out Accession.
-   */
-  public function getBLASTDBLinkoutRegex($node, $options = array()) {
-
-    if (empty($node->linkout->regex)) {
-      switch ($node->linkout->regex_type) {
-        case 'default':
-          $regex = '/^(\S+).*/';
-          break;
-        case 'genbank':
-          $regex = '/^gb\|([^\|])*\|.*/';
-          break;
-        case 'embl':
-          $regex = '/^embl\|([^\|])*\|.*/';
-          break;
-        case 'swissprot':
-          $regex = '/^sp\|([^\|])*\|.*/';
-          break;
-      }
-    }
-    else {
-      $regex = $node->linkout->regex;
-    }
-  
-    return $regex;
-  }
-
-  /**
-   * Return a list of recent blast jobs to be displayed to the user.
-   *
-   * @param $programs
-   *   An array of blast programs you want jobs to be displayed for (ie: blastn, blastx, tblastn, blastp)
-   *
-   * @return
-   *   An array of recent jobs.
-   */
-  public function get_recent_blast_jobs($programs = array()) {
-
-    $filter_jobs = !empty($programs);
-  
-    // Retrieve any recent jobs from the session variable.
-    if (isset($_SESSION['blast_jobs'])) {
-  
-      $jobs = array();
-      foreach ($_SESSION['blast_jobs'] as $job_secret) {
-        $add = TRUE;
-  
-        $job_id = blast_ui_reveal_secret($job_secret);
-        if ($job = get_BLAST_job($job_id)) {
-  
-          // @TODO: Check that the results are still available.
-          // This is meant to replace the arbitrary only show jobs executed less than 48 hrs ago.
-  
-          // Remove jobs from the list that are not of the correct program.
-          if ($filter_jobs AND !in_array($job->program, $programs)) {
-            $add = FALSE;
-          }
-  
-          if ($add) {
-            $job->query_summary = format_query_headers($job->files->query);
-            $jobs[] = $job;
-          }
-        }
-      }
-  
-      return $jobs;
-    }
-    else {
-      return array();
-    }
-  }  
-
-  /**
-   * Retrieve the number of recent jobs.
-   */
-  public function getNumberOfRecentJobs() {
-    if (isset($_SESSION['blast_jobs'])) {
-      return sizeof($_SESSION['blast_jobs']);
-    }
-    
-    return 0;
-  }
-
-  /**
-   * Summarize a fasta file based on it's headers.
-   *
-   * @param $file
-   *   The full path to the FASTA file.
-   *
-   * @return
-   *   A string describing the number of sequences and often including the first query header.
-   */
-  public function format_query_headers($file) {
-
-    $headers = [];
-    exec('grep ">" ' . escapeshellarg($file), $headers);
-  
-    // Easiest case: if there is only one query header then show it.
-    if (sizeof($headers) == 1 AND isset($headers[0])) {
-      return ltrim($headers[0], '>');
-    }
-    // If we have at least one header then show that along with the count of queries.
-    elseif (isset($headers[0])) {
-      return sizeof($headers) . ' queries including "' . ltrim($headers[0], '>') . '"';
-    }
-    // If they provided a sequence with no header.
-    elseif (empty($headers)) {
-      return 'Unnamed Query';
-    }
-    // At the very least show the count of queries.
-    else {
-      return sizeof($headers) . ' queries';
-    }
-  }  
-
-  /**
-   * Sort recent blast jobs by the date they were submitted.
-   * Ascending is in order of submission.
-   *
-   * THIS FUNCTION SHOULD BY USED BY USORT().
-   */
-  public function sortBLASTJobsByDateSubmittedAsc($a, $b) {
-    return ($a->date_submitted - $b->date_submitted);
-  }
-
-  /**
-   * Sort recent blast jobs by the date they were submitted.
-   * Descending is most recent first.
-   *
-   * THIS FUNCTION SHOULD BY USED BY USORT().
-   */
-  public function sortBLASTJobsByDateSubmittedDesc($a, $b) {
-    return ($b->date_submitted - $a->date_submitted);
-  }
-
-  /**
-   * Generate an image of HSPs for a given hit.
-   *
-   * history:
-   *    09/23/10  Carson  created
-   *    04/16/12  eksc    adapted into POPcorn code
-   *    03/12/15  deepak  Adapted code into Tripal BLAST
-   *    10/23/15  lacey   Fixed deepak's code to be suitable for Drupal.
-   *
-   * @param $acc
-   *   target name
-   * @param $name
-   *   query name, false if none
-   * @param $tsize
-   *   target size
-   * @param $qsize
-   *   query size
-   * @param $hits
-   *   each hit represented in URL as: targetstart_targetend_hspstart_hspend;
-   * @param $score
-   *   score for each hit
-   *
-   * @return
-   *   A base64 encoded image representing the hit information.
-   */
-  public function generate_blast_hit_image($acc = '', $scores, $hits, $tsize, $qsize, $name, $hit_name) {
-    $tok = strtok($hits, ";");
-    $b_hits = [];
-
-    while ($tok !== false) {
-      $b_hits[] = $tok;
-      $tok = strtok(";");
-    }
-  
-    // extract score information from score param
-    $tokscr = strtok($scores, ";");
-    $b_scores = [];
-
-    while ($tokscr !== false) {
-     $b_scores[] = $tokscr;
-     $tokscr = strtok(";");
-    }
-  
-    // image measurements
-    $height = 200 + (count($b_hits) * 16);
-    $width  = 520;
-  
-    $img = imagecreatetruecolor($width, $height);
-  
-    $white      = imagecolorallocate($img, 255, 255, 255);
-    $black      = imagecolorallocate($img, 0, 0, 0);
-    $darkgray   = imagecolorallocate($img, 100, 100, 100);
-    $strong     = imagecolorallocatealpha($img, 202, 0, 0, 15);
-    $moderate   = imagecolorallocatealpha($img, 204, 102, 0, 20);
-    $present    = imagecolorallocatealpha($img, 204, 204, 0, 35);
-    $weak       = imagecolorallocatealpha($img, 102, 204, 0, 50);
-    $gray       = imagecolorallocate($img, 190, 190, 190);
-    $lightgray  = $white; //imagecolorallocate($img, 230, 230, 230);
-  
-    imagefill($img, 0, 0, $lightgray);
-  
-    // Target coordinates
-    $maxlength = 300;
-    $t_length = ($tsize > $qsize)
-                  ? $maxlength : $maxlength - 50;
-    $q_length = ($qsize > $tsize)
-                  ? $maxlength : $maxlength - 50;
-  
-    $tnormal = $t_length / $tsize;
-    $qnormal = $q_length / $qsize;
-  
-    $t_ystart = 30;
-    $t_yend   = $t_ystart + 20;
-  
-    $t_xstart = 50;
-    $t_xend   = $t_xstart + $t_length;
-    $t_center = $t_xstart + ($t_length / 2);
-  
-    // Target labels
-    $warn = '"'. $hit_name . '"';
-    imagestring($img, 5, $t_xstart, $t_ystart-20, $acc.$warn, $black);
-    imagestring($img, 3, 5, $t_ystart+2, "Target", $black);
-  
-    // Draw bar representing target
-    imagefilledrectangle($img, $t_xstart, $t_ystart, $t_xend, $t_yend, $gray);
-    imagerectangle($img, $t_xstart, $t_ystart, $t_xend, $t_yend, $darkgray);
-  
-    // query coordinates
-    $q_maxheight = 250;
-    $q_ystart = $t_yend + 100;
-    $q_yend = $q_ystart + 20;
-  
-    $q_xstart = $t_center - $q_length / 2;
-    $q_xend = $q_xstart + $q_length;
-  
-    $q_center = ($q_xend + $q_xstart) / 2;
-    $q_xwidth = $q_xend - $q_xstart;
-  
-    // Query labels
-    imagestring($img, 5, $q_xstart, $q_yend+2, $name, $black);
-    imagestring($img, 3, $q_xstart, $q_ystart+2, 'Query', $black);
-  
-    // Draw bar representing query
-    imagefilledrectangle($img, $q_xstart, $q_ystart, $q_xend, $q_yend, $gray);
-    imagerectangle($img ,$q_xstart, $q_ystart, $q_xend, $q_yend, $darkgray);
-  
-    // HSP bars will start here
-    $hsp_bary = $q_yend + 20;
-  
-    // Draw solids for HSP alignments
-    for ($ii=count($b_hits)-1; $ii>=0; $ii--) {
-      // alignment
-  
-     $cur_hit = $b_hits[$ii];
-     $cur_score = intval($b_scores[$ii]);
-  
-     // set color according to score
-     $cur_color = $darkgray;
-     if ($cur_score > 200) {
-       $cur_color = $strong;
-     }
-     else if ($cur_score > 80 && $cur_score <= 200) {
-       $cur_color = $moderate;
-     }
-     else if ($cur_score > 50 && $cur_score <= 80) {
-       $cur_color = $present;
-     }
-     else if ($cur_score > 40 && $cur_score <= 50) {
-       $cur_color = $weak;
-     }
-  
-     $t_start = $tnormal *  intval(strtok($cur_hit, "_")) + $t_xstart;
-      $t_end = $tnormal *  intval(strtok("_")) + $t_xstart;
-      $q_start = $qnormal * intval(strtok("_")) + $q_xstart;
-      $q_end = $qnormal *  intval(strtok("_")) + $q_xstart;
-  
-      $hit1_array = [$t_start, $t_yend, $t_end, $t_yend, $q_end,
-                     $q_ystart, $q_start, $q_ystart];
-  
-     // HSP coords
-      imagefilledpolygon($img, $hit1_array, 4, $cur_color);
-  
-    }//each hit
-  
-    // Draw lines over fills for HSP alignments
-    for ($ii=0; $ii<count($b_hits); $ii++) {
-     // alignment
-  
-     $cur_hit = $b_hits[$ii];
-     $t_start = $tnormal *  intval(strtok($cur_hit, "_")) + $t_xstart;
-      $t_end = $tnormal *  intval(strtok("_")) + $t_xstart;
-      $q_start = $qnormal * intval(strtok("_")) + $q_xstart;
-      $q_end = $qnormal *  intval(strtok("_")) + $q_xstart;
-  
-     $hit1_array = array($t_start, $t_yend, $t_end, $t_yend, $q_end, $q_ystart,
-                         $q_start, $q_ystart,);
-  
-     imagerectangle($img, $t_start, $t_ystart, $t_end, $t_yend, $black);
-     imagerectangle($img, $q_start, $q_ystart, $q_end, $q_yend, $black);
-     imagepolygon ($img, $hit1_array, 4, $black);
-  
-      // show HSP
-  
-     imagestring($img, 3, 2, $hsp_bary, ($acc ."HSP" . ($ii + 1)), $black);
-  
-     $cur_score = intval($b_scores[$ii]);
-  
-     // set color according to score
-     $cur_color = $darkgray;
-     if ($cur_score > 200) {
-       $cur_color = $strong;
-     }
-     else if ($cur_score > 80 && $cur_score <= 200) {
-       $cur_color = $moderate;
-     }
-     else if ($cur_score > 50 && $cur_score <= 80) {
-       $cur_color = $present;
-     }
-     else if ($cur_score > 40 && $cur_score <= 50) {
-       $cur_color = $weak;
-     }
-  
-     imagefilledrectangle($img, $q_start, $hsp_bary, $q_end, $hsp_bary+10, $cur_color);
-      $hsp_bary += 15;
-    }//each hit
-  
-    // Draw the key
-  
-    $xchart = 390;
-    $ychart = 10;
-    $fontsize = 4;
-    $yinc = 20;
-    $ywidth = 7;
-    $xinc = 10;
-  
-    imagestring($img, 5, $xchart, $ychart - 5, "Bit Scores", $black);
-  
-    imagestring($img, $fontsize, $xchart + $yinc + $xinc,$ychart + ($yinc * 1) + $ywidth, ">= 200" , $black);
-    imagestring($img, $fontsize, $xchart + $yinc + $xinc,$ychart + ($yinc * 2) + $ywidth, "80 - 200" , $black);
-    imagestring($img, $fontsize, $xchart + $yinc + $xinc,$ychart + ($yinc * 3) + $ywidth, "50 - 80" , $black);
-    imagestring($img, $fontsize, $xchart + $yinc + $xinc,$ychart + ($yinc * 4) + $ywidth, "40 - 50" , $black);
-    imagestring($img, $fontsize, $xchart + $yinc + $xinc,$ychart + ($yinc * 5) + $ywidth, "< 40" , $black);
-  
-    imagefilledRectangle($img, $xchart, $ychart + ($yinc * 1) + $xinc, $xchart + $yinc, $ychart + ($yinc * 2), $strong);
-    imagefilledRectangle($img, $xchart, $ychart + ($yinc * 2) + $xinc, $xchart + $yinc, $ychart + ($yinc * 3), $moderate);
-    imagefilledRectangle($img, $xchart, $ychart + ($yinc * 3) + $xinc, $xchart + $yinc, $ychart + ($yinc * 4), $present);
-    imagefilledRectangle($img, $xchart, $ychart + ($yinc * 4) + $xinc, $xchart + $yinc, $ychart + ($yinc * 5), $weak);
-    imagefilledRectangle($img, $xchart, $ychart + ($yinc * 5) + $xinc, $xchart + $yinc, $ychart + ($yinc * 6), $darkgray);
-  
-    // Now, we have a completed image resource and need to change it to an actual image
-    // that can be displayed. This is done using imagepng() but unfortuatly that function
-    // either saves the image to a file or outputs it directly to the screen. Thus, we use
-    // the following code to capture it and base64 encode it.
-    ob_start(); // Start buffering the output
-    imagepng($img, null, 0, PNG_NO_FILTER);
-    $b64_img = base64_encode(ob_get_contents()); // Get what we've just outputted and base64 it
-    imagedestroy($img);
-    ob_end_clean();
-  
-    return $b64_img;
-  }
-
-  /**
-   * Convert tsv blast output to gff output file.
-   *
-   * Created by Sofia Robb
-   * 09/15/2016
-   * counter bugfix 10/27/2016
-   *
-   * The subject (hit) will be the source feature.
-   * The query will be the target.
-   *
-   * @todo: find a more efficient way since currently the first loop stores all the blast
-   *   results into an array and then the second loop prints them.
-   *
-   * @param $blast_tsv
-   *   The name of the blast tsv output file.
-   * @param $blast_gff
-   *   The name of the blast gff output file.
-   */
-  public function convertTsvToGff3($blast_tsv, $blast_gff){
-
-    // Open a new file for writting the gff.
-    $gff = fopen($blast_gff,"w");
-    fwrite($gff,"##gff-version 3\n");
-  
-    // Open the TSV file to read from.
-    $tsv = fopen($blast_tsv, "r") or die("Unable to open tsv file!");
-  
-    // For each line in the TSV file...
-    // Need to go thru each line of tsv to find the first and last hsp of a hit.
-    $last_s = NULL;
-    $hsp = NULL;
-    $HitResult = [];
-  
-    while(!feof($tsv)) {
-      $line = fgets($tsv);
-      $line = rtrim($line);
-  
-      // Skip the line if it's empty.
-      if (preg_match('/^#/',$line) or preg_match('/^\s*$/',$line)){
-        continue;
-      }
-  
-      ## for keeping track of new queries and hits
-  
-      // Each line has the following parts:
-      //  0: query id,
-      //  1: subject id,
-      //  2: % identity,
-      //  3: alignment length,
-      //  4: mismatches,
-      //  5: gap opens,
-      //  6: q. start,
-      //  7: q. end,
-      //  8: s. start,
-      //  9: s. end,
-      // 10: evalue,
-      // 11: bit score
-      $parts = preg_split('/\t/', $line);
-  
-      // Assign the important parts of the line to readable variables.
-      $s  = $parts[1];
-      $q  = $parts[0];
-      $ss = $parts[8];
-      $se = $parts[9];
-      $qs = $parts[6];
-      $qe = $parts[7];
-      $e  = $parts[10];
-  
-      // if this is a new hit print the last and
-      // empty the $HitResult array and
-      // reset hsp counter
-      if ($last_s != NULL and $s != $last_s ) {
-        $this->printGFFParentChildren($gff,$HitResult);
-        $HitResult = array();
-        $hsp=0;
-      }
-  
-      // every line is a new hsp
-      $hsp++;
-  
-      // determine query strand to use in match_part line, no need to store, just print
-      $q_strand = '+';
-      if ($qs > $qe) {
-          list($qs,$qe) = array($qe,$qs);
-          $q_strand = '-';
-      }
-  
-      // determine subject (hit) strand to use in match line, needs to be stored
-      $HitResult["$s,$q"]['strand']='+';
-      list($start,$end) = array($ss,$se);
-      if($ss > $se) {
-         list($start,$end) = array($se,$ss);
-         $HitResult["$s,$q"]['strand']='-';
-       }
-  
-      // store smallest start
-       if (!array_key_exists('SS',$HitResult["$s,$q"]) or $ss < $HitResult["$s,$q"]['SS']) {
-         $HitResult["$s,$q"]['SS'] = $ss;
-       }
-  
-      // store largest end
-       if (!array_key_exists('SE',$HitResult["$s,$q"]) or $se > $HitResult["$s,$q"]['SE']) {
-         $HitResult["$s,$q"]['SE'] = $se;
-       }
-  
-       // store best evalue
-       if (!array_key_exists('E',$HitResult["$s,$q"]) or $e < $HitResult["$s,$q"]['E']) {
-         $HitResult["$s,$q"]['E'] = $e;
-       }
-  
-       // generate the match_part line for each hsp
-       $HitResult["$s,$q"]['HSPs'][] = join("\t", [$s, "BLASTRESULT" , "match_part" , $start , $end , $e , $HitResult["$s,$q"]['strand'] , '.' , "ID=$s.$q.$hsp;Parent=$s.$q;Target=$q $qs $qe $q_strand"]);
-       $last_s = $s;
-    } // end tsv file while
-  
-    // print hit and hsp for the last hit
-    $this->printGFFParentChildren($gff, $HitResult);
-
-    // Close the files.
-    fclose($tsv);
-    fclose($gff);
-  }  
-
-  /**
-   * Prints the GFF parent feature and all of its children features
-   *
-   * @param $blast_feature_array
-   *   an array of the all the child features which is used to generate the smallest and largest coordinates for the parent
-   */
-  public function printGFFParentChildren($gff, $blast_feature_array){
-    foreach ($blast_feature_array as $sq => $value ) {
-      list ($s,$q) = preg_split('/,/', $sq);
-      $evalue = $blast_feature_array["$s,$q"]['E'];
-      $parent = join("\t", array($s, "BLASTRESULT", "match", $blast_feature_array["$s,$q"]['SS'], $blast_feature_array["$s,$q"]['SE'], $blast_feature_array["$s,$q"]['E'], $blast_feature_array["$s,$q"]['strand'], '.' , "ID=$s.$q;Name=$q($evalue)")) . "\n";
-      $child  = join("\n", $blast_feature_array["$s,$q"]['HSPs']) . "\n";
-      
-      fwrite($gff,$parent);
-      fwrite($gff,$child);
-    }
-  }
-  
-  /**
-   * Get text from cvitjs conf file, if possible.
-   *
-   * @param $genome_target
-   *   The section of the config to return. Should consist of "data."+[blastdb name].
-   *
-   * @return
-   *   A string containing the entire contents of the cvitjs configuration file. FALSE otherwise.
-   */
-  public function BLASTUIGetCivitConfText($genome_target = FALSE) {
-
-    // Retrieve the full path and filename of the conf.
-    $cvit_conf = $this->BLASTUIGetCivitConf();
-    if ($cvit_conf) {
-  
-      // Retrieve the contents of the file.
-      $contents = '';
-      if (file_exists($cvit_conf)) {
-        $contents = file_get_contents($cvit_conf);
-      }
-  
-      // If no genome target was provided then return the full file.
-      if ($contents && $genome_target == FALSE) {
-        return $contents;
-      }
-  
-      // If a genome target was provided, then only return that section.
-      if ($genome_target) {
-        $section = array();
-        $in_section = FALSE;
-  
-        // For each line of the configuration file...
-        $section_header = '['.$genome_target.']';
-        $lines = preg_split('/\r\n|\n|\r/', trim($contents));
-        foreach($lines as $l) {
-  
-          // Are we in the section for this genome target?
-          if (trim($l) == $section_header) {
-            $in_section = TRUE; }
-  
-          // Id so and we haven't fallen out of it through an empty line,
-          // then add it to saved section for returning.
-          if ($in_section) {
-            if (trim($l) == '') { break; }
-            $section[] = trim($l);
-          }
-        }
-  
-        // If we found the section, then return it ;-).
-        if (!empty($section)) {
-          return implode("\n", $section);
-        }
-      }
-    }
-  
-    return false;
-  }  
-
-  /**
-   * Get path to cvitjs conf file.
-   *
-   * @return
-   *   The path to the CViTjs codebase.
-   */
-  public function BLASTUIGetCivitConf($cvitjs_location = NULL) {
-    if (!$cvitjs_location) {
-      $cvitjs_location = libraries_get_path('cvitjs') . DIRECTORY_SEPARATOR;
-    }
-  
-    $cvit_conf_path = $cvitjs_location . 'cvit.conf';
-  
-    return $cvit_conf_path;
-  }
-}

+ 0 - 174
templates/template-blast-ui-help.html.twig

@@ -1,174 +0,0 @@
-{#
-/**
- * @file
- * Default theme implementation of BLAST UI Help page.
- */
-#}
-
-<h3>Tripal BLAST Module Description</h3>
-<p>This module provides a basic interface to allow your users to utilize your server's NCBI BLAST+.</p>
-
-<p>
-  <a href="#setup">Setup</a> | 
-  <a href="#function">Functionality</a> | 
-  <a href="#protection">Large jobs | 
-  <a href="#genomeview">Genome visualization</a>
-</p>
-
-<a name="setup"></a>
-&mdash;
-<h3><b>Setup Instructions</b></h3>
-<ol>
-  <li>
-    Install NCBI BLAST+ on your server (Tested with 2.2.26+). There is a
-    <a href="https://launchpad.net/ubuntu/+source/ncbi-blast+">package available
-    for Ubuntu</a> to ease installation. Optionally you can set the path to your
-    BLAST executable: {{ context_links['link_config'] }} Page.
-  </li>
-  <li>
-    Optionally, create Tripal External Database References to allow you to link
-    the records in your BLAST database to further information. To do this simply
-    go to {{ context_links['link_dbadd'] }} and make sure to fill in the Database
-    prefix which will be concatenated with the record IDs in your BLAST database
-    to determine the link-out to additional information. Note that a regular
-    expression can be used when creating the BLAST database to indicate what the
-    ID is.
-  </li>
-  <li>
-    Create "BLAST Database" {{ context_links['link_nodeadd'] }} nodes for each dataset you want to make available for your users to BLAST
-    against. BLAST databases should first be created using the command-line
-    <code>makeblastdb</code> program with the <code>-parse_seqids</code> flag.
-  </li>
-  <li>
-    It's recommended that you also install the <a href="http://drupal.org/project/tripal_daemon">Tripal Job Daemon</a>
-    to manage BLAST jobs and ensure they are run soon after being submitted by the
-    user. Without this additional module, administrators will have to execute the
-    tripal jobs either manually or through use of cron jobs.
-  </li>
-</ol>
-
-<a name="function"></a>
-&mdash;
-<h3><b>Highlighted Functionality</b></h3>
-<ul>
-  <li>Supports {{ context_links['link_blastn'] }},
-    {{ context_links['link_blastx'] }},
-    {{ context_links['blastp'] }} and
-    {{ context_linkst['tblastx'] with separate forms depending upon the database/query type.
-  </li>
-  <li>
-    Simple interface allowing users to paste or upload a query sequence and then
-    select from available databases. Additionally, a FASTA file can be uploaded
-    for use as a database to BLAST against (this functionality can be disabled).
-  </li>
-  <li>
-    Tabular Results listing with alignment information and multiple download
-    formats (HTML, TSV, XML) available.
-  </li>
-  <li>
-    Completely integrated with Tripal Jobs: {{ context_links['link_jobs'] }}
-    providing administrators with a way to track BLAST jobs and ensuring long
-    running BLASTs will not cause page time-outs
-  </li>
-  <li>
-    BLAST databases are made available to the module by creating Drupal Pages: {{ context_link['link_nodeadd'] }}
-    describing them. This allows administrators to use the Drupal Field API to add any information they want to these pages:
-    {{ context_links['link_dbfields'] }}
-  </li>
-  <li>
-    BLAST database records can be linked to an external source with more
-    information (ie: NCBI) per BLAST database.
-  </li>
-</ul>
-
-<a name="protection"</a></a>
-&mdash;
-<h3><b>Protection Against Large Jobs</b></h3>
-Depending on the size and nature of your target databases, you may wish to constrain use
-of this module.
-<ol>
-  <li>Limit the number of results displayed via admin page. The recommended number is 500.</li>
-  <li>
-    Limit the maximum upload file size in php settings. This is less useful because some
-    very large queries may be manageable, and others not.
-  </li>
-  <li>
-    Repeat-mask your targets, or provide repeat-masked versions. Note that some
-    researchers may be looking for repeats, so this may limit the usefulness of the BLAST
-    service.
-  </li>
-</ol>
-
-<a name="genomeview"></a>
-&mdash;
-<h3><b>Whole Genome Visualization</b></h3>
-This module can be configured to use
-<a href="https://github.com/LegumeFederation/cvitjs">CViTjs</a> to display BLAST hits on
-a genome image.
-
-<h4>CViTjs Setup</h4>
-<ol>
-  <li>
-    <a href="https://github.com/LegumeFederation/cvitjs">Download CViTjs</a> and copy
-    the code to your webserver. It needs to be placed in <code>[your drupal root]/sites/all/libraries</code>. To download, execute
-    the git command inside the <code>libraries/</code> directory:<br>
-    <code>git clone https://github.com/LegumeFederation/cvitjs.git</code>
-  </li>
-  <li>
-    CViTjs will have a config file in its root directory named cvit.conf. This file
-    provides information for whole genome visualization for each genome BLAST target.
-    <b>Make sure the config file can be edited by your web server.</b>
-  </li>
-  <li>
-    Enable CViTjs from the BLAST module administration page.
-  </li>
-  <li>
-    Edit the configuration file to define each genome target. These will look like:
-    <pre>
-[data.Cajanus cajan - genome]
-conf = data/cajca/cajca.conf
-defaultData = data/cajca/cajca.gff</pre>
-    Where:<br>
-    <ul>
-      <li>the section name, "data.Cajanus cajan - genome", consists of "data." followed
-          by the name of the BLAST target node,</li>
-      <li>the file "cajca.conf" is a cvit configuration file which describes how to draw the
-          chromosomes and BLAST hits on the <i>Cajanus cajan</i> genome,</li>
-      <li>and the file "cajca.gff" is a GFF3 file that describes the <i>Cajanus cajan</i>
-          chromosomes.</li>
-    </ul>
-    At the top of the configuration file there must be a [general] section that defines
-    the default data set. For example:
-    <pre>
-[general]
-data_default = data.Cajanus cajan - genome</pre>
-  </li>
-  <li>
-    Edit the nodes for each genome target (nodes of type "BLAST Database") and enable whole
-    genome visualization. Remember that the names listed in the CViTjs config file must
-    match the BLAST node name. In the example above, the BLAST database node for the
-    <i>Cajanus cajan</i> genome assembly is named "Cajanus cajan - genome"
-  </li>
-</ol>
-
-<h4>Notes</h4>
-<ul>
-<li>The .conf file for each genome can be modified to suit your needs and tastes. See the
-  sample configuration file, <code>data/test1/test1.conf</code>, and the CViTjs
-  <a href="https://github.com/LegumeFederation/cvitjs#using-cvitjs">documentation</a>.</li>
-<li>Each blast target CViTjs configuration file must define how to visualize blast hits or you will not see them.
-  <pre>[blast]
-feature = BLASTRESULT:match_part
-glyph   = position
-shape = rect
-color   = #FF00FF
-width = 5</pre></li>
-<li>You will have to put the target-specific conf and gff files (e.g. cajca.conf and
-  cjca.gff) on your web server, in the directory, <code>sites/all/libraries/cvitjs/data</code>. You may
-  choose to group files for each genome into subdirectories, for example,
-  <code>sites/all/libraries/cvitjs/data/cajca</code>.</li>
-<li>It is important to make sure that cvit.conf points to the correct data directory and the
-  correct .gff and .conf files for the genome in question. For more information about how to
-  create the .gff file, see the
-  <a href="https://github.com/LegumeFederation/cvitjs#how-to">documentation</a>.</li>
-</ul>

+ 2 - 2
templates/template-blast-ui-menupage.html.twig → templates/template-tripal-blast-ui.html.twig

@@ -36,7 +36,7 @@ gene based on similarity of sequence.</p>
     <th>BLAST Program</th>
   </tr>
   <tr>
-    <td rowspan="2">{{ context_links['link_Nucleotide'] }}</td>
+    <td rowspan="2">{{ context_links['link_nucleotide'] }}</td>
     <td>Nucleotide</td>
     <td>{{ context_links['link_blastn'] }}: Search a nucleotide database using a nucleotide query.</td>
   </tr>
@@ -45,7 +45,7 @@ gene based on similarity of sequence.</p>
     <td>{{ context_links['link_blastx'] }}: Search protein database using a translated nucleotide query.</td>
   </tr>
   <tr>
-    <td rowspan="2">{{ context_links['link_Protien'] }}</td>
+    <td rowspan="2">{{ context_links['link_protein'] }}</td>
     <td>Nucleotide</td>
     <td>{{ context_links['link_tblastn'] }}: Search translated nucleotide database using a protein query.</td>
   </tr>

+ 11 - 0
tripal_blast.info.yml

@@ -0,0 +1,11 @@
+name: 'Tripal BLAST (Basic Local Alignment Search Tool)'
+description: 'Provides a user interface to allow your users to utilize NCBI BLAST+ on your server'
+package: 'Tripal Extension'
+project: tripal_blast
+
+type: module
+core: 8.x
+configure: tripal_blast.configure
+
+dependencies:
+  - libraries:libraries

+ 44 - 0
tripal_blast.module

@@ -0,0 +1,44 @@
+<?php
+/**
+ * @file
+ * .module file of Tripal BLAST.
+ */
+
+use Drupal\Core\Url;
+
+/**
+ * Implements hook_theme().
+ * Used by Tripal BLAST UI page.
+ *
+ * @see templates in /templates
+ */
+function tripal_blast_theme($existing, $type, $theme, $path) {  
+  // Links rendered as a markup for the template file.
+  $context_links = [
+    // QUERY SEARCH TYPE:
+    // blast/nucleotide, blast/protein.
+    'link_nucleotide' => \Drupal::l(t('Nucleotide'), Url::fromRoute('tripal_blast.nucleotide')),
+    'link_protein'  => \Drupal::l(t('Protein'), Url::fromRoute('tripal_blast.protein')),
+    
+    // NUCLEOTIDE PROGRAM:
+    // blast/nucleotide/nucleotide, blast/nucleotide/protein.
+    'link_blastn' => \Drupal::l(t('blastn'), Url::fromRoute('tripal_blast.nucleotide_nucleotide')),
+    'link_blastx'   => \Drupal::l(t('blastx'), Url::fromRoute('tripal_blast.nucleotide_protein')),
+    
+    // PROTEIN PROGRAM:
+    // blast/protein/nucleotide, blast/protein/protein.
+    'link_tblastn'  => \Drupal::l(t('tblastn'), Url::fromRoute('tripal_blast.protein_nucleotide')),    
+    'link_blastp' => \Drupal::l(t('blastp'), Url::fromRoute('tripal_blast.protein_protein')),
+  ];
+
+  // Pass rendered links as variables and make available in the template file.
+  $variables = [
+    // TripalBLAST UI page.
+    'theme-tripal-blast-ui' => [
+      'variables' => ['context_links' => $context_links],
+      'template'  => 'template-tripal-blast-ui',
+    ],
+  ];
+
+  return $variables;
+}

+ 71 - 0
tripal_blast.routing.yml

@@ -0,0 +1,71 @@
+# @file
+# Tripal BLAST routes definition.
+
+
+# This route is for single all-in-one BLAST user interface.
+# Choices of query type, protein or nucleotide, outlined in this page.
+tripal_blast.blast_ui:
+  path: 'blast'
+  defaults:
+    _title: 'Tripal BLAST'
+    _controller: '\Drupal\tripal_blast\Controller\TripalBlastUI::content'
+  requirements:
+    _permission: 'administer tripal'
+
+
+# Routes below are for two main query types BLAST shown in the UI.
+
+# NUCLEOTIDE
+tripal_blast.nucleotide:
+  path: 'blast/nucleotide'
+  defaults:
+    _title: 'Tripal BLAST: Nucleotide Query'
+# @TODO  _form: '\Drupal\tripal_blast\Form\TripalBlast'
+  requirements:
+    _permission: 'administer tripal'
+
+# PROTEIN
+tripal_blast.protein:
+  path: 'blast/protein'
+  defaults:
+    _title: 'Tripal BLAST: Protein Query'
+# @TODO  _form: '\Drupal\tripal_blast\Form\TripalBlast'
+  requirements:
+    _permission: 'administer tripal'
+
+
+# Routes below are for BLAST programs.
+
+# 1. NUCLEOTIDE PROGRAM
+tripal_blast.nucleotide_nucleotide:
+  path: 'blast/nucleotide/nucleotide'
+  defaults:
+    _title: 'Tripal BLAST: BLASTn'
+# @TODO _form: '\Drupal\tripal_blast\Form\TripalBlast'
+  requirements:
+    _permission: 'administer tripal'
+
+tripal_blast.nucleotide_protein:
+  path: 'blast/nucleotide/protein'
+  defaults:
+    _title: 'Tripal BLAST: BLASTx'
+# @TODO _form: '\Drupal\tripal_blast\Form\TripalBlast'
+  requirements:
+    _permission: 'administer tripal'
+
+# 2. PROTEIN PROGRAM
+tripal_blast.protein_nucleotide:
+  path: 'blast/protein/nucleotide'
+  defaults:
+    _title: 'Tripal BLAST: tBLASTn'
+# @TODO _form: '\Drupal\tripal_blast\Form\TripalBlast'
+  requirements:
+    _permission: 'administer tripal'
+
+tripal_blast.protein_protein:
+  path: 'blast/protein/protein'
+  defaults:
+    _title: 'Tripal BLAST: BLASTp'
+# @TODO _form: '\Drupal\tripal_blast\Form\TripalBlast'
+  requirements:
+    _permission: 'administer tripal'