Skip to content
This repository has been archived by the owner on Aug 10, 2021. It is now read-only.

Tutorial: Getting Started

devoid edited this page Jul 26, 2012 · 2 revisions

Tutorial: Getting Started

Start here if you have already downloaded and installed the ModelSEED software package. This tutorial will walk you through the setup process and how to build a model.

Check that everything is working

Let's make sure that the install worked. Open a shell and type in the following command---the $ is your command prompt:

$ ms

This should return a list of subcommands. If you get an error or a Command not found! message, go back to the installation instructions and make sure that you installed the Model SEED correctly.

Set up data storage

Now we will configure where your models and other data are stored. There are a few ways that we can do this, but the most simple way is to execute the following command:

$ ms stores add local --type file

This will configure the Model SEED to store data in files in the default directory: ~/.modelseed_filedb. These files aren't very readable, but if you would like to store them somewhere else, supply the --directory <dir> option to the command:

$ ms stores add local --type file --directory /path/to/data

MongoDB Storage

In addition to the simple file-based storage, you can also configure the Model SEED to use a MongoDB server as the storage back-end. Execute the following command to do this:

$ ms stores add local --type mongo --host <hostname> [options]

<hostname> is the hostname of the server running MongoDB, e.g. "localhost". You can also supply "username" and "password" flags if you need those to connect to your database. By default, this will create a database called model_seed. If this needs to be different, use the --db\_name flag to indicate what database you would like data saved to.

Login

Before you can create objects, you must log into the system. This should be the same username and password you use for the ModelSEED website.

$ ms login <username>
Password:

This will prompt you for your password. The command should return with no message, indicating a successful login. To check what user you're logged in as, run:

$ ms whoami
sdevoid

If you are working on your own computer, it isn't neccesary to logout. However, you can with:

$ ms logout

Getting biochemistry data

Now that you've set up the data-storage and logged in, we need to get some data to work with. First, lets download a copy of the biochemistry data that we will use to build a model.

$ ms import biochemistry <some-name> --verbose

When this returns let's take a look at the objects in our current environment:

$ ms list
Type           	Count 
biochemistry/  	1
$ ms list biochemistry
biochemistry/sdevoid/main

Your biochemistry will be named whatever you saved it to, so not necessarily "main". Now let's take a look at that biochemistry object in detail:

$ ms list biochemistry/sdevoid/main
compounds             (16996)
aliasSets             (91)
cues                  (472)
reactions             (12756)
compartments          (13)
media                 (518)

This lists out the sub-objects contained in our biochemistry, around 17K compounds and 13K reactions, among other things. If you'd like to see the complete biochemistry object, you can print it in JSON format:

$ ms get biochemistry/sdevoid/main [ --pretty ]

The --pretty option will pretty-print the JSON output

Constructing a model

Before we can construct a model, we need to have to other data objects: genome annotations and a "mapping". We will start with the mapping object, which captures the logic for building a metabolic model from the annotation information.

$ ms import mapping map --biochemistry main -v

Here we have to associate our mapping with a biochemistry object. Once that completes we are ready to get an annotated genome. We currently support importing annotations from the SEED and RAST. To see a list of available public genomes, run:

$ ms import annotation --list --verbose

This will print a tab-delimited table of Genome ID and Genome Name. Note that RAST genomes will not be visible in here, however you can still supply the RAST genome's ID to import those annotations.

I'll pick an E. Coli K12 genome ID 83333.1:

$ ms import annotation 83333.1 ecoli --mapping map -v

Note that I must supply the mapping used when importing the annotation. Once this completes I'll have a genome, a mapping object and my biochemistry data:

$ ms list
Type           	Count          
mapping/       	1
biochemistry/  	1
annotation/    	1

Now to construct a model we call buildmodel on the annotation object:

$ ms genome buildmodel annotation/sdevoid/ecoli my-model -v

This will construct a model.

Additional Notes & Tips

  • You can use the command help to get usage info about a function:

      $ ms help
      $ ms help genome
      $ ms genome help