Skip to content

Commit c59619f

Browse files
authored
Merge pull request #268 from Bamu-d/patterns
added option to print computed p-value threshold
2 parents b5b7564 + 0d19938 commit c59619f

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

Diff for: scripts/count_patterns.py

+10-2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ def get_options():
1515
parser.add_argument('patterns',
1616
help='File of patterns from pyseer')
1717

18+
parser.add_argument('--threshold',
19+
default=False,
20+
action='store_true',
21+
help='Only print p-value threshold')
1822
parser.add_argument('--alpha',
1923
default=0.05,
2024
type=float,
@@ -48,5 +52,9 @@ def get_options():
4852
" | wc -l")
4953

5054
p = subprocess.check_output(command, shell=True, universal_newlines=True)
51-
print("Patterns:\t" + p.rstrip())
52-
print("Threshold:\t" + '%.2E' % Decimal(options.alpha/float(p.rstrip())))
55+
if not options.threshold:
56+
print("Patterns:\t" + p.rstrip())
57+
print("Threshold:\t" + '%.2E' % Decimal(options.alpha/float(p.rstrip())))
58+
else:
59+
print('%.2E' % Decimal(options.alpha/float(p.rstrip())))
60+

0 commit comments

Comments
 (0)