---
# System prepended metadata

title: 'MetaboDirect traning session (December 1, 2021)'

---

# MetaboDirect traning session (December 1, 2021)


## User Manual

MetaboDirect user manual can be accesed [here](https://metabodirect.readthedocs.io/en/latest/index.html#).

## Setting up

### 1. Install Anaconda

Download and install the Anaconda distribution of Python from [here](https://www.anaconda.com/products/individual-b).

### 2. Setting up the command prompt

**(For Windows Users)** Open the *Anaconda Prompt* in Administrator Mode, and enter the following commands:

```
conda install m2-base
conda install -c menpo wget
```

**(Mac Users)** Open your defaul terminal.`ls` and `wget` should already be installed by default,  but to confirm please try:

```
which ls
```

If you get an error message for any of those, please enter the commands specified above for **Windows users**.

### 3. Python package installation

Install the required packages specified in the **MetaboDirect** [installation page](https://metabodirect.readthedocs.io/en/latest/installation.html):

```
pip install <package-name>
```

### 4. R package installation

Open R or RStudio and install the required packages specified in the **MetaboDirect** [installation page](https://metabodirect.readthedocs.io/en/latest/installation.html):

```
install.packages('<package-name>') 
```

The packages *KEGGREST* needs to be installed from Bioconductor with the following command:

```
if (!requireNamespace("BiocManager", quietly = TRUE))
    install.packages("BiocManager")

BiocManager::install("KEGGREST")
```

The package *pmartR* needs to be installed with *devtools* with the following command:

```
devtools::install_github("pmartR/pmartR")
```

Please check each package documentation for more detailed information regarding installation.

### 5. Put R in your system's PATH

Check i R is in your path by typing the following in the command prompt

```
which Rscript
```

If you get and error, R is not in your path:

**(For Windos Users)** Please follow the instructions of this [website](https://www.architectryan.com/2018/03/17/add-to-the-path-on-windows-10/) to add the directory where R is installed to your system's path.

**(For Mac Users)** Most likely R will be already in your path. If not, you can follow the instructions of this [website](https://www.architectryan.com/2012/10/02/add-to-the-path-on-mac-os-x-mountain-lion/)

### 5. Example using test data

Go to your Desktop, for most systems the tilde `~` is your Home directory, the Desktop directory is usually on your home directory. TO quickly got o the Desktop you can type

```
cd ~
cd Desktop
```

Create a new directory

```
mkdir training
```

move in to that directory

```
cd training
```

Example data can be downloaded from the MetaboDirect repository, using the following command:

Report file:

```
curl https://raw.githubusercontent.com/Coayala/MetaboDirect/main/example/Report.csv -o Report.csv
```
metadata file:

```
curl https://raw.githubusercontent.com/Coayala/MetaboDirect/main/example/metadata.csv -o metadata.csv
```

### 5.1 Check normalization methods

Use the command

```
test_normalization Report.csv metadata.csv Habitat
```

### 5.2 Run Metabodirect

You can test the example data using

```
metabodirect Report.csv metadata.csv -o test_run -g Habitat -f Sampletype solid -n mean -t
```

Once the transformation files are finished networks can be created using:

```
create_networks test_run metadata.csv Habitat
```

## ## Questions and Contact Information

If you have any doubts or questions please feel free to contact me:
* Christian Ayala-Ortiz (cayalaortiz@email.arizona.edu)

