Skip to content

Commit

Permalink
add -q option to make quite output
Browse files Browse the repository at this point in the history
  • Loading branch information
sfchen committed Aug 12, 2016
1 parent 98c63f5 commit 2d788b5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion predict.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env python
import sys, os
from optparse import OptionParser
import time
Expand All @@ -16,6 +17,8 @@ def parseCommand():
parser = OptionParser(usage = usage, version = version)
parser.add_option("-m", "--model", dest = "model_file", default = "cfdna.model",
help = "specify which file stored the built model.")
parser.add_option("-q", "--quite", dest = "quite", action='store_true', default = False,
help = "only print those prediction conflicts with filename")
return parser.parse_args()

def preprocess(options):
Expand Down Expand Up @@ -75,7 +78,8 @@ def main():
labels = model.predict(data)

for i in xrange(len(samples)):
print(get_type_name(labels[i]) + ": " + samples[i])
if options.quite == False or (labels[i] == 0 and "cfdna" in samples[i].lower()) or (labels[i] == 1 and "cfdna" not in samples[i].lower()):
print(get_type_name(labels[i]) + ": " + samples[i])

plot_data_list(samples, data, "predict_fig")

Expand Down
1 change: 1 addition & 0 deletions train.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env python
import sys, os
import fastq
from optparse import OptionParser
Expand Down

0 comments on commit 2d788b5

Please sign in to comment.