def main(path): path = path.rstrip('/') group = load_group(path) dictionary = count_mutations(path, group) dictionary = aggregate_chars(group, dictionary) dictionary = OrderedDict(sorted(dictionary.items())) write_output(path, group, group_num, dictionary)
def main(proj_path, project_id): global Session, Sample, Variant engine = create_engine('sqlite:///{}/{}'.format(proj_path, db_filename)) from db_utils import Sample, Variant, Base Base.metadata.create_all(bind=engine) Session = sessionmaker(bind=engine) proj_path = '{}/{}'.format(proj_path, project_id) sample_list = compile_group.load_group(proj_path) build_db(proj_path, project_id, sample_list)
def main(proj_path): path_config = get_config.all() snpEff_path = '{}/VScope/extensions/{}'.format(path_config['BASE_PATH'], path_config['SNPEFF']) group = load_group(proj_path) print('Annotating vcf files') db_info = load_db_tag(proj_path) snpeff_group(snpEff_path, db_info, proj_path, group) print('Counting impact categories') impact_count(proj_path, group)
def main(proj_path): group_num = '1' end = '_p' group = load_group(proj_path) dictionary_pair, total = find_singles(proj_path, group, end) # Change to dict_pair dictionary_pair, found = find_data(proj_path, group, dictionary_pair, end) print('Group total muts:', total, found) combined_dict = combine_dicts(dictionary_pair) results = analyse(proj_path, group_num, combined_dict, len(group)) write_output(proj_path, group_num, results)
def main(path, threshold): write_log(path, 'Performing subtraction with a quality threshold of {}'.format(threshold)) group = load_group(path) ends = ('_p', ) # '_1', '_2', for end in ends: dictionary_pair, total = find_singles(path, group, end) write_log(path, 'Processing {} total single occurrences from end {}'.format(total, end)) dictionary_pair, found = find_data(path, dictionary_pair, total, group, end, threshold) write_log(path, 'Found records for {} out of {} single occurrences.'.format(found, total)) chars_dict = count_mutations(dictionary_pair[0]) print_dict(chars_dict) for key, value in count_mutations(dictionary_pair[1]).items(): # Combine indels and snps chars_dict[key] += value print_dict(chars_dict) chars_dict = aggregate_chars([], chars_dict) chars_dict = rename_chars(chars_dict) chars_dict = OrderedDict(sorted(chars_dict.items())) write_chars(path, end, chars_dict)