help="Directory with families of species") """ parser.add_argument("-o", "--output_file", action="store", dest="output", default="stdout", help="Output file. Default: stdout") """ args = parser.parse_args() # run after scripts/expansion/compare_cluster.py # out_fd = sys.stdout if args.output == "stdout" else open(args.output, "w") species_syn_dict = TwoLvlDict() for species in args.species_list: species_syn_dict[species] = read_synonyms_dict("%s%s/all.t" % (args.species_dir, species)) species_syn_dict.write("families_all_species.t", absent_symbol=".") not_assembled = species_syn_dict.filter_by_line(is_assembled) species_syn_dict.write("correctly_assembled_families_species.t", absent_symbol=".") assembled_ids = IdSet(species_syn_dict.sl_keys()) assembled_ids.write("assembled_families.ids") not_assembled_ids = IdSet(not_assembled.sl_keys()) not_assembled_ids.write("non_assembled_families.ids") """ if args.output != "stdout": out_fd.close() """
default="stdout", help="Output file. Default: stdout") args = parser.parse_args() out_fd = sys.stdout if args.output == "stdout" else open(args.output, "w") species_syn_dict = TwoLvlDict() for species in args.species_list: species_syn_dict[species] = read_synonyms_dict("%s%s/all.t" % (args.species_dir, species)) species_syn_dict.write("families_all_species.t", absent_symbol=".") nonassembled = species_syn_dict.filter_by_line(filter_nonassembled) species_syn_dict.write("correctly_assembled_families_species.t", absent_symbol=".") nonassembled.write("not_assembled_families_in_all_species.t", absent_symbol=".") complicated_families_dict = nonassembled.filter_by_line( filter_splited_to_several_fam) complicated_families_dict.write("complicated_families.t", absent_symbol=".") complicated_families_syn_dict = SynDict() complicated_families_syn_ids = IdSet() sl_keys = list(complicated_families_dict.sl_keys()) for sl_key in sl_keys: sp_set = set() for species in complicated_families_dict: