Skip to content

Commit

Permalink
Error out when attempting to use multithreading on MacOS
Browse files Browse the repository at this point in the history
  • Loading branch information
susannasiebert committed Jan 17, 2024
1 parent 4ff2dc2 commit 255ac2d
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 1 deletion.
4 changes: 4 additions & 0 deletions pvactools/tools/pvacbind/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import os
import shutil
import yaml
import platform

from pvactools.lib.prediction_class import *
from pvactools.lib.pipeline import PvacbindPipeline
Expand Down Expand Up @@ -50,6 +51,9 @@ def main(args_input = sys.argv[1:]):
if args.iedb_retries > 100:
sys.exit("The number of IEDB retries must be less than or equal to 100")

if args.n_threads > 1 and platform.system() == "Darwin":
raise Exception("Multithreading is not supported on MacOS")

input_file_type = 'fasta'
base_output_dir = os.path.abspath(args.output_dir)

Expand Down
3 changes: 3 additions & 0 deletions pvactools/tools/pvacfuse/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import argparse
import os
import shutil
import platform

from pvactools.lib.prediction_class import *
from pvactools.lib.pipeline import PvacbindPipeline
Expand Down Expand Up @@ -124,6 +125,8 @@ def main(args_input = sys.argv[1:]):
else:
sys.exit("The downstream sequence length needs to be a positive integer or 'full'")

if args.n_threads > 1 and platform.system() == "Darwin":
raise Exception("Multithreading is not supported on MacOS")

base_output_dir = os.path.abspath(args.output_dir)

Expand Down
4 changes: 4 additions & 0 deletions pvactools/tools/pvacseq/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import os
import shutil
import yaml
import platform

from pvactools.lib.prediction_class import *
from pvactools.lib.pipeline import Pipeline
Expand Down Expand Up @@ -66,6 +67,9 @@ def main(args_input = sys.argv[1:]):
elif args.tumor_purity < 0:
raise Exception("--tumor-purity must be a float between 0 and 1. Value too small: {}".format(args.tumor_purity))

if args.n_threads > 1 and platform.system() == "Darwin":
raise Exception("Multithreading is not supported on MacOS")

input_file_type = 'vcf'
base_output_dir = os.path.abspath(args.output_dir)

Expand Down
5 changes: 4 additions & 1 deletion pvactools/tools/pvacvector/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from Bio.Alphabet import IUPAC
import itertools
import json
import platform

from pvactools.lib.optimal_peptide import OptimalPeptide
from pvactools.lib.vector_visualization import VectorVisualization
Expand Down Expand Up @@ -411,7 +412,6 @@ def create_dna_backtranslation(results_file, dna_results_file):
SeqIO.write([output_record], dna_results_file, 'fasta')

def main(args_input=sys.argv[1:]):

parser = define_parser()
args = parser.parse_args(args_input)

Expand All @@ -433,6 +433,9 @@ def main(args_input=sys.argv[1:]):
else:
sys.exit("Input file type not as expected. Needs to be a .fa or a .tsv file")

if args.n_threads > 1 and platform.system() == "Darwin":
raise Exception("Multithreading is not supported on MacOS")

(class_i_prediction_algorithms, class_ii_prediction_algorithms) = pvactools.lib.run_utils.split_algorithms(args.prediction_algorithms)
if len(class_i_prediction_algorithms) == 0:
print("No MHC class I prediction algorithms chosen. Skipping MHC class I predictions.")
Expand Down

0 comments on commit 255ac2d

Please sign in to comment.