浏览代码

Merge branch '7.x-3.x' into 531-t3-relationship_widget

Lacey Sanderson 6 年之前
父节点
当前提交
5626d860ab
共有 59 个文件被更改,包括 569 次插入39 次删除
  1. 1 0
      docs/dev_guide.rst
  2. 二进制
      docs/dev_guide/exporting_field_settings.1.assign_term.png
  3. 二进制
      docs/dev_guide/exporting_field_settings.2.png
  4. 二进制
      docs/dev_guide/exporting_field_settings.3.png
  5. 二进制
      docs/dev_guide/exporting_field_settings.4.png
  6. 二进制
      docs/dev_guide/exporting_field_settings.5.png
  7. 二进制
      docs/dev_guide/exporting_field_settings.6.png
  8. 二进制
      docs/dev_guide/exporting_field_settings.7.png
  9. 121 0
      docs/dev_guide/exporting_field_settings.rst
  10. 1 1
      docs/user_guide.rst
  11. 2 1
      docs/user_guide/content_types.rst
  12. 3 1
      docs/user_guide/content_types/creating_content.rst
  13. 二进制
      docs/user_guide/content_types/field_permissions.1.cross_ref_GA.png
  14. 二进制
      docs/user_guide/content_types/field_permissions.2.crossref_permissions.png
  15. 56 0
      docs/user_guide/content_types/field_permissions.rst
  16. 1 0
      docs/user_guide/example_genomics.rst
  17. 14 0
      docs/user_guide/example_genomics/func_annots.rst
  18. 175 0
      docs/user_guide/example_genomics/func_annots/blast.rst
  19. 二进制
      docs/user_guide/example_genomics/func_annots/blast1.png
  20. 二进制
      docs/user_guide/example_genomics/func_annots/blast2.png
  21. 二进制
      docs/user_guide/example_genomics/func_annots/blast3.png
  22. 二进制
      docs/user_guide/example_genomics/func_annots/blast4.png
  23. 二进制
      docs/user_guide/example_genomics/func_annots/blast5.png
  24. 二进制
      docs/user_guide/example_genomics/func_annots/blast6.png
  25. 2 0
      docs/user_guide/example_genomics/func_annots/go.rst
  26. 80 0
      docs/user_guide/example_genomics/func_annots/interpro.rst
  27. 二进制
      docs/user_guide/example_genomics/func_annots/interpro1.png
  28. 二进制
      docs/user_guide/example_genomics/func_annots/interpro2.png
  29. 2 0
      docs/user_guide/example_genomics/func_annots/kegg.rst
  30. 73 0
      docs/user_guide/example_genomics/func_annots/setup.rst
  31. 二进制
      docs/user_guide/example_genomics/func_annots/setup1.png
  32. 二进制
      docs/user_guide/example_genomics/func_annots/setup2.png
  33. 1 1
      docs/user_guide/example_genomics/organisms.rst
  34. 二进制
      docs/user_guide/searching/default_pages.1.png
  35. 9 0
      docs/user_guide/searching/default_pages.rst
  36. 1 1
      legacy/tripal_analysis/tripal_analysis.info
  37. 1 1
      legacy/tripal_contact/tripal_contact.info
  38. 1 1
      legacy/tripal_core/tripal_core.info
  39. 1 1
      legacy/tripal_cv/tripal_cv.info
  40. 1 1
      legacy/tripal_db/tripal_db.info
  41. 1 1
      legacy/tripal_feature/tripal_feature.info
  42. 1 1
      legacy/tripal_featuremap/tripal_featuremap.info
  43. 1 1
      legacy/tripal_genetic/tripal_genetic.info
  44. 1 1
      legacy/tripal_library/tripal_library.info
  45. 1 1
      legacy/tripal_natural_diversity/tripal_natural_diversity.info
  46. 1 1
      legacy/tripal_organism/tripal_organism.info
  47. 1 1
      legacy/tripal_phenotype/tripal_phenotype.info
  48. 1 1
      legacy/tripal_phylogeny/tripal_phylogeny.info
  49. 1 1
      legacy/tripal_project/tripal_project.info
  50. 1 1
      legacy/tripal_pub/tripal_pub.info
  51. 1 1
      legacy/tripal_stock/tripal_stock.info
  52. 1 1
      legacy/tripal_views/tripal_views.info
  53. 4 1
      tripal/includes/TripalFieldQuery.inc
  54. 1 1
      tripal/tripal.info
  55. 1 1
      tripal_bulk_loader/tripal_bulk_loader.info
  56. 1 1
      tripal_chado/tripal_chado.info
  57. 1 1
      tripal_chado_views/tripal_chado_views.info
  58. 2 12
      tripal_chado_views/tripal_chado_views.module
  59. 1 1
      tripal_ds/tripal_ds.info

+ 1 - 0
docs/dev_guide.rst

@@ -12,6 +12,7 @@ Developer's Guide
    dev_guide/chado
    dev_guide/custom_modules
    dev_guide/custom_field
+   dev_guide/exporting_field_settings
    dev_guide/custom_data_loader
    dev_guide/custom_web_services
    dev_guide/tutorials

二进制
docs/dev_guide/exporting_field_settings.1.assign_term.png


二进制
docs/dev_guide/exporting_field_settings.2.png


二进制
docs/dev_guide/exporting_field_settings.3.png


二进制
docs/dev_guide/exporting_field_settings.4.png


二进制
docs/dev_guide/exporting_field_settings.5.png


二进制
docs/dev_guide/exporting_field_settings.6.png


二进制
docs/dev_guide/exporting_field_settings.7.png


+ 121 - 0
docs/dev_guide/exporting_field_settings.rst

@@ -0,0 +1,121 @@
+Exporting Field Settings With Drupal Features
+================================================
+
+This guide will demonstrate using the `Drupal Features <https://www.drupal.org/docs/7/modules/features>`_ to export and import Tripal Bundle Field settings.
+
+Why Drupal Features?
+---------------------
+
+Consider a case where we have a development site where we configure a bundle (let's say the vanilla Analysis bundle) to have a custom set of Tripal Panes, with fields carefully reorganized into the panes.  In particular, we attach a Drupal File field to it, so we can host FASTA files easily.
+
+Once we've configured the field settings, how do we get them to the live site?  One option is to open our field configuration admin UI on both sites, and copy the details one at a time.  This method is `time consuming and error prone <https://www.drupal.org/docs/7/modules/features/features-moving-site-configuration-to-code>`_, although it is relatively safe: we aren't liable to accidentally break our database this way.  Alternatively, trying to transfer via writing database exports is dangerous, and liable to accidentally break our site.
+
+Is there a better way?  By exporting the field configuration as a feature!
+
+.. note::
+
+  Drupal 8 has a `feature designed to handle development deployment <https://www.phase2technology.com/blog/drupal-8-configuration-management>`_: Configuration Management!  Drupal Features remains relevant for sharing field configurations across sites, so this guide may remain useful when Tripal moves to Drupal 8.
+
+.. warning::
+
+  Note that I'm going to talk about features a lot in this post.  **In the context of the Feature module, features are exported configurations within your site**.  It's important that we don't confuse this with Chado features, which are genes, mRNAs, polypeptides, etc.
+
+Version control
+~~~~~~~~~~~~~~~~
+
+Because features get exported as their own module, this means you can treat them as such.  You can initialize a git repo, store them on GitHub, make discrete versions, and in general benefit from version control for something which otherwise would only be done via the UI.
+
+How many Features?
+~~~~~~~~~~~~~~~~~~~
+
+The features documentation links to a great article about `how to manage multiple features <http://kerasai.com/blog/2014/04/08/organizing-features-configuration-managment>`_.  The suggestion that each bundle be its own module is particularly helpful for Tripal, since we have so many bundles and its a reasonable, discrete way to manage and deploy configuration.  This means that mRNA and gene should be separate feature modules even though they are both ``chado.feature`` content types.
+
+A Hazard: Mapping bundle IDs
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+The main hurdle to overcome when mapping features is converting the field machine names across site.  This is because each field instance is specific to the bundle it's attached to, and bundle machine-names are from the bundle ID.  We can't assume bundle IDs are consistent across sites!
+
+So what do we do?  Interestingly, roles have a similar problem, and a guide is `available <https://www.drupal.org/docs/7/modules/features/exportables-and-user-role-ids-in-features>`_ for dealing with them.
+
+The general strategy is:
+
+-   remove the exported id value from the ``features.inc`` file
+-   use hook alter to fetch the ID on the target deployment setup
+
+In our example below, the bundle ID's match on our site.  For default Tripal bundles, this should generally be the case.
+
+Drupal Features Tutorial
+-------------------------
+
+
+In this tutorial, we'll add a FASTA file field to the Analysis bundle, and export the configuration.
+
+Configuring the bundle fields
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+To begin, let's quickly configure a bundle.  Navigate to the structure of your site and select Analysis (**Admin ->Structure -> Tripal Content -> Analysis -> Manage Fields**).  Scroll to the bottom and add a new field of type File, with a machine name of ``field_fasta_file‎``, and click **Save**. Be sure to change the **Allowed extensions** parameter to accept ``.fasta``, otherwise, it will only allow `.txt` files to be uploaded.  You may also want to increase the file size limit, as the default 2MB can be too small for many FASTA files.
+
+We now have to pick a CV term for our field.  Because we are providing a FASTA file field, we can use a term such as FASTA `(SWO:0000142 <https://www.ebi.ac.uk/ols/ontologies/ero/terms?iri=http%3A%2F%2Fwww.ebi.ac.uk%2Fefo%2Fswo%2FSWO_0000142>`_.  Please see  :ref:`adding_a_cvterm` for help loading a term.  Once the term is in our DB, we can assign it to this field.
+
+
+.. image:: ./exporting_field_settings.1.assign_term.png
+
+
+Now lets configure our field display.  Click the **Manage Display Tab** at the top, and create and enable a "Files" Tripal Pane, placing our new field in the Pane.
+
+
+.. image:: ./exporting_field_settings.2.png
+
+
+You can verify your new field is enabled and working by creating a new Analysis and inspecting the "FASTA file" field.
+
+.. image:: ./exporting_field_settings.3.png
+
+
+Exporting the bundle field displays
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Once we are happy with our bundle field configuration, we can export the display settings using the Drupal Features module.
+
+First, we enable the Features module using drush: ``drush pm-enable features -y``.  This adds a Features area under **Admin -> Structure**.  Navigate there and choose **Create Feature**.
+
+The field information we're looking for is in **Field Bases**, **Field Group**, and **Field Instances**.  We can search for FASTA to find the field base and instance, and "files" (the name of our group) to find the field group.
+.. note::
+
+  Both **Field Bases** and **Field Instances** will contain the machine name of the field you want to export. **Field Bases** contains the site-wide information for a field and **Field Instances** contains the bundle-specific (i.e. Tripal Content Type) settings.
+
+  **Field Group** will contain the machine name of the Tripal Pane and allows you to export the grouping settings you set on the **Manage Display Tab**.
+I've also specified a custom path to keep all my Tripal features together under advanced options.
+
+
+.. image:: ./exporting_field_settings.4.png
+
+If we download and unzip our feature module, we can see it includes all the trappings of a Drupal module.
+
+.. image:: ./exporting_field_settings.5.png
+
+
+.. warning::
+
+	As you can see, it makes the assumption that ``bio_data_2``, the bundle ID for Analysis on our source site, is the correct bundle to configure fields for.  However, Tripal makes no guarantee that will hold true on our target site.  One solution would be to manually relabel ``bio_data_x`` to the correct bundle ID.  On a smaller scale, this is a reasonable solution.  If you aren't sure what your bundle ID is, look in the URL when configuring the fields for it:  my constructed URL for example was ``admin/structure/bio_data/manage/bio_data_2/fields``.
+
+  In our case, the site we want to import to has the same Analysis bundle ID, so no further action is necessary.
+
+
+Importing the feature configuration
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Go to our target site, all we need to do is download and unpack the ``.tar`` file we generated and enable the module (assuming the bundle ID issue is addressed).  I downloaded my file to ``/var/www/html/sites/all/modules/custom/analysis_configuration.tar``, decompressed it (``tar -xvf analysis_configuration.tar``), and enabled it (``drush pm-enable tripal_configuration``).
+
+The field should now appear when you go to create a new analysis on your target site.  To check for yourself, create a new Analysis with dummy information: you'll be able to upload a file for the new file field.
+
+Unfortunately, the field still gets imported **disabled** due to Tripal preference, so we have to go to the display settings on our target site and enable the tripal pane/field.
+
+
+.. image:: ./exporting_field_settings.6.png
+
+
+Drag the disabled Tripal pane/field group out of the disabled area, click save, and re-visit your newly created Analysis.  The files pane and uploaded FASTA file will now appear.
+
+.. image:: ./exporting_field_settings.7.png

+ 1 - 1
docs/user_guide.rst

@@ -10,9 +10,9 @@ User's Guide
    user_guide/what_is_tripal
    user_guide/install_tripal
    user_guide/drupal_overview
-   user_guide/example_genomics
    user_guide/learn_chado
    user_guide/content_types
+   user_guide/example_genomics
    user_guide/mviews
    user_guide/searching
    user_guide/job_management

+ 2 - 1
docs/user_guide/content_types.rst

@@ -11,4 +11,5 @@ New in Tripal v3 is the ability to create your own content types and manage thei
    ./content_types/creating_content
    ./content_types/setting_page_urls
    ./content_types/configuring_page_display
-   ./content_types/field_loading
+   ./content_types/field_loading
+   ./content_types/field_permissions

+ 3 - 1
docs/user_guide/content_types/creating_content.rst

@@ -29,7 +29,9 @@ How to Add a CV Term
 --------------------
 Loading From an OBO File
 ^^^^^^^^^^^^^^^^^^^^^^^^
-Once you've choosen a term to describe your content type, you may need to add the term to Tripal if it is not already present.  Many CVs use the `OBO file format <https://owlcollab.github.io/oboformat/doc/GO.format.obo-1_4.html>`_ to define their terms. If the term belongs to a controlled vocabulary with a file in OBO format then you can load all the terms of the vocabulary using Tripal's OBO Loader at **Tripal → Data Loaders → Chado Vocabularies → Chado OBO Loader**.
+Once you've chosen a term to describe your content type, you may need to add the term to Tripal if it is not already present.  Many CVs use the `OBO file format <https://owlcollab.github.io/oboformat/doc/GO.format.obo-1_4.html>`_ to define their terms. If the term belongs to a controlled vocabulary with a file in OBO format then you can load all the terms of the vocabulary using Tripal's OBO Loader at **Tripal → Data Loaders → Chado Vocabularies → Chado OBO Loader**.
+
+.. _adding_a_cvterm:
 
 Manually Adding a Term
 ^^^^^^^^^^^^^^^^^^^^^^

二进制
docs/user_guide/content_types/field_permissions.1.cross_ref_GA.png


二进制
docs/user_guide/content_types/field_permissions.2.crossref_permissions.png


+ 56 - 0
docs/user_guide/content_types/field_permissions.rst

@@ -0,0 +1,56 @@
+Field Specific Permissions
+===========================
+
+
+.. _why_field_permissions:
+
+Why Field Permissions?
+----------------------
+
+Not all Tripal Fields are created equal.  You may have some fields that you don't want all users to be able to view, or even to be able to edit. This might be the case for a variety of reasons.  Some Chado base tables may have **type** fields that you don't utilize: for example, the contact table.  Some of your content types may be configured with a lot of property fields, with only a subset of them being relevant to an end user.  Some fields require prior insertion of data elsewhere: for example, the Cross-Reference field.  Perhaps you have some Chado property fields that are for internal use only.
+
+.. note::
+
+	If you're following this guide because you want users to submit data into Chado, consider using Tripal HeadQuarters (HQ).  Tripal HQ provides a user-contributed content control center and administrative toolbox for your Tripal site. This means that users are able to create whatever Chado content you’d like them, but withhold inserting it into the database until someone has approved it.  Find out more here: https://tripal-hq.readthedocs.io/en/latest/index.html
+  
+
+
+Simply disabling the display of the formatter won't prevent the widget from showing up on the submission page, and besides, you might want site admins to still have access to those fields!  Deleting the field will cause them to re-appear when you press the "Check for New Fields" button!  Field Permissions allows you to configure field-specific permissions so that users contributing content via Chado only see the fields they need to see.
+
+Installing the Drupal Field Permissions module
+-----------------------------------------------
+
+The module can be enabled directly from Drush with the below command.
+
+.. code-block:: bash
+
+  drush pm-enable -y field_permissions
+
+
+You can find the Field Permission module page here: https://www.drupal.org/project/field_permissions and a more in-depth user guide here: https://www.drupal.org/node/2802067
+
+
+
+Setting Field-specific Permissions
+--------------------------------------------
+
+
+
+Let's assume I want to hide the Cross-Reference field from my users submitting Genome Assembly data, but still want it available for my administrators.
+
+.. image:: ./field_permissions.1.cross_ref_GA.png
+
+First, navigate to the content type field configuration page via **Admin --> Structure --> Tripal Content --> Genome Assembly**.  For each field we want to hide, we must configure the field instance settings individually.  Click **Edit** for the Cross Reference field, and scroll down to **CROSS REFERENCE FIELD SETTINGS**.
+Select **Custom Permissions** and ensure that the user role you set up for submitters can view, but cannot edit, this field.
+
+.. image:: ./field_permissions.2.crossref_permissions.png
+
+Once permissions are configured to your liking, click **Save Settings**.
+
+
+.. warning::
+
+  Some fields are **Required**.  Do not disable required fields that can't be null.  If you do, users won't be able to submit content!
+
+
+Now, if you submit content as a user with that role, the field will not display on the widgets, but will still appear on normal content.

+ 1 - 0
docs/user_guide/example_genomics.rst

@@ -14,3 +14,4 @@ The following tutorial will walk you through creating content and loading genomi
    ./example_genomics/controlled_vocabs
    ./example_genomics/genomes_genes
    ./example_genomics/pub_import
+   ./example_genomics/func_annots

+ 14 - 0
docs/user_guide/example_genomics/func_annots.rst

@@ -0,0 +1,14 @@
+Functional Annotations
+======================
+
+
+.. toctree::
+   :maxdepth: 1
+   :caption: Table of Contents
+   :glob:
+
+   func_annots/setup
+   func_annots/blast
+   func_annots/interpro
+   func_annots/kegg
+   func_annots/go

+ 175 - 0
docs/user_guide/example_genomics/func_annots/blast.rst

@@ -0,0 +1,175 @@
+Adding BLAST Results
+====================
+.. note::
+
+  Remember you must set the ``$DRUPAL_HOME`` environment variable if you want to cut-and-paste the commands below. See :doc:`../../install_tripal/drupal_home`
+
+
+Adding BLAST Databases
+----------------------
+
+Before we load our BLAST results we want to add some external databases.  For this tutorial we have protein BLAST results against NCBI nr and ExPASy SwissProt.  We would like the BLAST hits to be clickable such that they link back to their respective databases. To do this, we must add some additional databases.  Navigate to **Tripal → Data Loaders → Chado Databases** and click the link titled **Add a Database**. The resulting page provides fields for adding a new database.  Add two new databases, one for NCBI nr and the other for ExPASy SwissProt.
+
+Use these values for adding the NCBI nr database:
+
+.. csv-table::
+  :header: "Field Name", "Value"
+
+  "Name", "NCBI nr"
+  "Description", "NCBI's non-redundant protein database"
+  "URL", "http://www.ncbi.nlm.nih.gov/"
+  "URL Prefix", "http://www.ncbi.nlm.nih.gov/protein/"
+
+Use these values for adding the SwssProt database:
+
+.. csv-table::
+  :header: "Field Name", "Value"
+
+  "Name", "ExPASy Swiss-Prot"
+  "Description", "A curated protein sequence database which strives to provide a high level of annotation, a minimal level of redundancy and high level of integration with other databases"
+  "URL", "http://expasy.org/sprot/"
+  "URL prefix", "http://www.uniprot.org/uniprot/"
+
+
+Configure Parsing of BLAST Results
+----------------------------------
+First, we need to ensure that the BLAST module can properly parse the BLAST hits. To do this, navigate to **Tripal → Extensions → Tripal Blast Analyses**. On this page are configuration settings for the Tripal BLAST Analysis extension module.
+
+Within the section titled BLAST Parsing, you can specify a different, more meaningful name for the sequence library file (a.k.a. database) used for BLASTing. This name will be displayed with BLAST results. You can also provide regular expressions for parsing BLAST hits. For example, the following is a line for a match from SwissProt:
+
+  ::
+
+    sp|P43288|KSG1_ARATH Shaggy-related protein kinase alpha OS=Arabidopsis thaliana GN=ASK1 PE=2 SV=3
+
+
+Here the hit name is ``KSG1_ARATH``, the accession is ``P43288``, the hit description is ``Shaggy-related protein kinase alpha OS=Arabidopsis thaliana`` and the organism is ``Arabidopsis thaliana``. We need regular expressions to tell Tripal how to extract these unique parts from the match text. Because Tripal is a PHP application, the syntax for regular expressions follows the PHP method. Documentation for regular expressions used in PHP can be found here. The following regular expressions can be used to extract the hit name, the accession, hit description and organism for the example SwissProt line above:
+
+.. csv-table::
+  :header: "Element", "Regular Expression"
+
+  "Hit Name", ``^sp\|.*?\|(.*?)\s.*?$``
+  "Hit Description", ``^sp\|.*?\|.*?\s(.*)$``
+  "Hit Accession", ``^sp\|(.*?)\|.*?\s.*?$``
+  "Hit Organism", ``^.*?OS=(.*?)\s\w\w=.*$``
+
+In this tutorial, we will be adding BLAST results for the two databases we just created: ExPASy SwissProt and NCBI nr. First, select ExPASy SwissProt from the drop-down menu. A form will appear:
+
+.. image:: blast1.png
+
+In the form fields, add the following values:
+
+.. csv-table::
+  :header: "Field", "Value"
+
+  "Title for the BLAST analysis", "(leave blank)"
+  "Regular expression for Hit Name", ``^sp\|.*?\|(.*?)\s.*?$``
+  "Regular expression for Hit Description", ``^sp\|.*?\|.*?\s(.*)$``
+  "Regular expression for Hit Accession:", ``^sp\|(.*?)\|.*?\s.*?$``
+  "Regular expression for Organism", ``^.*?OS=(.*?)\s\w\w=.*$``
+  "Organism Name", "(leave blank)"
+
+Click **Save Settings**.
+
+The match accession will be used for building web links to the external database. The accession will be appended to the URL Prefix set earlier when the database record was first created.
+
+Now select the **NCBI nr** database from the drop-down. NCBI databases use a format that is compatible with BLAST. Therefore, the hit name, accession and description are handled differently in the BLAST XML results. To correctly parse results from an NCBI database click the **Use Genbank style parser** checkbox. This should disable all other fields and is all we need for this database.  Clikc the Save Settings button.
+
+Create the Analysis Page
+------------------------
+
+.. note::
+
+  It is always recommended to create an analysis page anytime you import data. The purpose of the analysis page is to describe how the data being added was derived or collected.
+
+Now we can create our analysis page. Navigate to **Content → Tripal Content** and click the **Add Tripal Content** link. This page contains a variety of content types that the site supports.  Scroll to the **Other** section and find the content type named **Blast Results**:
+
+.. image:: blast2.png
+
+Here we can save details about the analysis used to create the BLAST results.  Enter the following in the fields that appear on the page:
+
+.. csv-table::
+  :header: "Field", "Value"
+
+    "Name", "blastx Citrus sinensis v1.0 genes vs ExPASy SwissProt"
+    "Description", "Citrus sinensis mRNA sequences were BLAST'ed against the ExPASy SwissProt protein database using a local installation of BLAST on in-house linux server. Expectation value was set at 1e-6"
+    "BLAST Program", "blastx"
+    "BLAST Version", "2.2.25"
+    "Data Source Name ", "Citrus sinensis mRNA vs ExPASy SwissProt"
+    "Date Performed", "(today's date)"
+
+Click the **Save** button. You can now see our new BLAST analysis page.
+
+.. image:: blast3.png
+
+Create a second Analysis page for the results of the NCBI nr BLAST analysis. Use the following values:
+
+.. csv-table::
+  :header: "Field", "Value"
+
+    "Name", "blastx Citrus sinensis v1.0 genes vs NCBI nr"
+    "Description", "Citrus sinensis mRNA sequences were BLAST'ed against the NCBI non-redundant protein database using a local installation of BLAST on in-house linux server. Expectation value was set at 1e-6"
+    "BLAST Program", "blastx"
+    "BLAST Version", "2.2.25"
+    "Data Source Name ", "Citrus sinensis mRNA vs NCBI nr"
+    "Date Performed", "(today's date)"
+
+
+Import the BLAST XML results
+----------------------------
+First, we will load BLAST results for our citrus gene vs ExPASy SwissProt.  Now that we have our database records setup and configured and we have our analysis record created, we are ready to import the blast results.  To do this, navigate to **Tripal > Data Loaders > Chado BLAST XML results loader**.  The following page will be presented:
+
+.. image:: blast4.png
+
+The top section of this page provides multiple methods for providing results file: via an upload interface, specifying a remote URL or a file path that is local to the server.  Most likely, you will always upload or provide a remote URL.  However, we download the file earlier, and stored them here: ``$DRUPAL_HOME/sites/default/files``.  So, in this case we can use the path on the local server.  Provide the following value for this form:
+
+.. csv-table::
+  :header: "Field", "Value"
+
+  "Server path", "sites/default/files/Blastx_citrus_sinensis-orange1.1g015632m.g.fasta.0_vs_uniprot_sprot.fasta.out"
+  "Analysis", "blastx Citrus sinensis v1.0 genes vs ExPASy SwissProt (blastall 2.2.25, Citrus sinensis mRNA vs ExPASy SwissProt)"
+  "Database", "ExPASy SwissProt"
+  "BLAST XML File Extension", "out"
+  "Query Type", "mRNA"
+
+.. note::
+
+  For the **Server path** we need not give the full path.  Because we downloaded the files into the Drupal directory we can leave off any preceding path and Tripal will resolve the path.  Otherwise we could provide the full path.
+
+.. note::
+
+  Specifying **ExPASy SwissProt** as the database will allow the importer to use the database configuration settings we entered earlier.
+
+Clicking the **Import BLAST file** will add a job which we can manually execute with the following command:
+
+::
+
+  drush trp-run-jobs --username=administrator --root=$DRUPAL_HOME
+
+The results should now be loaded. Now we want to add the results for NCBI nr. Repeat the steps above to add a new analysis with the following details:
+
+.. csv-table::
+  :header: "Field", "Value"
+
+  "Server path", "sites/default/files/Blastx_citrus_sinensis-orange1.1g015632m.g.fasta.0_vs_nr.out"
+  "Analysis", "blastx Citrus sinensis v1.0 genes vs ExPASy SwissProt (blastall 2.2.25, Citrus sinensis mRNA vs NCBI nr)"
+  "Database", "ExPASy SwissProt"
+  "BLAST XML File Extension", "out"
+  "Query Type", "mRNA"
+
+Click the Save button and manually run the job:
+
+::
+
+  drush trp-run-jobs --username=administrator --root=$DRUPAL_HOME
+
+To view results we must find the mRNA that has BLAST hits.  For this example, click on the **mRNA Search** link in the **Data Search** block.  Search for the mRNA named `orange1.1g015615m`.  Viewing the page, we should now see BLAST results by clicking the 'BLAST results' link in the left table of contents.
+
+.. image:: blast5.png
+
+Notice, that when viewing the results, the SwissProt matches are links.  When clicked they redirect the user to the SwissProt website where users can find more information about that protein.
+
+.. image:: blast6.png
+
+.. note::
+
+  The match links are able to link out to SwissProt and NCBI because of the initial setup where we added the database settings and we set regular expressions for parsing the match accessions.

二进制
docs/user_guide/example_genomics/func_annots/blast1.png


二进制
docs/user_guide/example_genomics/func_annots/blast2.png


二进制
docs/user_guide/example_genomics/func_annots/blast3.png


二进制
docs/user_guide/example_genomics/func_annots/blast4.png


二进制
docs/user_guide/example_genomics/func_annots/blast5.png


二进制
docs/user_guide/example_genomics/func_annots/blast6.png


+ 2 - 0
docs/user_guide/example_genomics/func_annots/go.rst

@@ -0,0 +1,2 @@
+Managing Gene Ontology Annotations
+=================================

+ 80 - 0
docs/user_guide/example_genomics/func_annots/interpro.rst

@@ -0,0 +1,80 @@
+Adding InterProScan Results
+===========================
+
+.. note::
+
+  Remember you must set the ``$DRUPAL_HOME`` environment variable if you want to cut-and-paste the commands below. See :doc:`../../install_tripal/drupal_home`
+
+For this tutorial, these results were obtained by using a local installation of InterProScan installed on a computational cluster. However, you may choose to use Blast2GO or the online InterProScan utility. Results should be saved in ``XML`` format.
+
+
+What is InterProScan?
+---------------------
+To learn more about InterProScan, please visit https://www.ebi.ac.uk/interpro/
+
+
+Create the Analysis Page
+-------------------------
+
+  .. note::
+
+    It is always recommended to create an analysis page anytime you import data. The purpose of the analysis page is to describe how the data being added was derived or collected.
+
+Tripal defines the **InterPro Results** Bundle, which is a specific type of Chado analysis.  Create a new record by going to ``Content -> Tripal Content -> Add Tripal Content --> InterPro Results``.
+
+Fill out the fields as described in the table below.
+
+
+.. csv-table::
+  :header: "Field", "Value"
+
+  "Name", "InterPro Annotations of C. sinensis v1.0"
+  "InterPro Program", "InterProScan"
+  "InterPro Version", "4.8"
+  "Date Performed", "Current Date"
+  "Data Source Name", "C. sinensis v1.0 mRNA"
+  "Data Source Version", "v1.0"
+  "Data Source URI", "n/a"
+  "Description", "Materials & Methods: C. sinensis mRNA sequences were mapped to IPR domains and GO terms using a local installation of InterProScan executed on a computational cluster. InterProScan date files used were MATCH_DATA_v32, DATA_v32.0 and PTHR_DATA v31.0."
+
+Press the **Save** button.
+
+Import the InterProScan XML results
+------------------------------------
+
+
+Next, we will load InterProScan results for our citrus gene.  To do this, navigate to **Tripal > Data Loaders > Chado InterProScan XML results loader**.  The following page will be presented:
+
+.. image:: interpro1.png
+
+The top section of this page provides multiple methods for providing results file: via an upload interface, specifying a remote URL or a file path that is local to the server.  Most likely, you will always upload or provide a remote URL.  However, we downloaded the files earlier, and stored them here: ``$DRUPAL_HOME/sites/default/files``.  So, in this case we can use the path on the local server.  Provide the following value for this form:
+
+.. csv-table::
+  :header: "Field", "Value"
+
+  "Server path", "sites/default/files/Citrus_sinensis-orange1.1g015632m.g.iprscan.xml"
+  "Analysis", "InterPro Annotations of C. sinensis v1.0"
+  'Load GO terms to the database', 'unchecked'
+  "Query Name RE", ""
+  "Use Unique Name", "unchecked"
+  "Query Type", "mRNA"
+
+In order for GO terms to be imported, the Gene Ontology must be loaded on your site: for this tutorial, we leave the box unchecked.
+
+
+.. note::
+
+  For the **Server path** we need not give the full path.  Because we downloaded the files into the Drupal directory we can leave off any preceding path and Tripal will resolve the path.  Otherwise we could provide the full path.
+
+
+
+Clicking the **Import InterProScan file** will add a job which we can manually execute with the following command:
+
+::
+
+    drush trp-run-jobs --username=administrator --root=$DRUPAL_HOME
+
+
+After the job is run, our InterPro field will be populated on the mRNA page with an annotation diagram:
+
+.. image:: interpro2.png

二进制
docs/user_guide/example_genomics/func_annots/interpro1.png


二进制
docs/user_guide/example_genomics/func_annots/interpro2.png


+ 2 - 0
docs/user_guide/example_genomics/func_annots/kegg.rst

@@ -0,0 +1,2 @@
+Adding KEGG Results
+===================

+ 73 - 0
docs/user_guide/example_genomics/func_annots/setup.rst

@@ -0,0 +1,73 @@
+Module Setup
+============
+.. note::
+
+  Remember you must set the ``$DRUPAL_HOME`` environment variable if you want to cut-and-paste the commands below. See :doc:`../../install_tripal/drupal_home`
+  
+  
+For this example we will be load functional data for our gene. To do this we will use the Blast, KEGG, and InterPro extension modules. However, these extension modules are not part of the "core" Tripal package but are available as separate extensions.  Anyone may create extensions for Tripal.  These extensions are useful for genomic data and therefore are included in this tutorial. 
+
+To download these modules:
+
+  ::
+  
+    cd $DRUPAL_HOME    
+    drush pm-download tripal_analysis_blast
+    drush pm-download tripal_analysis_kegg
+    drush pm-download tripal_analysis_interpro
+
+Now, enable these extension modules:
+
+  ::
+  
+    drush pm-enable tripal_analysis_blast
+    drush pm-enable tripal_analysis_interpro
+    drush pm-enable tripal_analysis_kegg
+
+For this example, we will use the following files which are available for downloading:
+
+- `Citrus_sinensis-orange1.1g015632m.g.iprscan.xml <http://www.gmod.org/mediawiki/images/0/0c/Citrus_sinensis-orange1.1g015632m.g.iprscan.xml>`_
+- `Citrus_sinensis-orange1.1g015632m.g.KEGG.heir.tar.gz <http://www.gmod.org/mediawiki/images/1/13/Citrus_sinensis-orange1.1g015632m.g.KEGG.heir.tar.gz>`_
+- `Blastx_citrus_sinensis-orange1.1g015632m.g.fasta.0_vs_uniprot_sprot.fasta.out <http://www.gmod.org/mediawiki/images/e/e8/Blastx_citrus_sinensis-orange1.1g015632m.g.fasta.0_vs_uniprot_sprot.fasta.out>`_
+- `Blastx_citrus_sinensis-orange1.1g015632m.g.fasta.0_vs_nr.out <http://www.gmod.org/mediawiki/images/2/24/Blastx_citrus_sinensis-orange1.1g015632m.g.fasta.0_vs_nr.out>`_
+
+Download these files to the ```$DRUPAL_HOME/sites/default/files``` directory. To do so quickly run these commands:
+
+  ::
+  
+    cd $DRUPAL_HOME/sites/default/files
+    wget http://www.gmod.org/mediawiki/images/0/0c/Citrus_sinensis-orange1.1g015632m.g.iprscan.xml
+    wget http://www.gmod.org/mediawiki/images/1/13/Citrus_sinensis-orange1.1g015632m.g.KEGG.heir.tar.gz
+    wget http://www.gmod.org/mediawiki/images/e/e8/Blastx_citrus_sinensis-orange1.1g015632m.g.fasta.0_vs_uniprot_sprot.fasta.out
+    wget http://www.gmod.org/mediawiki/images/2/24/Blastx_citrus_sinensis-orange1.1g015632m.g.fasta.0_vs_nr.out
+
+Each of these modules provides new fields for both the **gene** and **mRNA** content types.  To add these new field to those content types, navigate to **Structure > Tripal Content Types** and click the **manage fields** link in the row for the **mRNA** content type.  Click the link titled **Check for new fields**.  After a few moments the page will refresh and you will be notified that new fields have been added.
+
+.. image:: setup1.png
+
+Next, we need to position the new field. Using the skills you learned in the :doc:`../../content_types/configuring_page_display` Create three new **Tripal Panes** named:
+
+- Blast Results
+- Protein Domains
+- KEGG Pathways
+
+Be sure to:
+
+- Place the three new fields into each pane respectively 
+- Move the Panes out of the **disabled** section. 
+- Set the label for each field to **Hidden**.
+
+The following shows an example of this layout:
+
+.. image:: setup2.png
+
+The fields are now ready for display once data is added!  
+
+.. note::
+
+   If you want both the **Gene** and **mRNA** content type to have BLAST, InterPro and KEGG result fields you must repeat the steps above for both.
+
+.. note::
+
+  Anytime you install a Tripal v3 extension module you should check for new fields, and then place those fields in the layout.  Extension modules often will not do this for you because they do not assume you want these new fields.
+  

二进制
docs/user_guide/example_genomics/func_annots/setup1.png


二进制
docs/user_guide/example_genomics/func_annots/setup2.png


+ 1 - 1
docs/user_guide/example_genomics/organisms.rst

@@ -48,7 +48,7 @@ Click the checbox beside the 'Import taxonomy for existing species' and click Su
 
 ::
 
-  drush trp-run-jobs --username=administrator --root=/var/www/html
+  drush trp-run-jobs --username=administrator --root=$DRUPAL_HOME
 
 You will see the following output:
 

二进制
docs/user_guide/searching/default_pages.1.png


+ 9 - 0
docs/user_guide/searching/default_pages.rst

@@ -3,3 +3,12 @@ Tripal Content-Specific Search Tools
 
 
 By default, Tripal will provide a search tool for every Tripal content type.  When a new content type is created, a new search tool is automatically created for that tool.
+
+These search tools will be available at ``/data_search/[content label]``, such as ``/data_search/mrna``.
+
+If you have the ``view_ui`` module enabled, you can find a list of all search views under **Structure --> Views**.
+
+.. figure:: ./default_pages.1.png
+  :alt: An example mRNA search
+
+  An example search with the default mRNA content type.  Results are sortable by clicking the column name.

+ 1 - 1
legacy/tripal_analysis/tripal_analysis.info

@@ -3,7 +3,7 @@ description = Supports the companalyses tables of Chado by providing pages for v
 core = 7.x
 project = tripal
 package = Tripal v2 Legacy
-version = 7.x-3.0-rc2
+version = 7.x-3.0
 configure = admin/tripal/legacy/tripal_analysis/configuration
 
 dependencies[] = tripal_core

+ 1 - 1
legacy/tripal_contact/tripal_contact.info

@@ -3,7 +3,7 @@ description = Supports the contact tables of Chado by providing pages for viewin
 core = 7.x
 project = tripal
 package = Tripal v2 Legacy
-version = 7.x-3.0-rc2
+version = 7.x-3.0
 
 dependencies[] = tripal_core
 dependencies[] = tripal_chado_views

+ 1 - 1
legacy/tripal_core/tripal_core.info

@@ -3,7 +3,7 @@ description = Provides support for all Tripal modules and includes the Tripal AP
 core = 7.x
 project = tripal
 package = Tripal v2 Legacy
-version = 7.x-3.0-rc2
+version = 7.x-3.0
 configure = admin/tripal
 
 stylesheets[all][] = theme/css/tripal_core.css

+ 1 - 1
legacy/tripal_cv/tripal_cv.info

@@ -3,7 +3,7 @@ description = Supports the Controlled Vocabulary (CV) tables of Chado by providi
 core = 7.x
 project = tripal
 package = Tripal v2 Legacy
-version = 7.x-3.0-rc2
+version = 7.x-3.0
 configure = admin/tripal/vocab
 
 dependencies[] = tripal_core

+ 1 - 1
legacy/tripal_db/tripal_db.info

@@ -3,7 +3,7 @@ description = Supports the database cross-reference tables of Chado by providing
 core = 7.x
 project = tripal
 package = Tripal v2 Legacy
-version = 7.x-3.0-rc2
+version = 7.x-3.0
 configure = admin/tripal/legacy/tripal_db
 
 dependencies[] = tripal_core

+ 1 - 1
legacy/tripal_feature/tripal_feature.info

@@ -3,7 +3,7 @@ description = Supports the sequence (feature) tables of Chado by providing pages
 core = 7.x
 project = tripal
 package = Tripal v2 Legacy
-version = 7.x-3.0-rc2
+version = 7.x-3.0
 
 stylesheets[all][] = theme/css/tripal_feature.css
 scripts[]          = theme/js/tripal_feature.js

+ 1 - 1
legacy/tripal_featuremap/tripal_featuremap.info

@@ -3,7 +3,7 @@ description = Supports the map tables of Chado by providing pages for viewing an
 core = 7.x
 project = tripal
 package = Tripal v2 Legacy
-version = 7.x-3.0-rc2
+version = 7.x-3.0
 
 dependencies[] = tripal_core
 dependencies[] = tripal_chado_views

+ 1 - 1
legacy/tripal_genetic/tripal_genetic.info

@@ -3,7 +3,7 @@ description = Supports the genetic tables of Chado by providing pages for viewin
 core = 7.x
 project = tripal
 package = Tripal v2 Legacy
-version = 7.x-3.0-rc2
+version = 7.x-3.0
 
 dependencies[] = tripal_core
 dependencies[] = tripal_chado_views

+ 1 - 1
legacy/tripal_library/tripal_library.info

@@ -3,7 +3,7 @@ description = Supports the library tables of Chado by providing pages for viewin
 core = 7.x
 project = tripal
 package = Tripal v2 Legacy
-version = 7.x-3.0-rc2
+version = 7.x-3.0
 
 dependencies[] = tripal_core
 dependencies[] = tripal_chado_views

+ 1 - 1
legacy/tripal_natural_diversity/tripal_natural_diversity.info

@@ -3,7 +3,7 @@ description = Supports the natural diversity (ND) tables of Chado by providing p
 core = 7.x
 project = tripal
 package = Tripal v2 Legacy
-version = 7.x-3.0-rc2
+version = 7.x-3.0
 
 dependencies[] = tripal_core
 dependencies[] = tripal_chado_views

+ 1 - 1
legacy/tripal_organism/tripal_organism.info

@@ -3,7 +3,7 @@ description = Supports the organism tables of Chado by providing pages for viewi
 core = 7.x
 project = tripal
 package = Tripal v2 Legacy
-version = 7.x-3.0-rc2
+version = 7.x-3.0
 configure = admin/tripal/legacy/tripal_organism
 
 stylesheets[all][] = theme/css/tripal_organism.css

+ 1 - 1
legacy/tripal_phenotype/tripal_phenotype.info

@@ -3,7 +3,7 @@ description = Supports the phenotype tables of Chado by providing pages for view
 core = 7.x
 project = tripal
 package = Tripal v2 Legacy
-version = 7.x-3.0-rc2
+version = 7.x-3.0
 
 dependencies[] = tripal_core
 dependencies[] = tripal_chado_views

+ 1 - 1
legacy/tripal_phylogeny/tripal_phylogeny.info

@@ -3,7 +3,7 @@ description = Supports the phylogeny tables of Chado by providing pages for view
 core = 7.x
 project = tripal_phylogeny
 package = Tripal v2 Legacy
-version = 7.x-3.0-rc2
+version = 7.x-3.0
 dependencies[] = tripal_core
 dependencies[] = tripal_cv
 dependencies[] = tripal_db

+ 1 - 1
legacy/tripal_project/tripal_project.info

@@ -3,7 +3,7 @@ description = Supports the project tables of Chado by providing pages for viewin
 core = 7.x
 project = tripal
 package = Tripal v2 Legacy
-version = 7.x-3.0-rc2
+version = 7.x-3.0
 configure = admin/tripal/legacy/tripal_project
 
 dependencies[] = tripal_core

+ 1 - 1
legacy/tripal_pub/tripal_pub.info

@@ -3,7 +3,7 @@ description = Supports the pub (publication) tables of Chado by providing pages
 core = 7.x
 project = tripal
 package = Tripal v2 Legacy
-version = 7.x-3.0-rc2
+version = 7.x-3.0
 
 stylesheets[all][] = theme/css/tripal_pub.css
 

+ 1 - 1
legacy/tripal_stock/tripal_stock.info

@@ -3,7 +3,7 @@ description = Supports the stock tables of Chado by providing pages for viewing,
 core = 7.x
 project = tripal
 package = Tripal v2 Legacy
-version = 7.x-3.0-rc2
+version = 7.x-3.0
 
 dependencies[] = tripal_core
 dependencies[] = tripal_chado_views

+ 1 - 1
legacy/tripal_views/tripal_views.info

@@ -3,4 +3,4 @@ description = Deprecated-- no longer provides any functionality. See Tripal Chad
 core = 7.x
 project = tripal
 package = Tripal v2 Legacy
-version = 7.x-3.0-rc2
+version = 7.x-3.0

+ 4 - 1
tripal/includes/TripalFieldQuery.inc

@@ -124,7 +124,10 @@ class TripalFieldQuery extends EntityFieldQuery {
       if (is_numeric($results)) {
         return $results;
       }
-      return count($results['TripalEntity']);
+      if (array_key_exists('TripalEntity', $results)) {
+        return count($results['TripalEntity']);
+      }
+      return 0;
     }
     return $results;
   }

+ 1 - 1
tripal/tripal.info

@@ -3,7 +3,7 @@ description = Tripal is an toolkit to facilitate construction of online genomic,
 core = 7.x
 project = tripal
 package = Tripal
-version = 7.x-3.0-rc2
+version = 7.x-3.0
 configure = admin/tripal
 
 stylesheets[all][] = theme/css/tripal.css

+ 1 - 1
tripal_bulk_loader/tripal_bulk_loader.info

@@ -3,6 +3,6 @@ description = Supports the construction of templates for customizable uploading
 core = 7.x
 project = tripal
 package = Tripal
-version = 7.x-3.0-rc2
+version = 7.x-3.0
 
 dependencies[] = tripal_chado_views

+ 1 - 1
tripal_chado/tripal_chado.info

@@ -3,7 +3,7 @@ description = Provides a set of Chado-based fields for the Tripal Entities.
 core = 7.x
 project = tripal
 package = Tripal
-version = 7.x-3.0-rc2
+version = 7.x-3.0
 
 files[] = views_handlers/chado_views_handler_field.inc
 files[] = views_handlers/chado_views_handler_filter.inc

+ 1 - 1
tripal_chado_views/tripal_chado_views.info

@@ -3,7 +3,7 @@ description = Integrates all Chado tables with Drupal Views and provides basic s
 core = 7.x
 project = tripal
 package = Tripal
-version = 7.x-3.0-rc2
+version = 7.x-3.0
 configure = admin/tripal/storage/chado/views-integration
 
 files[] = views/handlers/tripal_views_handler_filter_textarea.inc

+ 2 - 12
tripal_chado_views/tripal_chado_views.module

@@ -82,7 +82,7 @@ function tripal_chado_views_menu() {
   $items['admin/tripal/storage/chado/views-integration/delete/%'] = array(
     'title' => 'Delete Views Integration',
     'page callback' => 'tripal_chado_views_integration_delete',
-    'page arguments' => array(4),
+    'page arguments' => array(6),
     'access arguments' => array('manage tripal_views_integration'),
     'type' => MENU_CALLBACK,
   );
@@ -105,21 +105,11 @@ function tripal_chado_views_menu() {
     'weight' => 2,
   );
 
-  $items['admin/tripal/storage/chado/views-integration/export'] = array(
-    'title' => 'Export Views Integration',
-    'description' => 'Export a Chado Views Integration for use in another Tripal site',
-    'page callback' => 'drupal_get_form',
-    'page arguments' => array('tripal_chado_views_integration_export_form', 4),
-    'access arguments' => array('manage tripal_views_integration'),
-    'type' => MENU_CALLBACK,
-    'weight' => 3,
-  );
-
   $items['admin/tripal/storage/chado/views-integration/export/%'] = array(
     'title' => 'Export Views Integration',
     'description' => 'Export a Chado Views Integration for use in another Tripal site',
     'page callback' => 'drupal_get_form',
-    'page arguments' => array('tripal_chado_views_integration_export_form', 4),
+    'page arguments' => array('tripal_chado_views_integration_export_form', 6),
     'access arguments' => array('manage tripal_views_integration'),
     'type' => MENU_CALLBACK,
   );

+ 1 - 1
tripal_ds/tripal_ds.info

@@ -3,7 +3,7 @@ description = Provides display options for Tripal Entities through extending Dis
 core = 7.x
 project = tripal
 package = Tripal
-version = 7.x-3.0-rc2
+version = 7.x-3.0
 
 stylesheets[all][] = theme/css/tripal_ds.css