Skip to content

Compiling Mothur

Mothur is a tool for analyzing 16S rRNA gene sequences.[1]

This will describe compiling a multithreaded but non-MPI version of Mothur 1.33.3

Installed Versions

We have installed three different versions of Mothur on Proteus, in two different flavors each. To use, load the appropriate module:

mothur/gcc/1.25.0-mpi mothur/gcc/1.25.0-threads mothur/gcc/1.33.3-mpi mothur/gcc/1.33.3-threads mothur/gcc/1.39.4-threads

The "threads" versions can run in parallel but only on a single node. To use this, request the "shm" Parallel Environment (PE), e.g.

#$ -pe shm 16

Download

From http://www.mothur.org/wiki/Download_mothur#Source_code

[juser@proteusa01 src]$ wgethttp://www.mothur.org/w/images/6/65/Mothur.1.33.3.zip [juser@proteusa01 src]$ unzip Mothur.1.33.3.zip [juser@proteusa01 src]$ rm -rf __MACOSX*

Create Makefile for uchime

Create the following file, named "Makefile" in Mothur.source/uchime_src -- IMPORTANT - the whitespace at the start of any non-empty line must be TABS

CXX=g++
CXXFLAGS=-O3 -msse4.2 -mavx -mfpmath=sse -D_FILE_OFFSET_BITS=64 -DNDEBUG=1 -DUCHIMES=1
OBJ=addtargets2.o alignchime.o alignchimel.o alnparams.o alpha.o alpha2.o \
        fractid.o getparents.o globalalign2.o make3way.o mx.o myutils.o path.o \
        searchchime.o seqdb.o setnucmx.o sfasta.o tracebackbit.o uchime_main.o \
        usort.o viterbifast.o writechhit.o

uchime: $(OBJ)
        $(CXX) $(OBJ) -o $@ -lm

clean:
        -/bin/rm -f uchime *.o

Modify makefile for Mothur

In Mothur.source, edit "makefile".

Comment out the TARGET_ARCH for mac:

#if you are a mac user use the following line #TARGET_ARCH += -arch x86_64

Add optimization flags for Linux:

#if you are a linux user use the following line CXXFLAGS += -msse4.2 -mavx -mfpmath=sse

Modify the uchime make line -- IMPORTANT The white space in front of "-cd" is a single TAB character

uchime: -cd uchime_src && make uchime && mv uchime .. && cd ..

Build

[juser@proteusa01 Mothur.source]$ make -j 16 | tee make.out

This generates the program mothur.

Move Executable

[juser@proteusa01 Mothur.source]$ mkdir -p /mnt/HA/groups/myresearchGrp/bin [juser@proteusa01 Mothur.source]$ mv mothur uchime /mnt/HA/groups/myresearchGrp/bin

References

[1] Mothur website