Project

General

Profile

« Previous | Next » 

Revision 70

Finished VegX-VegBank mapping and created VegBank joins of mappings to VegX

View differences:

ch_map_root
25 25
    reader = csv.reader(sys.stdin)
26 26
    writer = csv.writer(sys.stdout)
27 27
    cols = reader.next()
28
    for i in range(len(configs)):
28
    for i in xrange(len(configs)):
29 29
        config = configs[i]
30 30
        config['root'] = cols[i]
31 31
        label = cols[i].partition('/')[0]
......
34 34
        cols[i] = label+config['out_root']
35 35
    writer.writerow(cols)
36 36
    for row in reader:
37
        for i in range(len(configs)): row[i] = configs[i]['root']+row[i]
37
        for i in xrange(len(configs)): row[i] = configs[i]['root']+row[i]
38 38
        if row[0].startswith(configs[0]['prefix']):
39
            assert row[1].startswith(configs[1]['prefix'])
40
            for i in range(len(configs)):
39
            if not row[1].startswith(configs[1]['prefix']):
40
                raise SystemExit('Map error: Root "'+configs[1]['prefix']
41
                    +'" is not contained in output mapping: '+row[1])
42
            for i in xrange(len(configs)):
41 43
                row[i] = row[i][configs[i]['prefix_len']:]
42 44
            writer.writerow(row)
43 45

  

Also available in: Unified diff