All code available at https://github.com/SchlossLab/ipython-mothurmagic
mothur must be installed on your system and either in your path or in the directory where IPython is running. See http://www.mothur.org/wiki/Download_mothur to download a copy of mothur.
%install_ext https://raw.githubusercontent.com/SchlossLab/ipython-mothurmagic/master/mothurmagic.py
Installed mothurmagic.py. To use it, type: %load_ext mothurmagic
%load_ext mothurmagic
Example using data from http://www.mothur.org/w/images/3/37/AmazonData.zip A unique log file will be generated each time a %%mothur cell is executed.
%%mothur
cluster(phylip=AmazonData/98_sq_phylip_amazon.dist, cutoff=0.1)
collect.single()
rarefaction.single()
mothur > cluster(phylip=AmazonData/98_sq_phylip_amazon.dist, cutoff=0.1) ********************#****#****#****#****#****#****#****#****#****#****# Reading matrix: ||||||||||||||||||||||||||||||||||||||||||||||||||| *********************************************************************** changed cutoff to 0.069234 Output File Names: AmazonData/98_sq_phylip_amazon.an.sabund AmazonData/98_sq_phylip_amazon.an.rabund AmazonData/98_sq_phylip_amazon.an.list It took 0 seconds to cluster mothur > collect.single() Using AmazonData/98_sq_phylip_amazon.an.list as input file for the list parameter. unique 0.01 0.02 0.03 0.04 0.05 0.06 Output File Names: AmazonData/98_sq_phylip_amazon.an.sobs AmazonData/98_sq_phylip_amazon.an.chao AmazonData/98_sq_phylip_amazon.an.ace AmazonData/98_sq_phylip_amazon.an.jack AmazonData/98_sq_phylip_amazon.an.shannon AmazonData/98_sq_phylip_amazon.an.npshannon AmazonData/98_sq_phylip_amazon.an.simpson mothur > rarefaction.single() Using AmazonData/98_sq_phylip_amazon.an.list as input file for the list parameter. Using 1 processors. unique 0.01 0.02 0.03 0.04 0.05 0.06 Output File Names: AmazonData/98_sq_phylip_amazon.an.rarefaction mothur > quit()