from pullfromdir import pullfile from withspec import pullspec from getbests import finder from genrat import grat from bigratio import brat from pieplotter import lilmaker from pieplotter import bigmaker from operator import itemgetter path=sys.argv[1] pullfile(path) print "Got files ran through NCBI" pullspec(path) print "Got files with at least one match" specdict,ndict=finder(path) print "Got dictionary of top species" specdict, total=grat(specdict,ndict) print "Got genus ratios" overalldict=brat(specdict) print "Got overall ratios" print"\n\nRatios by genus" for key, value in sorted(specdict.items(), key=itemgetter(1), reverse=True): print key,str(value) print"\n\nRatios in overall form" for key, value in sorted(overalldict.items(), key=itemgetter(1), reverse=True): print key,str(value) lilmaker(specdict)
from pullfromdir import pullfile from withspec import pullspec from getbests import finder from genusratio import grat from bigratio import brat from pieplotter import lilmaker from pieplotter import bigmaker from operator import itemgetter path = sys.argv[1] pullfile(path) print "Got files ran through NCBI" pullspec(path) print "Got files with at least one match" specdict, ndict = finder(path) print "Got dictionary of top species" specdict, total = grat(specdict, ndict) print "Got genus ratios" overalldict = brat(specdict) print "Got overall ratios" print "\n\nRatios by genus" for key, value in sorted(specdict.items(), key=itemgetter(1), reverse=True): print key, str(value) print "\n\nRatios in overall form" for key, value in sorted(overalldict.items(), key=itemgetter(1), reverse=True): print key, str(value) lilmaker(specdict)
shutil.rmtree('hasspec/') os.mkdir('hasspec/') for directory, subdirectories, files in os.walk(path): for fn in files: k=open(path+fn) ct=0 for line in k: ct+=1 if ct>1: try: shutil.copy2(directory+'/'+fn, 'hasspec/'+fn) except: pass specdict,ndict=finder('hasspec/') specdict, total=grat(specdict,ndict) overalldict=brat(specdict) if "Vegetables" not in overalldict: veg.append(0.0) else: veg.append(overalldict["Vegetables"]) if "Meat" not in overalldict: meat.append(0.0) else: meat.append(overalldict["Meat"]) if "Parasites" not in overalldict: par.append(0.0) else: par.append(overalldict["Parasites"])