# Change what's inside the quotes into your MBL STAMPS server username, or something else unique # reminder! hit shift-ENTER to execute cell & move onto next cell username="CHANGEME" # configure paths etc. import sys import os os.environ['PYTHONPATH'] = '/usr/local/share/khmer/python' sys.path.insert(0, '/usr/local/share/khmer/python') import khmer import screed cd /mnt mkdir -p $username cd $username import random random.seed(1) x = ["A"] + ["G"] + ["C"] + ["T"] x = x*1000 random.shuffle(x) x = "".join(x) y = ["A"] + ["G"] + ["C"] + ["T"] y = y*1000 random.shuffle(y) y = "".join(y) print 'x is', x[:100] print 'y is', y[:100] outfp = open('metagenome.fa', 'w') print >>outfp, ">x 1" print >>outfp, x print >>outfp, ">y 2" print >>outfp, y outfp.close() !python /usr/local/share/2012-paper-diginorm/pipeline/make-biased-reads.py metagenome.fa | head -100000 > reads.fa !/usr/local/share/khmer/scripts/abundance-dist-single.py -k 20 -x 1e8 reads.fa reads.hist histdata = numpy.loadtxt('reads.hist') plot(histdata[:,0], histdata[:,1]) xlabel("k-mer abundance") ylabel("N of k-mers with that abundance") plot(histdata[:,0], histdata[:,1]) axis(ymax=500) xlabel("k-mer abundance") ylabel("N of k-mers with that abundance") plot(histdata[:,0], histdata[:,1]) axis(xmax=10)