Skip to content

Commit 65c14dd

Browse files
committed
Add threads option to prediction (replacing multiprocessing.cpu_count()).
Set tensorflow version to 2.14.0 for compatibility of using OrderedEnqueuer in training.
1 parent 7d17878 commit 65c14dd

File tree

4 files changed

+12
-2
lines changed

4 files changed

+12
-2
lines changed

docs/readme/predict.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,3 +85,7 @@ The windows to use for prediction. These windows must be 1,024 bp wide and have
8585
### `-skip_call_peaks, --skip_call_peaks`
8686

8787
This will skip calling peaks at the end of predictions.
88+
89+
### `--threads`
90+
91+
Set number of parallel threads in prediction tasks. If GPUs are used, set this value to be the number of GPUs used for the task. Default: 24.

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)