Skip to content

Commit

Permalink
Finished the first tutorial version
Browse files Browse the repository at this point in the history
  • Loading branch information
Hogfeldt committed Mar 21, 2020
1 parent 74b7abf commit 493981c
Showing 1 changed file with 73 additions and 31 deletions.
104 changes: 73 additions & 31 deletions docs/usage/tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Tutorial
========

To show how BiRG works, we will create a recipe for a software called fuma. First we will generate an initial recipe, with basic information about fuma and then we will give this recipe as input to BiRG, which will find the necessary dependencies required to build, test and run fuma.
To show how BiRG works, we will create a recipe for a software called airr. First we will generate an initial recipe, with basic information about airr and then we will give this recipe as input to BiRG, which will find the necessary dependencies required to build, test and run the software.

++++++++++++++++++++
Recipe Initilization
Expand All @@ -23,9 +23,9 @@ Here is the initialization of fuma:
.. code-block:: console
$ bioconda-recipe-gen init
Package name: fuma
Version: 3.0.5
Url to download the code: https://github.com/yhoogstrate/fuma/archive/v3.0.5.tar.gz
Package name: airr
Version: 1.2.1
Url to download the code: https://pypi.io/packages/source/a/airr/airr-1.2.1.tar.gz
Choose the ? that you use to run your code
['cmake', 'python2', 'python3']: python3
Expand All @@ -36,59 +36,60 @@ The recipe
The basic recipe create by `init` should look something like this:

.. code-block::
:caption: fuma/meta.yaml
:caption: airr/meta.yaml
package:
name: fuma
version: 3.0.5
name: airr
version: 1.2.1
source:
url: https://github.com/yhoogstrate/fuma/archive/v3.0.5.tar.gz
md5: 4dabc4af48b73ce30cd43f8320dadcea
url: https://pypi.io/packages/source/a/airr/airr-1.2.1.tar.gz
md5: 66f13422ea75f9b40b86acf6fd521fdd
build:
number: 0
.. code-block::
:caption: fuma/build.sh
:caption: airr/build.sh
#!/bin/bash
$PYTHON setup.py install
This is the minimal initial recipe, that you can give as input to BiRG. To make it easier for BiRG to find run time dependencies it is important to add tests to the `meta.yaml` file.
This is the minimal initial recipe, that you can give as input to BiRG. To make it easier for BiRG to find run-time dependencies it is important to add tests to the `meta.yaml` file.
If you have a patch or would like to add some additional meta data, feel free to do so.
For information on what data and configuration you can add to a recipe, see the official Conda documentation `here <https://docs.conda.io/projects/conda-build/en/latest/resources/define-metadata.html>`_

Before using the recipe for fuma as input to BiRG we make some alterations to the `meta.yaml` file.
Before using the recipe for airr as input to BiRG, we will add some tests to the `meta.yaml` file.
By adding tests, we makes sure that BiRG will try and find run-time dependencies as well as build-time dependencies.

.. code-block::
:caption: fuma/meta.yaml
:caption: airr/meta.yaml
package:
name: fuma
version: 3.0.5
name: airr
version: 1.2.1
source:
url: https://github.com/yhoogstrate/fuma/archive/v3.0.5.tar.gz
md5: 4dabc4af48b73ce30cd43f8320dadcea
patches:
- remove-nose-dep.patch
url: https://pypi.io/packages/source/a/airr/airr-1.2.1.tar.gz
md5: 66f13422ea75f9b40b86acf6fd521fdd
build:
number: 0
test:
imports:
- fuma
commands:
- fuma --help
- fuma --version
- airr-tools --help
imports:
- airr
- airr.specs
- tests
We will also edit the the `build.sh`, since the developers of airr are preferring to use `pip`.

about:
home: https://github.com/yhoogstrate/fuma/
license: GNU General Public License v3 or later (GPLv3+)
summary: 'FuMa: reporting overlap in RNA-seq detected fusion genes'
.. code-block::
:caption: airr/build.sh
#!/bin/bash
$PYTHON -m pip install . --no-deps --ignore-installed --no-cache-dir -vvv
.. note::

We added a patch called `remove-nose-dep.patch` in the `meta.yaml` file, this patch can be downloaded `here <https://raw.githubusercontent.com/bioconda/bioconda-recipes/master/recipes/fuma/remove-nose-dep.patch>`_ , this file should be placed in the recipe directory.

The recipe for airr can be found in our github repo `here <https://github.com/Hogfeldt/bioconda_recipe_gen/tree/master/examples/python_builds_with_pip/input>`_

++++++++++++
Recipe Build
Expand Down Expand Up @@ -127,6 +128,47 @@ Here is an example on how BiRG is called for building fuma:

.. code-block:: console
$ bioconda-recipe-gen build bioconda-recipes/ fuma/ python3
$ bioconda-recipe-gen build bioconda-recipes/ airr/ python3
When BiRG is running it will print out a lot of text, this is the output from it's building process.
BiRG will also some times ask for your help, to determine which version of a dependency it should use.

When BiRG is done running it will tell you if it was able to build and run your software and the output recipe can be found in the directory which aws created by the `init` command.

Here is the final recipe for airr:

.. code-block::
:caption: airr/meta.yaml
package:
name: airr
version: 1.2.1
source:
url: https://pypi.io/packages/source/a/airr/airr-1.2.1.tar.gz
md5: 66f13422ea75f9b40b86acf6fd521fdd
build:
number: 0
test:
commands:
- airr-tools --help
imports:
- airr
- airr.specs
- tests
requirements:
host:
- python >=3
run:
- python >=3
- pandas
- pyyaml
- yamlordereddictloader
- setuptools
.. code-block::
:caption: airr/build.sh
#!/bin/bash
$PYTHON -m pip install . --no-deps --ignore-installed --no-cache-dir -vvv
When BiRG is running it will print out a lot of tekst, this is the output from it's building process
Congratulation you can now add your recipe to Bioconda and share your software.

0 comments on commit 493981c

Please sign in to comment.