with open(os.path.join(file_out+".txt"),'w') as outpt: dic = defaultdict(list) dic[chro_pos].append(sample_num) outpt.write("chrom_pos"+"\t"+"\t".join(samp_num)+ "\t"+"\n") for k ,val in dic.iteritems(): # k is the chromosome:location. val is the sample number 1 out 105 for v in val: outpt_TSS.write(int(k)*("\t")+ str(1)+'\n') # This will have duplicates chrome_pos and I don't want that, I want one chrome_pos with number ones corresponding to multiple samples.
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)