Author Archives: Daniel Cuevas

Installing PyFBA (and necessary modules) without admin permissions

As easy as it is to install PyFBA using the pip command, it can be quite cumbersome to do so when you are working on a system without granted administrative or sudo permissions. Here is a quick guide that has worked for me when installing PyFBA on a CentOS 6.3 system running a SunGrid Engine cluster system. If you are working on a Linux system and you do have admin and sudo permissions, please follow the install guide here. Continue reading

CAMI challenge datasets

CAMI (Critical Assessment of Metagenome Interpretation) is a community-led initiative designed to help tackle the problems faced by metagenomics analyses, aiming for an independent, comprehensive and bias-free evaluation of these metagenomics pipelines [source]. As part of the challenge, several simulated datasets were generated in order to evaluate each of the assembly, profiling, and binning tools submitted for review. Three distinct datasets were generated simulating microbiomes of varying complexities: low, medium, and high complexity. A pre-print version of the CAMI manuscript can be found on bioRxiv here: http://biorxiv.org/content/early/2017/01/09/099127
This blog post contains links to the binning and profiling results for those datasets. Continue reading

iPython Notebook How-To: Gap-fill a model in PyFBA

Gap-fill a model in PyFBA

by Daniel Cuevas

Introduction

In this notebook, we will present the steps to generate a genome-scale metabolic model from RAST annotations, gap-fill the model on rich LB type media, and save the model to hard disk.

Continue reading

iPython Notebook How-To: Generating, saving, and loading models in PyFBA

Generating, saving, loading models in PyFBA

by Daniel Cuevas

Introduction

In this notebook, we will present the steps to generate a genome-scale metabolic model from RAST annotations, save the model on your computer, and load the model from your computer.
Continue reading

Autocompletion in default Python shell

Some Python shells, like iPython, provide autocompletion functionality while typing in code. If you’re like me and use the default shell in your terminal (the one that starts up when you just execute python) this feature isn’t automatically available. Alas, I discovered a way to make this possible! Click the read more to find out how.

Continue reading

Linux commands for Mac OS X

We all know that Mac OS X is UNIX certified allowing command line users to use Terminal to execute quick Bash or Perl script pipelines. However, for us that are more familiar with the GNU Linux environment, there are some slight variations in the commands we often use, such as the –complement flag in cut, or the -h flag in sort. These options are non-existent in the OS X versions of the commands, and there are probably more instances of these that I haven’t run into yet.
There is a very simple way to install these GNU commands for your Mac using Homebrew:
brew install coreutils
This will allow you to use the GNU versions of the commands, for example, gsort is used in place of sort, and gcut in place of cut.
If you don’t have Homebrew installed (it’s almost like using apt-get to install programs and commands) you can install it by first installing Xcode and making sure command line tools is installed for Xcode. Then run the following command:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Some online blogs recommend installing XQuartz afterwards too.
Note: this was performed on OS X Yosemite version 10.10.3

Installing Python3.4 and the SciPy stack on CentOS

My Linux experiences are primarily associated with Ubuntu and, until recently, have never had to work with an rpm style distro. I know installing software on either one is generally the same despite the use of different package managers, but there were a few online resources I frequently used in which I could no longer reference.

I want to share the operations I performed to install Python2.7 and Python3.4 on CentOS. CentOS is pre installed with Python2.6 but this version does not include some of the nice features 2.7/3.4 provide. Below are mostly the instructions to install the SciPy stack on 3.4, but they should be able to apply to 2.7 by using the proper version of pip.

I’ve provided the two web links I used at the top under REFERENCES 

### REFERENCES ###
# http://wiki.guibin.info/?p=133 #
# http://g0o0o0gle.com/install-python-3-4-1-centos-6/ #

yum groupinstall "Development tools"
sudo yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel
sudo vim /etc/ld.so.conf
add '/usr/local/lib'

# INSTALL PYTHON 2.7
wget http://python.org/ftp/python/2.7.6/Python-2.7.6.tar.xz
tar xvf Python-2.7.6.tar.xz
cd Python-2.7.6
sudo ./configure --prefix=/usr/local --enable-shared LDFLAGS="-Wl,-rpath /usr/local/lib"
sudo make
sudo make altinstall
# INSTALL PYTHON 3.4
wget http://python.org/ftp/python/3.4.1/Python-3.4.1.tar.xz
tar xvf Python-3.4.1.tar.xz
cd Python-3.4.1
sudo ./configure --prefix=/usr/local --enable-shared LDFLAGS="-Wl,-rpath /usr/local/lib"
sudo make
sudo make altinstall
# This will install pip3.4 already

# INSTALL NUMPY
sudo yum install lapack lapack-devel blas blas-devel
sudo /usr/local/bin/pip3.4 install numpy

# INSTALL SCIPY
sudo /usr/local/bin/pip3.4 install scipy

# SETUP INSTALL FOR MATPLOTLIB
# Get, build, install freetype
wget http://download.savannah.gnu.org/releases/freetype/freetype-2.5.3.tar.gz
tar xvzf freetype-2.5.3.tar.gz
cd freetype-2.5.3
sudo ./configure
sudo make
sudo make install

# Get, build, install libpng
wget http://mirror.centos.org/centos/6/os/x86_64/Packages/libpng-devel-1.2.49-1.el6_2.x86_64.rpm
sudo rpm -Uvh libpng-devel-1.2.49-1.el6_2.x86_64.rpm

# INSTALL MATPLOTLIB
# Matplotlib source can be obtained through sourceforge or git
git clone git@github.com:matplotlib/matplotlib.git
cd matplotlib/
python3.4 setup.py build
sudo /usr/local/bin/python3.4 setup.py install