Mercurial > repos > iuc > multigps
changeset 4:0bec3b2df784 draft
Uploaded
| author | iuc |
|---|---|
| date | Mon, 03 Apr 2017 14:07:14 -0400 |
| parents | d78ff3764fe5 |
| children | d7c4baf43c13 |
| files | multigps.py multigps.xml |
| diffstat | 2 files changed, 13 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/multigps.py Mon Apr 03 13:38:23 2017 -0400 +++ b/multigps.py Mon Apr 03 14:07:14 2017 -0400 @@ -25,7 +25,7 @@ parser.add_argument('--format', dest='format', default=None, help='Input expt file data format') parser.add_argument('--gaussmodelsmoothing', dest='gaussmodelsmoothing', default=None, help='Use Gaussian model smoothing') parser.add_argument('--gausssmoothparam', dest='gausssmoothparam', type=int, default=None, help='Smoothing factor') -parser.add_argument('--input_item', dest='input_items', action='append', nargs=7, default=None, help="Input files, attributes and options") +parser.add_argument('--input_item', dest='input_items', action='append', nargs=8, default=None, help="Input files, attributes and options") parser.add_argument('--jointinmodel', dest='jointinmodel', default=None, help='Allow joint events in model updates') parser.add_argument('--mappability', dest='mappability', type=float, default=None, help='Fraction of the genome that is mappable for these experiments') parser.add_argument('--maxtrainingrounds', dest='maxtrainingrounds', type=int, default=None, help='Maximum number of training rounds for updating binding event read distributions') @@ -66,11 +66,14 @@ def generate_design_file(input_items): + control_file_names = [] design_file = open(DESIGN_FILE, 'w') for item in input_items: - file_name, label, file_format, condition_name, replicate_name, experiment_type, fixed_read_count = item + experiment_file_name, control_file_name, label, file_format, condition_name, replicate_name, experiment_type, fixed_read_count = item + if control_file_name not in ['None', None, '']: + control_file_names.append(control_file_name) file_format = file_format.upper() - items = [file_name, label, file_format, condition_name] + items = [experiment_file_name, label, file_format, condition_name] if replicate_name not in ['None', None, '']: items.append(replicate_name) if experiment_type not in ['None', None, '']: @@ -79,6 +82,7 @@ items.append(fixed_read_count) design_file.write('%s\n' % '\t'.join(items)) design_file.close() + return control_file_names def get_file_with_extension(dir, ext): @@ -141,8 +145,10 @@ cmd += ' --meme1proc' # Experiment. if args.input_items is not None: - generate_design_file(args.input_items) + control_file_names = generate_design_file(args.input_items) cmd += ' --design %s' % DESIGN_FILE + if len(control_file_names) > 0: + cmd += ' --ctrl %s' % ','.join(control_file_names) else: if args.expt is not None: cmd += ' --expt %s' % args.expt
--- a/multigps.xml Mon Apr 03 13:38:23 2017 -0400 +++ b/multigps.xml Mon Apr 03 14:07:14 2017 -0400 @@ -14,9 +14,10 @@ #if str($single_or_multi_expt) == 'multi': #for $i in $single_or_multi_expt_cond['input_items']: #set label_cond = $i['label_cond'] - #set file_name = $label_cond.input + #set experiment_file_name = $label_cond.input #set label = $label_cond.label #set file_format = $label_cond.input.ext + #set control_file_name = $label_cond.control #set condition_name = $label_cond.condition_name #set replicate_name = 'None' #set experiment_type = $label_cond.experiment_type @@ -29,7 +30,7 @@ #set replicate_name = $rncond.replicate_name #end if #end if - --input_item '$file_name' '$label' '$file_format' '$condition_name' '$replicate_name' '$experiment_type' '$fixed_read_count' + --input_item '$experiment_file_name' '$control_file_name' '$label' '$file_format' '$condition_name' '$replicate_name' '$experiment_type' '$fixed_read_count' #end for #else: #set expt = $single_or_multi_expt_cond.expt
