3 | 3 |
## Dependencies
|
4 | 4 |
`CTDConverter` has the following python dependencies:
|
5 | 5 |
|
6 | |
- [CTDopts]
|
|
6 |
- [CTDopts]
|
7 | 7 |
- `lxml`
|
8 | |
- `pyyaml`
|
|
8 |
- `ruamel.yaml`
|
9 | 9 |
|
10 | 10 |
### Installing Dependencies
|
11 | 11 |
We recommend the use of `conda` to manage all dependencies. If you're not sure what `conda` is, make sure to read the [using-conda](conda documentation).
|
12 | 12 |
|
13 | 13 |
The easiest way to get you started with CTD conversion is to create a `conda` environment on which you'll install all dependencies. Using environments in `conda` allows you to have parallel, independent python environments, thus avoiding conflicts between libraries. If you haven't installed `conda`, check [conda-install](conda's installation guide).
|
14 | 14 |
|
15 | |
Once you've installed `conda`, create an environment named `ctd-converter` and list all dependencies, like so:
|
|
15 |
Once you've installed `conda`, create an environment named `ctd-converter`, like so:
|
16 | 16 |
|
17 | 17 |
```sh
|
18 | |
$ conda create --name ctd-converter --channel workflowconversion ctdopts lxml pyyaml libxml2=2.9.2
|
|
18 |
$ conda create --name ctd-converter
|
19 | 19 |
```
|
20 | |
|
21 | |
[CTDopts] is a python module available on the `workflowconversion` channel in the Anaconda cloud. Of course, you could just download [CTDopts] and make it available through your `PYTHONPATH` environment variable, if you're into that. To get more information about how to install python modules, visit: https://docs.python.org/2/install/.
|
22 | |
|
23 | |
`lxml` depends on `libxml2`. When you install `lxml` you'll get the latest version of `libxml2` (2.9.4) by default. You would usually want the latest version, but there is, however, a bug in validating XML files against a schema in this version of `libxml2`.
|
24 | |
|
25 | |
If you require validation of input CTDs against a schema (which we recommend), you will need to downgrade to the latest known version of `libxml2` that works, namely, 2.9.2.
|
26 | 20 |
|
27 | 21 |
You will now need to *activate* the environment by executing the following command:
|
28 | 22 |
|
29 | 23 |
```sh
|
30 | 24 |
$ source activate ctd-converter
|
31 | 25 |
```
|
|
26 |
|
|
27 |
Install the required dependencies as follows (the order of execution **is actually important**, due to transitive dependencies):
|
|
28 |
|
|
29 |
```sh
|
|
30 |
$ conda install --channel workflowconversion ctdopts
|
|
31 |
$ conda install lxml
|
|
32 |
$ conda install --channel conda-forge ruamel.yaml
|
|
33 |
$ conda install libxml2=2.9.2
|
|
34 |
```
|
|
35 |
|
|
36 |
`lxml` depends on `libxml2`. When you install `lxml` you'll get the latest version of `libxml2` (2.9.4) by default. You would usually want the latest version, but there is, however, a bug in validating XML files against a schema in this version of `libxml2`.
|
|
37 |
|
|
38 |
If you require validation of input CTDs against a schema (which we recommend), you will need to downgrade to the latest known version of `libxml2` that works, namely, 2.9.2.
|
|
39 |
|
|
40 |
You could just download dependencies manually and make them available through your `PYTHONPATH` environment variable, if you're into that. To get more information about how to install python modules without using `conda`, visit: https://docs.python.org/2/install/.
|
32 | 41 |
|
33 | 42 |
## How to install `CTDConverter`
|
34 | 43 |
`CTDConverter` is not a python module, rather, a series of scripts, so installing it is as easy as downloading the source code from https://github.com/genericworkflownodes/CTDConverter. Once you've installed all dependencies, downloaded `CTDConverter` and activated your `conda` environment, you're good to go.
|