Mercurial > repos > miller-lab > genome_diversity
diff dpmix.py @ 9:22fe0154fa54
added support for heterochromatic regions
author | Richard Burhans <burhans@bx.psu.edu> |
---|---|
date | Tue, 10 Jul 2012 11:41:22 -0400 |
parents | 2c498d40ecde |
children |
line wrap: on
line diff
--- a/dpmix.py Wed Jun 20 14:02:30 2012 -0400 +++ b/dpmix.py Tue Jul 10 11:41:22 2012 -0400 @@ -7,6 +7,7 @@ from Population import Population import gd_composite from dpmix_plot import make_dpmix_plot +from LocationFile import LocationFile ################################################################################ @@ -40,17 +41,22 @@ ################################################################################ -if len(sys.argv) < 14: +if len(sys.argv) < 15: print "usage" sys.exit(1) -input, data_source, switch_penalty, ap1_input, ap2_input, p_input, output, output2, output2_dir, dbkey, ref_column, galaxy_data_index_dir = sys.argv[1:13] -individual_metadata = sys.argv[13:] +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] +individual_metadata = sys.argv[14:] chrom = 'all' -analyze_additional = '0' add_logs = '0' +loc_path = os.path.join(galaxy_data_index_dir, heterochromatin_loc_file) +location_file = LocationFile(loc_path) +heterochrom_path = location_file.get_values_if_exists(dbkey) +if heterochrom_path is None: + heterochrom_path = '/dev/null' + population_list = [] p_total = Population() @@ -93,7 +99,7 @@ args.append(data_source) args.append(add_logs) args.append(switch_penalty) -args.append(analyze_additional) +args.append(heterochrom_path) args.append(misc_file) columns = ap1.column_list() @@ -138,18 +144,11 @@ elif data_source == '1': data_source_value = 'estimated genotype' -if analyze_additional == '0': - analyze_additional_value = 'no' -elif analyze_additional == '1': - analyze_additional_value = 'yes' - in_data_source = gd_composite.Parameter(description='Data source', value=data_source_value, display_type=display_value) in_switch_penalty = gd_composite.Parameter(description='Switch penalty', value=switch_penalty, display_type=display_value) -in_analyze_additional = gd_composite.Parameter(description='Also analyze random chromosome', value=analyze_additional_value, display_type=display_value) info_page.add_input_parameter(in_data_source) info_page.add_input_parameter(in_switch_penalty) -info_page.add_input_parameter(in_analyze_additional) misc_populations = gd_composite.Parameter(name='Populations', value=population_list, display_type=gd_composite.DisplayPopulationList())