Skip to content

Commit 9b4dff0

Browse files
committed
Add threads option to prediction (replacing multiprocessing.cpu_count(), set threads=1 for GPU inference).
Set tensorflow version to 2.14.0 for compatibility of using OrderedEnqueuer in training.
1 parent 7d17878 commit 9b4dff0

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

maxatac/analyses/predict.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ def run_prediction(args):
102102
f"Output filename: {outfile_name_bigwig}"
103103
)
104104

105-
with Pool(int(multiprocessing.cpu_count())) as p:
105+
with Pool(args.threads) as p:
106106
forward_strand_predictions = p.starmap(make_stranded_predictions,
107107
[(regions_pool,
108108
args.signal,

maxatac/utilities/parser.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,12 @@ def get_parser():
330330
help="Skip calling peaks on prediction tracks"
331331
)
332332

333+
predict_parser.add_argument("--threads",
334+
dest="threads",
335+
type=int,
336+
default=24,
337+
help="Number of processes to run prediction in parallel. Default: 24"
338+
)
333339
#############################################
334340
# Train parser
335341
#############################################

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def get_description():
8080
]
8181
),
8282
install_requires=[
83-
"tensorflow",
83+
"tensorflow==2.14.0",
8484
"tensorboard",
8585
"biopython",
8686
"py2bit",

0 commit comments

Comments
 (0)