comparison add_fst_column.py @ 24:248b06e86022

Added gd_genotype datatype. Modified tools to support new datatype.
author Richard Burhans <burhans@bx.psu.edu>
date Tue, 28 May 2013 16:24:19 -0400
parents 2c498d40ecde
children 8997f2ca8c7a
comparison
equal deleted inserted replaced
23:66a183c44dd5 24:248b06e86022
16 16
17 if len(sys.argv) < 12: 17 if len(sys.argv) < 12:
18 print >> sys.stderr, "Usage" 18 print >> sys.stderr, "Usage"
19 sys.exit(1) 19 sys.exit(1)
20 20
21 input, p1_input, p2_input, genotypes, min_reads, min_qual, retain, discard_fixed, biased, output = sys.argv[1:11] 21 input, p1_input, p2_input, input_type, genotypes, min_reads, min_qual, retain, discard_fixed, biased, output = sys.argv[1:12]
22 individual_metadata = sys.argv[11:] 22 individual_metadata = sys.argv[12:]
23 23
24 p_total = Population() 24 p_total = Population()
25 p_total.from_tag_list(individual_metadata) 25 p_total.from_tag_list(individual_metadata)
26 26
27 p1 = Population() 27 p1 = Population()
50 args.append(discard_fixed) 50 args.append(discard_fixed)
51 args.append(biased) 51 args.append(biased)
52 52
53 columns = p1.column_list() 53 columns = p1.column_list()
54 for column in columns: 54 for column in columns:
55 if input_type == 'gd_genotype':
56 column = int(column) - 2
55 args.append('{0}:1'.format(column)) 57 args.append('{0}:1'.format(column))
56 58
57 columns = p2.column_list() 59 columns = p2.column_list()
58 for column in columns: 60 for column in columns:
61 if input_type == 'gd_genotype':
62 column = int(column) - 2
59 args.append('{0}:2'.format(column)) 63 args.append('{0}:2'.format(column))
60 64
61 fh = open(output, 'w') 65 fh = open(output, 'w')
62 66
63 #print "args:", ' '.join(args) 67 #print "args:", ' '.join(args)