Mercurial > repos > greg > cwpair2
comparison cwpair2.py @ 9:6469dda597d6 draft
Uploaded
author | greg |
---|---|
date | Wed, 02 Dec 2015 16:13:59 -0500 |
parents | 001551406848 |
children |
comparison
equal
deleted
inserted
replaced
8:1fc26b8e618d | 9:6469dda597d6 |
---|---|
6 matched pairs are mode, closest, largest or all, where the analysis is run for each method | 6 matched pairs are mode, closest, largest or all, where the analysis is run for each method |
7 | 7 |
8 Input: list of one or more gff format files | 8 Input: list of one or more gff format files |
9 | 9 |
10 Output: files produced for each input/mode combination: | 10 Output: files produced for each input/mode combination: |
11 S (simple), D (detailed), O (orphans), P (frequency preview plot), F (final frequency plot), | 11 MP (matched_pair), D (details), O (orphans), P (frequency preview plot), F (frequency final plot), |
12 C (statistics graph), statistics.tabular | 12 C (statistics graph), statistics.tabular |
13 """ | 13 """ |
14 | 14 |
15 import argparse | 15 import argparse |
16 import csv | 16 import csv |
24 parser.add_argument('--down_distance', dest='down_distance', type=int, default=100, help='Distance downstream of a pair.') | 24 parser.add_argument('--down_distance', dest='down_distance', type=int, default=100, help='Distance downstream of a pair.') |
25 parser.add_argument('--binsize', dest='binsize', type=int, default=1, help='Width of bins for plots and mode.') | 25 parser.add_argument('--binsize', dest='binsize', type=int, default=1, help='Width of bins for plots and mode.') |
26 parser.add_argument('--threshold_format', dest='threshold_format', help='Percentage to filter the 95th percentile.') | 26 parser.add_argument('--threshold_format', dest='threshold_format', help='Percentage to filter the 95th percentile.') |
27 parser.add_argument('--relative_threshold', dest='relative_threshold', type=float, default=0.0, help='Percentage to filter the 95th percentile.') | 27 parser.add_argument('--relative_threshold', dest='relative_threshold', type=float, default=0.0, help='Percentage to filter the 95th percentile.') |
28 parser.add_argument('--absolute_threshold', dest='absolute_threshold', type=float, default=0.0, help='Absolute value to filter.') | 28 parser.add_argument('--absolute_threshold', dest='absolute_threshold', type=float, default=0.0, help='Absolute value to filter.') |
29 parser.add_argument('--output_files', dest='output_files', default='simple', help='Restrict output dataset collections.') | 29 parser.add_argument('--output_files', dest='output_files', default='matched_pair', help='Restrict output dataset collections.') |
30 parser.add_argument('--sort_score', dest='sort_score', default='no', help='Sort output by score.') | |
31 parser.add_argument('--statistics_output', dest='statistics_output', help='Statistics output file.') | 30 parser.add_argument('--statistics_output', dest='statistics_output', help='Statistics output file.') |
32 args = parser.parse_args() | 31 args = parser.parse_args() |
33 | 32 |
34 cwpair2_util.create_directories(args.method) | 33 cwpair2_util.create_directories() |
35 | 34 |
36 statistics = [] | 35 statistics = [] |
37 if args.absolute_threshold > 0: | 36 if args.absolute_threshold > 0: |
38 threshold = args.absolute_threshold | 37 threshold = args.absolute_threshold |
39 elif args.relative_threshold > 0: | 38 elif args.relative_threshold > 0: |
46 args.method, | 45 args.method, |
47 threshold, | 46 threshold, |
48 args.up_distance, | 47 args.up_distance, |
49 args.down_distance, | 48 args.down_distance, |
50 args.binsize, | 49 args.binsize, |
51 args.output_files, | 50 args.output_files) |
52 args.sort_score) | |
53 statistics.extend(stats) | 51 statistics.extend(stats) |
54 # Accumulate statistics. | 52 # Accumulate statistics. |
55 by_file = {} | 53 by_file = {} |
56 for stats in statistics: | 54 for stats in statistics: |
57 # Skip "None" statistics from failed files | 55 # Skip "None" statistics from failed files |