comparison repmatch_gff3.py @ 0:a072f0f30ea3 draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/repmatch_gff3 commit 0e04a4c237677c1f5be1950babcf8591097996a9
author iuc
date Wed, 23 Dec 2015 09:25:42 -0500
parents
children 6acaa2c93f47
comparison
equal deleted inserted replaced
-1:000000000000 0:a072f0f30ea3
1 # repmatch.py
2 #
3 # Replicate matching - matches paired peaks from two or more replicates
4 #
5 # Input: one or more gff files (matched_peak output from cwpair2, each a list of paired peaks from a replicate
6 #
7 # Output: list of matched groups and list of unmatched peaks
8 # Files: statistics_table.tabular (file to replicate ID), matched_paired_peaks.tabular, detail.tabular, unmatched_peaks.tabular
9
10 import argparse
11 import repmatch_gff3_util
12
13 if __name__ == '__main__':
14 parser = argparse.ArgumentParser()
15 parser.add_argument('--input', dest='inputs', action='append', nargs=2, help="Input datasets")
16 parser.add_argument('--method', dest='method', default='closest', help='Method of finding match')
17 parser.add_argument('--distance', dest='distance', type=int, default=50, help='Maximum distance between peaks in different replicates to allow merging')
18 parser.add_argument('--step', dest='step', type=int, default=0, help='Step size of distance for each iteration')
19 parser.add_argument('--replicates', dest='replicates', type=int, default=2, help='Minimum number of replicates that must be matched for merging to occur')
20 parser.add_argument('--low_limit', dest='low_limit', type=int, default=-1000, help='Lower limit for c-w distance filter')
21 parser.add_argument('--up_limit', dest='up_limit', type=int, default=1000, help='Upper limit for c-w distance filter')
22 parser.add_argument('--output_files', dest='output_files', default='all', help='Restrict output dataset collections.')
23 parser.add_argument('--output_matched_peaks', dest='output_matched_peaks', help='Matched groups in gff format')
24 parser.add_argument('--output_unmatched_peaks', dest='output_unmatched_peaks', default=None, help='Unmatched paired peaks in tabular format')
25 parser.add_argument('--output_detail', dest='output_detail', default=None, help='Details in tabular format')
26 parser.add_argument('--output_statistics_table', dest='output_statistics_table', default=None, help='Keys in tabular format')
27 parser.add_argument('--output_statistics_histogram', dest='output_statistics_histogram', default=None, help='Histogram')
28
29 args = parser.parse_args()
30
31 dataset_paths = []
32 hids = []
33 for (dataset_path, hid) in args.inputs:
34 dataset_paths.append(dataset_path)
35 hids.append(hid)
36 repmatch_gff3_util.process_files(dataset_paths,
37 hids,
38 args.method,
39 args.distance,
40 args.step,
41 args.replicates,
42 args.up_limit,
43 args.low_limit,
44 args.output_files,
45 args.output_matched_peaks,
46 args.output_unmatched_peaks,
47 args.output_detail,
48 args.output_statistics_table,
49 args.output_statistics_histogram)