Mercurial > repos > miller-lab > genome_diversity
comparison dpmix.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 | 4b6590dd7250 |
children | 8997f2ca8c7a |
comparison
equal
deleted
inserted
replaced
23:66a183c44dd5 | 24:248b06e86022 |
---|---|
39 print >> sys.stderr, stderrdata | 39 print >> sys.stderr, stderrdata |
40 sys.exit(1) | 40 sys.exit(1) |
41 | 41 |
42 ################################################################################ | 42 ################################################################################ |
43 | 43 |
44 if len(sys.argv) < 15: | 44 if len(sys.argv) < 16: |
45 print "usage" | 45 print "usage" |
46 sys.exit(1) | 46 sys.exit(1) |
47 | 47 |
48 input, data_source, switch_penalty, ap1_input, ap2_input, p_input, output, output2, output2_dir, dbkey, ref_column, galaxy_data_index_dir, heterochromatin_loc_file = sys.argv[1:14] | 48 input, input_type, data_source, switch_penalty, ap1_input, ap2_input, p_input, output, output2, output2_dir, dbkey, ref_column, galaxy_data_index_dir, heterochromatin_loc_file = sys.argv[1:15] |
49 individual_metadata = sys.argv[14:] | 49 individual_metadata = sys.argv[15:] |
50 | 50 |
51 chrom = 'all' | 51 chrom = 'all' |
52 add_logs = '0' | 52 add_logs = '0' |
53 | 53 |
54 loc_path = os.path.join(galaxy_data_index_dir, heterochromatin_loc_file) | 54 loc_path = os.path.join(galaxy_data_index_dir, heterochromatin_loc_file) |
102 args.append(heterochrom_path) | 102 args.append(heterochrom_path) |
103 args.append(misc_file) | 103 args.append(misc_file) |
104 | 104 |
105 columns = ap1.column_list() | 105 columns = ap1.column_list() |
106 for column in columns: | 106 for column in columns: |
107 args.append('{0}:1:{1}'.format(column, ap1.individual_with_column(column).name)) | 107 if input_type == 'gd_genotype': |
108 args.append('{0}:1:{1}'.format(int(column) - 2, ap1.individual_with_column(column).name)) | |
109 else: | |
110 args.append('{0}:1:{1}'.format(column, ap1.individual_with_column(column).name)) | |
108 | 111 |
109 columns = ap2.column_list() | 112 columns = ap2.column_list() |
110 for column in columns: | 113 for column in columns: |
111 args.append('{0}:2:{1}'.format(column, ap2.individual_with_column(column).name)) | 114 if input_type == 'gd_genotype': |
115 args.append('{0}:2:{1}'.format(int(column) - 2, ap2.individual_with_column(column).name)) | |
116 else: | |
117 args.append('{0}:2:{1}'.format(column, ap2.individual_with_column(column).name)) | |
112 | 118 |
113 columns = p.column_list() | 119 columns = p.column_list() |
114 for column in columns: | 120 for column in columns: |
115 args.append('{0}:0:{1}'.format(column, p.individual_with_column(column).name)) | 121 if input_type == 'gd_genotype': |
122 args.append('{0}:0:{1}'.format(int(column) - 2, p.individual_with_column(column).name)) | |
123 else: | |
124 args.append('{0}:0:{1}'.format(column, p.individual_with_column(column).name)) | |
116 | 125 |
117 run_program(None, args, stdout_file=output, space_to_tab=True) | 126 run_program(None, args, stdout_file=output, space_to_tab=True) |
118 | 127 |
119 ################################################################################ | 128 ################################################################################ |
120 # Create pdf file | 129 # Create pdf file |