Debian Codegraph @

docs/examples.rst

raw
1 ***************
2 Getting Started
3 ***************
4
5 For a very basic setup, you can configure a ``docker-compose.yml`` file to use
6 with `docker <https://www.docker.com/products/overview#install_the_platform>`__,
7 which is especially helpful when you are testing out BioMAJ.
8
9 Docker
10 ======
11
12 .. literalinclude:: docker-compose.yml
13 :language: yaml
14 :linenos:
15
16 This configuration file defines a simple MongoDB instance which is used for
17 backend storage by BioMAJ, as well as the BioMAJ instance itself. Line 8
18 denotes that a folder named ``data`` in the current directory will be mounted
19 into the volume as storage. Any files downloaded by BioMAJ will appear in this
20 directory.
21
22 Running the ``--help`` command can be done easily:
23
24 .. code:: console
25
26 $ docker-compose run --rm biomaj --help
27
28
29 Simple Configuration
30 ====================
31
32 Once you've reached this point, you're ready to start configuring BioMAJ to
33 download datasets for you. Configuration files should go instead a folder
34 ``conf`` inside the ``data`` folder in your current directory. As an example,
35 we will use this simple ALU configuration file:
36
37 .. literalinclude:: alu.properties
38 :language: text
39 :linenos:
40
41 The file can be broken down into a couple of sections:
42
43 - Metadata (lines 1-15)
44 - Remote Source (17-24)
45 - Release Information (26-30)
46 - Other
47
48 The metadata consists of things like where data should be stored, and how
49 to name it. The remote source describes where data is to be fetched from,
50 release information we will see in another example, and then there are a
51 few extra, miscellaneous options shown in this example config.
52
53 If you have copied the ``alu.properties`` file into ``./data/conf/alu.properties``, you are ready to download this database:
54
55 .. code:: console
56
57 $ docker-compose run --rm biomaj --bank alu --update
58 2016-08-24 21:43:15,276 INFO [root][MainThread] Log file: /var/lib/biomaj/log/alu/1472074995.28/alu.log
59 Log file: /var/lib/biomaj/log/alu/1472074995.28/alu.log
60 ...
61
62 This command should complete successfully, and you will have some more files in ``./data/``:
63
64 .. code:: console
65
66 $ find data
67 data/conf/alu.properties
68 data/data/ncbi/blast/alu/alu-2003-11-26/flat/alu.a
69 data/data/ncbi/blast/alu/alu-2003-11-26/flat/alu.n
70 data/cache/files_1472074995.29
71 data/log/alu/1472074995.28/alu.log
72
73 The ``data/data`` directories contain your downloaded files. Additionally
74 a cache file exists and a job run log is contains data about what occurred
75 during the download and processing. Note that the files that appear are
76 ``alu.a`` and ``alu.n``, instead of ``alu.a.gz`` and ``alu.n.gz``. By
77 having the option ``no.extract=true`` commented out on line 33, BioMAJ
78 automatically extracted the data for us.
79
80 The ``--status`` command will allow you to see the status of various databases you have downloaded.
81
82 .. code:: console
83
84 $ docker-compose run --rm biomaj --bank alu --status
85 +--------+-----------------+----------------------+---------------------+
86 | Name | Type(s) | Last update status | Published release |
87 |--------+-----------------+----------------------+---------------------|
88 | alu | nucleic_protein | 2016-08-24 21:58:14 | 2003-11-26 |
89 +--------+-----------------+----------------------+---------------------+
90 +---------------------+------------------+------------+----------------------------------------------------+----------+
91 | Session | Remote release | Release | Directory | Freeze |
92 |---------------------+------------------+------------+----------------------------------------------------+----------|
93 | 2016-08-24 21:58:14 | 2003-11-26 | 2003-11-26 | /var/lib/biomaj/data/ncbi/blast/alu/alu-2003-11-26 | no |
94 +---------------------+------------------+------------+----------------------------------------------------+----------+
95
96
97 Advanced Configuration
98 ======================
99
100 Once you have this sort of simple configuration working, you may wish to
101 explore more advanced configurations. There is a `public repository
102 <https://github.com/genouest/biomaj-data/>`__ of BioMAJ configurations which
103 will be interesting to the advanced user wishing to learn more about what can
104 be done with BioMAJ.