Skip to content

Commit

Permalink
Merge pull request #1 from galaxy-genome-annotation/3.0
Browse files Browse the repository at this point in the history
python-tripal 3.0
  • Loading branch information
abretaud authored Apr 17, 2018
2 parents 2856e59 + fa88937 commit 150d610
Show file tree
Hide file tree
Showing 113 changed files with 376,451 additions and 678 deletions.
10 changes: 5 additions & 5 deletions .command-engine.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ module:
base_module: tripal
instance_cls: "<class 'tripal.TripalInstance'>"
instance_func: TripalInstance
instance_args: []
instance_kwargs:
tripal_url: "http://localhost/tripal/"
username: "admin"
password: "changeme"
instance_args:
- "http://localhost:8500/tripal/"
- "admin"
- "changeme"

ignore:
top_attrs:
Expand All @@ -17,6 +16,7 @@ module:
- 'password'
- 'auth_login'
- 'auth_password'
- 'version'
funcs:
- get
- post
Expand Down
102 changes: 86 additions & 16 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,88 @@
sudo: required
language: python

services:
- docker

python:
- '2.7'
- '3.5'
script:
- pip install -U pip setuptools
- pip install -U flake8
- flake8 tripal --ignore=E501 --exclude=scripts/
- python setup.py install
deploy:
provider: pypi
user: abretaud
password:
secure: ozrSUU6Jbh0n+nh0UX5EpzWZdlOfMGC5I4SaCS7C0v2At/x/YZ32fW0N2+p2eJwyx6yfv8jELihjCZf7tagTrsUYqKwYxbWwLVNRT0m+SJgt160EkLK7cYJrSv1PdBDjcmqEDGG7J/6h+qRLM3jVo6YgKNL3AWE0YIgqfOOMF0Anl6A4+cfqXJUlfDienxdbfPGjLeAmzqeZ59rUoAyVFZRW2YokLM9DwLA+0kipqLlmZHOiFXJ9SJ0YMqyaswOeRplUmpGUqTnjQ0IuPQyWx0coxTQ8DdivpDLAANNOgQgBA9zcy/+UuJDeMy4lBEpEk1mCSKVrU3zODzzbF48J7llDV412PbFueyrCx7D6NLsdKC+I/IhI+Rf67A8fY3/siz/OMThErL89qJp8W67s18zhXKcG7+GeiypMoNCK7gWef5CfgV6Zsh4nV31yIZjXg0/RTQzf2rmmI36NkbVKAN+TYmH6VJWs6x5SFklmKPt70lypwfSEao5f+kEJz2XwOf2judkZwcOU67vyptz0sG/Z+QxlKOEogbRy13eV4qgqSyZEa1c8nAaIS80pPKbXU/MYWBRSaYY8FtYiITemDGlcO0fyny0F4XRQDrN6cAr7zus7GtHbsZNXwsN9g4imq8Th7b8L6G+xwFbo8jtvjuo07Ef7J8Hf3lUEzXoxQw0=
on:
tags: true
distributions: sdist bdist_wheel
repo: galaxy-genome-annotation/python-tripal
- '2.7'

jobs:
include:
- stage: lint
install:
- pip install -U flake8 flake8-import-order
script:
- flake8 tripal test --ignore=E501 --exclude=scripts/
- stage: test # Python 2.7 + tripal 2
env: TRIPAL_VERSION=2
python: '2.7'
install:
- pip install -U pip setuptools nose chado
- python setup.py install
- export TRIPAILLE_GLOBAL_CONFIG_PATH=`pwd`/test-data/tripal_v$TRIPAL_VERSION/tripaille.yml
- export CHAKIN_GLOBAL_CONFIG_PATH=`pwd`/test-data/tripal_v$TRIPAL_VERSION/chakin.yml
- sudo service postgresql stop
- cd test-data/tripal_v$TRIPAL_VERSION/
- docker-compose up -d
- cd ../../
- sleep 300 # Wait for the containers to be ready
script:
- python setup.py nosetests --tests test.tripal_v$TRIPAL_VERSION
- stage: test # Python 3.5 + tripal 2
env: TRIPAL_VERSION=2
python: '3.5'
install:
- pip install -U pip setuptools nose chado
- python setup.py install
- export TRIPAILLE_GLOBAL_CONFIG_PATH=`pwd`/test-data/tripal_v$TRIPAL_VERSION/tripaille.yml
- export CHAKIN_GLOBAL_CONFIG_PATH=`pwd`/test-data/tripal_v$TRIPAL_VERSION/chakin.yml
- sudo service postgresql stop
- cd test-data/tripal_v$TRIPAL_VERSION/
- docker-compose up -d
- cd ../../
- sleep 300 # Wait for the container to be ready
script:
- python setup.py nosetests --tests test.tripal_v$TRIPAL_VERSION
- stage: test # Python 2.7 + tripal 3
env: TRIPAL_VERSION=3
python: '2.7'
install:
- pip install -U pip setuptools nose chado
- python setup.py install
- export TRIPAILLE_GLOBAL_CONFIG_PATH=`pwd`/test-data/tripal_v$TRIPAL_VERSION/tripaille.yml
- export CHAKIN_GLOBAL_CONFIG_PATH=`pwd`/test-data/tripal_v$TRIPAL_VERSION/chakin.yml
- sudo service postgresql stop
- cd test-data/tripal_v$TRIPAL_VERSION/
- docker-compose up -d
- cd ../../
- sleep 300 # Wait for the containers to be ready
script:
- python setup.py nosetests --tests test.tripal_v$TRIPAL_VERSION
- stage: test # Python 3.5 + tripal 3
env: TRIPAL_VERSION=3
python: '3.5'
install:
- pip install -U pip setuptools nose chado
- python setup.py install
- export TRIPAILLE_GLOBAL_CONFIG_PATH=`pwd`/test-data/tripal_v$TRIPAL_VERSION/tripaille.yml
- export CHAKIN_GLOBAL_CONFIG_PATH=`pwd`/test-data/tripal_v$TRIPAL_VERSION/chakin.yml
- sudo service postgresql stop
- cd test-data/tripal_v$TRIPAL_VERSION/
- docker-compose up -d
- cd ../../
- sleep 300 # Wait for the container to be ready
script:
- python setup.py nosetests --tests test.tripal_v$TRIPAL_VERSION
- stage: deploy
install: skip
script: echo "Deploying to Pypi"
deploy:
provider: pypi
user: abretaud
password:
secure: ozrSUU6Jbh0n+nh0UX5EpzWZdlOfMGC5I4SaCS7C0v2At/x/YZ32fW0N2+p2eJwyx6yfv8jELihjCZf7tagTrsUYqKwYxbWwLVNRT0m+SJgt160EkLK7cYJrSv1PdBDjcmqEDGG7J/6h+qRLM3jVo6YgKNL3AWE0YIgqfOOMF0Anl6A4+cfqXJUlfDienxdbfPGjLeAmzqeZ59rUoAyVFZRW2YokLM9DwLA+0kipqLlmZHOiFXJ9SJ0YMqyaswOeRplUmpGUqTnjQ0IuPQyWx0coxTQ8DdivpDLAANNOgQgBA9zcy/+UuJDeMy4lBEpEk1mCSKVrU3zODzzbF48J7llDV412PbFueyrCx7D6NLsdKC+I/IhI+Rf67A8fY3/siz/OMThErL89qJp8W67s18zhXKcG7+GeiypMoNCK7gWef5CfgV6Zsh4nV31yIZjXg0/RTQzf2rmmI36NkbVKAN+TYmH6VJWs6x5SFklmKPt70lypwfSEao5f+kEJz2XwOf2judkZwcOU67vyptz0sG/Z+QxlKOEogbRy13eV4qgqSyZEa1c8nAaIS80pPKbXU/MYWBRSaYY8FtYiITemDGlcO0fyny0F4XRQDrN6cAr7zus7GtHbsZNXwsN9g4imq8Th7b8L6G+xwFbo8jtvjuo07Ef7J8Hf3lUEzXoxQw0=
on:
tags: true
distributions: sdist bdist_wheel
repo: galaxy-genome-annotation/python-tripal
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
rebuild:
python scripts/autobuilder.py --galaxy
python scripts/commands_to_rst.py
python3 scripts/autobuilder.py --galaxy
python3 scripts/commands_to_rst.py
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,18 @@ A Python library for interacting with [Tripal](http://tripal.info/)

## History

- 3.0
- Added some support for Tripal 3
- Add `job add_import_job` for generic Tripal 3 importer
- Add preliminary code for entity management (waiting for https://github.com/tripal/tripal/issues/202)
- sync and delete_orphans are not yet implemented (https://github.com/tripal/tripal/issues/337)
- GFF3: removed bugged 'refresh' and 'remove' loading mode (no more available in Tripal3)
- Renamed `organism get_organism_nodes` to `organism get_organisms_tripal`
and `analysis get_analysis_nodes` to `analysis get_analyses_tripal`.
Both now return Drupal Nodes for Tripal 2 or Entities for Tripal 3.
- Added `delete_orphans` methods for organisms and analyses
- Added tests

- 2.0.4
- Small bug fixes

Expand Down
4 changes: 3 additions & 1 deletion docs/commands.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ describes these commands.

commands/analysis.rst
commands/db.rst
commands/entity.rst
commands/feature.rst
commands/job.rst
commands/organism.rst
commands/organism.rst
commands/phylogeny.rst
85 changes: 57 additions & 28 deletions docs/commands/analysis.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,31 @@ Create an analysis
-h, --help Show this message and exit.

``delete_orphans`` command
--------------------------

**Usage**::

tripaille analysis delete_orphans [OPTIONS]

**Help**

Delete orphans Drupal analysis nodes


**Output**


status

**Options**::


--job_name TEXT Name of the job
--no_wait Return immediately without waiting for job completion
-h, --help Show this message and exit.

``get_analyses`` command
------------------------

Expand Down Expand Up @@ -65,28 +90,28 @@ Get analyses
-h, --help Show this message and exit.

``get_analysis_nodes`` command
------------------------------
``get_analyses_tripal`` command
-------------------------------

**Usage**::

tripaille analysis get_analysis_nodes [OPTIONS]
tripaille analysis get_analyses_tripal [OPTIONS]

**Help**

Get analysis nodes
Get analysis entities


**Output**


Analysis node information
Analysis entity/node information

**Options**::


--node INTEGER filter on node id
-h, --help Show this message and exit.
--analysis_id INTEGER An analysis entity/node ID
-h, --help Show this message and exit.

``load_blast`` command
Expand Down Expand Up @@ -127,6 +152,8 @@ Create a Blast analysis
--is_concat If the blast result file is simply a list of
concatenated blast results.
--search_keywords Extract keywords for Tripal search
--no_parsed TEXT Maximum number of hits to parse per feature.
Default=all [default: all]
--no_wait Do not wait for job to complete
--algorithm TEXT analysis algorithm
--sourceversion TEXT analysis sourceversion
Expand Down Expand Up @@ -207,11 +234,8 @@ Load GFF3 file
--analysis_id INTEGER Analysis ID
--import_mode TEXT Import mode (add_only=existing features won't be
touched, update=existing features will be
updated and obsolete attributes kept,
refresh=existing features will be updated and
obsolete attributes removed, remove=features
present in the db and in the GFF3 file will be
removed)') [default: update]
updated and obsolete attributes kept)')
[default: update]
--target_organism TEXT In case of Target attribute in the GFF3, choose
the organism abbreviation or common name to
which target sequences belong. Select this only
Expand Down Expand Up @@ -286,22 +310,27 @@ Create a GO analysis
**Options**::


--gaf_ext TEXT If looking for files in a directory, extension of the
GAF files
--query_type TEXT The feature type (e.g. 'gene', 'mRNA', 'contig') of the
query. It must be a valid Sequence Ontology term.
--query_uniquename Use this if the --query-re regular expression matches
unique names instead of names in the database.
--method TEXT Import method ('add' or 'remove') [default: add]
--re_name TEXT Regular expression to extract the feature name from GAF
file.
--no_wait Do not wait for job to complete
--algorithm TEXT analysis algorithm
--sourceversion TEXT analysis sourceversion
--sourceuri TEXT analysis sourceuri
--description TEXT analysis description
--date_executed TEXT analysis date_executed (yyyy-mm-dd)
-h, --help Show this message and exit.
--organism TEXT Organism common name or abbreviation
--organism_id INTEGER Organism ID
--gaf_ext TEXT If looking for files in a directory, extension of the
GAF files
--query_type TEXT The feature type (e.g. 'gene', 'mRNA', 'contig') of the
query. It must be a valid Sequence Ontology term.
--query_matching TEXT Method to match identifiers to features in the
database. ('name', 'uniquename' or 'dbxref') [default:
uniquename]
--method TEXT Import method ('add' or 'remove') [default: add]
--name_column INTEGER Column containing the feature identifiers (2, 3, 10 or
11; default=2). [default: 2]
--re_name TEXT Regular expression to extract the feature name from GAF
file.
--no_wait Do not wait for job to complete
--algorithm TEXT analysis algorithm
--sourceversion TEXT analysis sourceversion
--sourceuri TEXT analysis sourceuri
--description TEXT analysis description
--date_executed TEXT analysis date_executed (yyyy-mm-dd)
-h, --help Show this message and exit.

``load_interpro`` command
Expand Down
78 changes: 78 additions & 0 deletions docs/commands/entity.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
entity
======

This section is auto-generated from the help text for the tripaille command
``entity``.


``add_entity`` command
----------------------

**Usage**::

tripaille entity add_entity [OPTIONS] ENTITY

**Help**

Add a new entity to the database


**Output**


Entity information

**Options**::


--params TEXT Values to populate the entity fields
-h, --help Show this message and exit.

``get_entities`` command
------------------------

**Usage**::

tripaille entity get_entities [OPTIONS]

**Help**

Get entities


**Output**


Entity information

**Options**::


--entity TEXT Name of the entity type (e.g. Organism)
--entity_id INTEGER ID of an entity
-h, --help Show this message and exit.

``get_fields`` command
----------------------

**Usage**::

tripaille entity get_fields [OPTIONS] ENTITY

**Help**

Get the list of available fields for an entity


**Output**


Fields information

**Options**::


-h, --help Show this message and exit.
Loading

0 comments on commit 150d610

Please sign in to comment.