예제 #1
0
def parse_logs(fnames, parse_fn, cache_yaml):
    logs = datafile.load_cache_yaml(cache_yaml)
    logs = filter(lambda log: 'fname' in log, logs)
    processed_fnames = [log['fname'] for log in logs]
#    print processed_fnames

    for fname in fnames:
        if fname in processed_fnames:
            print "processed",fname
            continue
        print fname
        date = datafile.get_date_from_fname(fname)
        print date
        if date is None:
            continue

        try:
            log = {
              'fname': fname,
              'timestamp': calendar.timegm(date.timetuple()),
              'iso_date_str': date.isoformat(),
            }
            parsed_log = parse_fn(fname)
            log.update(parsed_log)
            logs.append(log)
        except KeyboardInterrupt:
            raise
        except Exception as E:
            logger.debug("Error parsing " + fname + ": " + str(E))
            continue

    logs.sort(key=lambda l:l['timestamp'])
    datafile.write_yaml(logs, cache_yaml)

    return logs
예제 #2
0
def make_subset_groups(peptides, groups_yaml):
    identify_subsets(peptides)
    groups = find_subset_groups(peptides)
    datafile.write_yaml(groups, groups_yaml)
예제 #3
0
def make_groups(peptides_csv, groups_yaml):
    peptides = read_peptides_from_csv(peptides_csv)
    identify_overlaps(peptides)
    groups = find_groups(peptides)
    datafile.write_yaml(groups, groups_yaml)
예제 #4
0
def make_overlap_groups(peptides, groups_yaml, min_overlap):
    identify_overlaps(peptides, min_overlap)
    groups = find_overlap_groups(peptides, min_overlap)
    datafile.write_yaml(groups, groups_yaml)
예제 #5
0
def make_groups(peptides_csv, groups_yaml):
    peptides = read_peptides_from_csv(peptides_csv)
    identify_overlaps(peptides)
    groups = find_groups(peptides)
    datafile.write_yaml(groups, groups_yaml)