Exemplo n.º 1
0
	Genus = defaultdict(int)
	PGenus = {}
	f_family = open(inputdir+'partition_abundance_family.csv','w')
	writer_family = csv.writer(f_family)
	Family = defaultdict(int)
	PFamily = {}
	FP = glob.glob(os.path.join(inputdir+'cluster_vectors/','*.cluster.npy'))
	Clusters = [fp[fp.rfind('/')+1:fp.index('.npy')] for fp in FP]
	for c in Clusters:
		hashobject.assembly_loc = hashobject.output_path+c+'_velvet/'
		try:
			asbly = hashobject.assembly_stats(c)
		except:
			asbly = {}
		try:
			algn = hashobject.alignment_stats(c)
			algn = sorted(algn.iteritems(),key=itemgetter(1),reverse=True)
			if len(algn) == 0:
				algn = [(None,0)]
		except:
			algn = [(None,0)]
		try:
			algn_v = hashobject.alignment_stats(c+'.viral')
			algn_v = sorted(algn_v.iteritems(),key=itemgetter(1),reverse=True)
			if len(algn_v) == 0:
				algn_v = [(None,0)]
		except:
			algn_v = [(None,0)]
		sample_counts = []
		for sample in Sample_ids:
			try: