Skip to content

Commit

Permalink
Merge pull request #1163 from tripal/tv3.5-pre-release-fixes
Browse files Browse the repository at this point in the history
Documentation and Minor Fix Pre v3.5 Release
  • Loading branch information
laceysanderson committed Feb 1, 2021
2 parents d7f6d95 + 779f3fb commit 6ba91c7
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 40 deletions.
28 changes: 11 additions & 17 deletions docs/user_guide/example_genomics/func_annots/setup.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,65 +3,60 @@ 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.


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

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:
Next, we need to position the new field. Using the skills you learned in the :doc:`../../content_types/configuring_page_display` Create two 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.
- Place the 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!
The fields are now ready for display once data is added!

.. note::

Expand All @@ -70,4 +65,3 @@ The fields are now ready for display once data is added!
.. 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.

Binary file modified docs/user_guide/example_genomics/func_annots/setup2.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/user_guide/example_genomics/genomes_genes.1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/user_guide/example_genomics/genomes_genes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Enter the following:

"File", "Upload the file name Citrus_sinensis-orange1.1g015632m.g.gff3"
"Analysis", "Whole Genome Assembly and Annotation of Citrus sinensis"
"Organism", "Citrus sinensis"
"Existing Organism", "Citrus sinensis"
"Landmark Type", "supercontig"
"All other options", "leave as default"

Expand Down
17 changes: 8 additions & 9 deletions docs/user_guide/example_genomics/pub_import.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Importing Publications
.. 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`

Tripal provides an interface for automatically and manually adding publications.

Manually Adding a Publication
Expand Down Expand Up @@ -64,7 +64,7 @@ Now, save this importer. You should see that we have one importer in the list:

.. image:: pub_import.4.png

We can use this importer to load all publications related to Citrus sinensis from PubMed into our database (how to load these will be shown later). However, what if new publications are added? We would like this importer to be run monthly so that we can automatically add new publications as they become available. But we do not need to try to reload these 760 every time the loader runs each month. We will create a new importer that only finds publications within the last 30 days. To do this, click the link New Importer. Now, add the following criteria:
We can use this importer to load all publications related to <i>Citrus sinensis</i> from PubMed into our database (how to load these will be shown later). However, what if new publications are added? We would like this importer to be run monthly so that we can automatically add new publications as they become available. But we do not need to try to reload the same publications every time the loader runs each month. We will create a new importer that only finds publications within the last 30 days. To do this, click the link New Importer. Now, add the following criteria:

.. csv-table::
:header: "Field Name", "Value"
Expand Down Expand Up @@ -142,25 +142,25 @@ Import from the USDA National Agricultural Library
The instructions for the Tripal publication importer described previously use the the NCBI PubMed database. However, you can also import publications from the USDA National Agriculture Library (AGRICOLA). However, to use this repository a few software dependences are required. These include:

- The `YAZ library <https://www.indexdata.com/resources/software/yaz/>`_
- `PHP support for YAZ <https://www.php.net/manual/en/book.yaz.php>`_
- `PHP support for YAZ <https://www.php.net/manual/en/book.yaz.php>`_

The following instructions are to install the necessary dependencies on an Ubuntu 18.04 LTS.
The following instructions are to install the necessary dependencies on an Ubuntu 18.04 LTS.

First install yaz, the yaz development library and the php development library:

.. code-block:: bash
sudo apt-get install yaz libyaz5-dev php-dev
Next update the PECL tool and install the PHP yaz library:


.. code-block:: bash
sudo pecl channel-update pecl.php.net
sudo pecl install yaz
Next, edit the `php.ini` files. On Ubuntu 18.04 there are two PHP files:

- `/etc/php/7.2/cli/php.ini`
Expand All @@ -175,8 +175,7 @@ Add the following line to each file:
Finally, restart the web server so that it picks up the changes to the `php.ini` file.

.. code-block:: bash
sudo service apache2 restart
You can now import publications from Agricola using the same interface as with PubMed.

2 changes: 1 addition & 1 deletion tripal/includes/tripal.importer.inc
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ function tripal_get_importer_form($form, &$form_state, $class) {
$analyses = [];
$analyses[''] = '';
while ($analysis = $org_rset->fetchObject()) {
$analyses[$analysis->analysis_id] = "$analysis->name ($analysis->program $analysis->programversion, $analysis->sourcename)";
$analyses[$analysis->analysis_id] = $analysis->name;
}
$form['analysis_id'] = [
'#title' => t('Analysis'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,12 @@ class chado_linker__prop_widget extends ChadoFieldWidget {
$value = $form_state['values'][$field_name]['und'][$delta]['chado-' . $field_table . '__value'];
$form_state['values'][$field_name]['und'][$delta]['value'] = $value;

// A value of zero gets set to empty when sbumitted and some prop
// tables don't have a default value set (e.g. pubprop).
if (!$form_state['values'][$field_name]['und'][$delta]['chado-' . $field_table . '__rank']) {
$form_state['values'][$field_name]['und'][$delta]['chado-' . $field_table . '__rank'] = 0;
}

// If the user removed the property then we want to clear out the other
// fields except the pkey value. If the pkey field is present and the value
// is present then the chado storage backend will delete the record.
Expand Down
23 changes: 11 additions & 12 deletions tripal_chado/includes/TripalImporter/GFF3Importer.inc
Original file line number Diff line number Diff line change
Expand Up @@ -306,17 +306,6 @@ class GFF3Importer extends TripalImporter {
'#required' => TRUE,
'#options' => $organisms,
];
$form['create_organism'] = [
'#type' => 'checkbox',
'#title' => t('Create organism'),
'#required' => FALSE,
'#description' => t('The Tripal GFF loader supports the "organism" attribute. This allows features of a
different organism to be aligned to the landmark sequence. The format of the
attribute is "organism=[genus]:[species]", where [genus] is the organism\'s genus and [species] is the
species name. Check this box to automatically add the organism to the database if it does not already exists.
Otherwise lines with an organism attribute where the organism is not present in the database will be skipped.'),
];

$form['landmark_type'] = [
'#title' => t('Landmark Type'),
'#type' => 'textfield',
Expand All @@ -325,6 +314,7 @@ class GFF3Importer extends TripalImporter {
the landmark features (first column of the GFF3 file) are not already in the database.."),
];


$form['proteins'] = [
'#type' => 'fieldset',
'#title' => t('Proteins'),
Expand Down Expand Up @@ -410,7 +400,16 @@ class GFF3Importer extends TripalImporter {
'#collapsible' => TRUE,
'#collapsed' => FALSE,
];

$form['advanced']['create_organism'] = [
'#type' => 'checkbox',
'#title' => t('Create organism'),
'#required' => FALSE,
'#description' => t('The Tripal GFF loader supports the "organism" attribute. This allows features of a
different organism to be aligned to the landmark sequence. The format of the
attribute is "organism=[genus]:[species]", where [genus] is the organism\'s genus and [species] is the
species name. Check this box to automatically add the organism to the database if it does not already exists.
Otherwise lines with an organism attribute where the organism is not present in the database will be skipped.'),
];

$form['advanced']['line_number'] = [
'#type' => 'textfield',
Expand Down

0 comments on commit 6ba91c7

Please sign in to comment.