This notebook was designed to run the QIIME Illumina Overview Tutorial on the QIIME 1.8.0 Amazon Web Services EC2 instance. You can find the AMI ID on the QIIME resources page. These steps covered here are important for having multiple users working on a single IPython Notebook server, but are a little bit of overkill if you're running this on your own AWS instance. If you're running this on your own instance, you should instead work with the IPython Notebook linked from here.
In [ ]:
from random import choice
from os import chdir, mkdir, makedirs
from os.path import join
from IPython.display import FileLinks as ipFileLinks, FileLink as ipFileLink
# to support running in a multi-user environment, each user will work in
# a temporary working directory with a randomly generated name
basedir = "temp"
choices = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
choices += choices.lower()
working_dir = join(basedir,''.join([choice(choices) for i in range(10)]))
otu_base = "/home/ubuntu/qiime_software/gg_otus-12_10-release/"
reference_seqs = join(otu_base,"rep_set/97_otus.fasta")
reference_tree = join(otu_base,"trees/97_otus.tree")
reference_tax = join(otu_base,"taxonomy/97_otu_taxonomy.txt")
print "Your working directory is %s" % working_dir
makedirs(working_dir)
chdir(working_dir)
!wget https://s3.amazonaws.com/s3-qiime_tutorial_files/moving_pictures_tutorial-1.8.0.tgz
!tar -xzf moving_pictures_tutorial-1.8.0.tgz
# To use FileLink(s), but link to files in the user's working directory
# we wrap the call to FileLink(s) to append the working_dir to the
# url_prefix. NOTE: This is not something that you'll generally need to
# do - it's only important as we're working with multiple users in the
# IPython Notebook, which is currently only a single-user environment.
def FileLinks(path):
return ipFileLinks(path,url_prefix='files/%s/' % working_dir)
def FileLink(path):
return ipFileLink(path,url_prefix='files/%s/' % working_dir)
You can now get started. Follow the steps found in the Illumina Overview Tutorial.
In [ ]: