TRON-Bioinformatics / neofox

Annotation of mutated peptide sequences with published or novel potential neoantigen descriptors
GNU General Public License v3.0
25 stars 6 forks source link

Update Dockerfile to automatically configure PRIME again #11

Closed aromberg closed 1 year ago

aromberg commented 1 year ago

Hi everyone!

Testing the installation resulted in the following error for me:

# neofox --candidate-file test_data.tsv --patient-data test_patients.tsv --output-folder  output --with-table --with-json --output-prefix test

[I 220913 19:51:05 command_line:157] NeoFox v0.6.4
[I 220913 19:51:08 neofox:130] Data loaded
[I 220913 19:51:08 neofox:202] Starting NeoFox annotations...
[E 220913 19:53:16 runner:51] Finished command with return code 1
[E 220913 19:53:16 runner:52] PRIME not found.

[E 220913 19:53:16 runner:53] 
[E 220913 19:53:16 neofox:276] Error processing neoantigen {'patientIdentifier': 'Ptx', 'gene': 'BRCA2', 'mutation': {'position': [14], 'wildTypeXmer': 'AAAAAAAAAAAAAFAAAAAAAAAAAAA', 'mutatedXmer': 'AAAAAAAAAAAAALAAAAAAAAAAAAA'}, 'rnaExpression': 0.519506894, 'imputedGeneExpression': 0.5365996317, 'dnaVariantAlleleFrequency': 0.857, 'rnaVariantAlleleFrequency': 0.294, 'neofoxAnnotations': {'annotator': 'NeoFox', 'annotatorVersion': '0.6.4', 'timestamp': '20220913195121496077', 'resources': [{'name': 'netMHCpan', 'version': '4.1'}, {'name': 'netMHCIIpan', 'version': '4.0'}, {'name': 'mixMHCpred', 'version': '2.1'}, {'name': 'mixMHC2pred', 'version': '1.2'}, {'name': 'IEDB', 'url': 'http://www.iedb.org/downloader.php?file_name=doc/tcell_full_v3.zip', 'hash': '9f77e294ab978785d15f5e893090a81d', 'downloadTimestamp': '20220913184513'}, {'name': 'IMGT/HLA database', 'version': '3.49.0', 'url': 'https://raw.githubusercontent.com/ANHIG/IMGTHLA/Latest/Allelelist.txt', 'hash': '1ce563f9a61dfbeb4779edb046efeb32', 'downloadTimestamp': '20220913184513'}, {'name': 'Human Uniprot proteome', 'version': '2022_03', 'url': 'https://ftp.uniprot.org/pub/databases/uniprot/current_release/knowledgebase/reference_proteomes/Eukaryota/UP000005640/UP000005640_9606.fasta.gz', 'hash': 'b1c6ee8e7401a80b1baa6f4444324ccf', 'downloadTimestamp': '20220913184513'}, {'name': 'Human Uniprot proteome isoforms', 'version': '2022_03', 'url': 'https://ftp.uniprot.org/pub/databases/uniprot/current_release/knowledgebase/reference_proteomes/Eukaryota/UP000005640/UP000005640_9606_additional.fasta.gz', 'hash': 'cdde07087d43773e774352de17b911ab', 'downloadTimestamp': '20220913184513'}, {'name': 'Mouse Uniprot proteome', 'version': '2022_03', 'url': 'https://ftp.uniprot.org/pub/databases/uniprot/current_release/knowledgebase/reference_proteomes/Eukaryota/UP000000589/UP000000589_10090.fasta.gz', 'hash': '6fa527105f111207e25d7d761317b730', 'downloadTimestamp': '20220913184513'}, {'name': 'Mouse Uniprot proteome isoforms', 'version': '2022_03', 'url': 'https://ftp.uniprot.org/pub/databases/uniprot/current_release/knowledgebase/reference_proteomes/Eukaryota/UP000000589/UP000000589_10090_additional.fasta.gz', 'hash': 'fe3598bba24825393c4ca6667d3c8956', 'downloadTimestamp': '20220913184513'}]}}
[E 220913 19:53:16 neofox:277] Error processing patient {'identifier': 'Ptx', 'isRnaAvailable': True, 'tumorType': 'SKCM', 'mhc1': [{'zygosity': 'HETEROZYGOUS', 'alleles': [{'fullName': 'HLA-A*03:01', 'name': 'HLA-A*03:01', 'gene': 'A', 'group': '03', 'protein': '01'}, {'fullName': 'HLA-A*02:01', 'name': 'HLA-A*02:01', 'gene': 'A', 'group': '02', 'protein': '01'}]}, {'name': 'B', 'zygosity': 'HETEROZYGOUS', 'alleles': [{'fullName': 'HLA-B*07:02', 'name': 'HLA-B*07:02', 'gene': 'B', 'group': '07', 'protein': '02'}, {'fullName': 'HLA-B*40:01', 'name': 'HLA-B*40:01', 'gene': 'B', 'group': '40', 'protein': '01'}]}, {'name': 'C', 'zygosity': 'HETEROZYGOUS', 'alleles': [{'fullName': 'HLA-C*07:02', 'name': 'HLA-C*07:02', 'gene': 'C', 'group': '07', 'protein': '02'}, {'fullName': 'HLA-C*03:04', 'name': 'HLA-C*03:04', 'gene': 'C', 'group': '03', 'protein': '04'}]}], 'mhc2': [{'name': 'DP', 'genes': [{'name': 'DPA1', 'alleles': [{'fullName': 'HLA-DPA1*01:03', 'name': 'HLA-DPA1*01:03', 'gene': 'DPA1', 'group': '01', 'protein': '03'}]}, {'name': 'DPB1', 'zygosity': 'HETEROZYGOUS', 'alleles': [{'fullName': 'HLA-DPB1*02:01', 'name': 'HLA-DPB1*02:01', 'gene': 'DPB1', 'group': '02', 'protein': '01'}, {'fullName': 'HLA-DPB1*06:01', 'name': 'HLA-DPB1*06:01', 'gene': 'DPB1', 'group': '06', 'protein': '01'}]}], 'isoforms': [{'name': 'HLA-DPA1*01:03-DPB1*02:01', 'alphaChain': {'fullName': 'HLA-DPA1*01:03', 'name': 'HLA-DPA1*01:03', 'gene': 'DPA1', 'group': '01', 'protein': '03'}, 'betaChain': {'fullName': 'HLA-DPB1*02:01', 'name': 'HLA-DPB1*02:01', 'gene': 'DPB1', 'group': '02', 'protein': '01'}}, {'name': 'HLA-DPA1*01:03-DPB1*06:01', 'alphaChain': {'fullName': 'HLA-DPA1*01:03', 'name': 'HLA-DPA1*01:03', 'gene': 'DPA1', 'group': '01', 'protein': '03'}, 'betaChain': {'fullName': 'HLA-DPB1*06:01', 'name': 'HLA-DPB1*06:01', 'gene': 'DPB1', 'group': '06', 'protein': '01'}}]}, {'name': 'DQ', 'genes': [{'name': 'DQA1', 'zygosity': 'HETEROZYGOUS', 'alleles': [{'fullName': 'HLA-DQA1*01:02', 'name': 'HLA-DQA1*01:02', 'gene': 'DQA1', 'group': '01', 'protein': '02'}, {'fullName': 'HLA-DQA1*03:01', 'name': 'HLA-DQA1*03:01', 'gene': 'DQA1', 'group': '03', 'protein': '01'}]}, {'name': 'DQB1', 'zygosity': 'HETEROZYGOUS', 'alleles': [{'fullName': 'HLA-DQB1*06:02', 'name': 'HLA-DQB1*06:02', 'gene': 'DQB1', 'group': '06', 'protein': '02'}, {'fullName': 'HLA-DQB1*03:02', 'name': 'HLA-DQB1*03:02', 'gene': 'DQB1', 'group': '03', 'protein': '02'}]}], 'isoforms': [{'name': 'HLA-DQA1*01:02-DQB1*06:02', 'alphaChain': {'fullName': 'HLA-DQA1*01:02', 'name': 'HLA-DQA1*01:02', 'gene': 'DQA1', 'group': '01', 'protein': '02'}, 'betaChain': {'fullName': 'HLA-DQB1*06:02', 'name': 'HLA-DQB1*06:02', 'gene': 'DQB1', 'group': '06', 'protein': '02'}}, {'name': 'HLA-DQA1*01:02-DQB1*03:02', 'alphaChain': {'fullName': 'HLA-DQA1*01:02', 'name': 'HLA-DQA1*01:02', 'gene': 'DQA1', 'group': '01', 'protein': '02'}, 'betaChain': {'fullName': 'HLA-DQB1*03:02', 'name': 'HLA-DQB1*03:02', 'gene': 'DQB1', 'group': '03', 'protein': '02'}}, {'name': 'HLA-DQA1*03:01-DQB1*06:02', 'alphaChain': {'fullName': 'HLA-DQA1*03:01', 'name': 'HLA-DQA1*03:01', 'gene': 'DQA1', 'group': '03', 'protein': '01'}, 'betaChain': {'fullName': 'HLA-DQB1*06:02', 'name': 'HLA-DQB1*06:02', 'gene': 'DQB1', 'group': '06', 'protein': '02'}}, {'name': 'HLA-DQA1*03:01-DQB1*03:02', 'alphaChain': {'fullName': 'HLA-DQA1*03:01', 'name': 'HLA-DQA1*03:01', 'gene': 'DQA1', 'group': '03', 'protein': '01'}, 'betaChain': {'fullName': 'HLA-DQB1*03:02', 'name': 'HLA-DQB1*03:02', 'gene': 'DQB1', 'group': '03', 'protein': '02'}}]}, {'genes': [{'zygosity': 'HETEROZYGOUS', 'alleles': [{'fullName': 'HLA-DRB1*04:04', 'name': 'HLA-DRB1*04:04', 'gene': 'DRB1', 'group': '04', 'protein': '04'}, {'fullName': 'HLA-DRB1*15:01', 'name': 'HLA-DRB1*15:01', 'gene': 'DRB1', 'group': '15', 'protein': '01'}]}], 'isoforms': [{'name': 'HLA-DRB1*04:04', 'betaChain': {'fullName': 'HLA-DRB1*04:04', 'name': 'HLA-DRB1*04:04', 'gene': 'DRB1', 'group': '04', 'protein': '04'}}, {'name': 'HLA-DRB1*15:01', 'betaChain': {'fullName': 'HLA-DRB1*15:01', 'name': 'HLA-DRB1*15:01', 'gene': 'DRB1', 'group': '15', 'protein': '01'}}]}]}
distributed.worker - WARNING - Compute Failed
Function:  annotate_neoantigen
args:      (Neoantigen(patient_identifier='Ptx', gene='BRCA2', mutation=Mutation(position=[14], wild_type_xmer='AAAAAAAAAAAAAFAAAAAAAAAAAAA', mutated_xmer='AAAAAAAAAAAAALAAAAAAAAAAAAA'), rna_expression=0.519506894, imputed_gene_expression=0.5365996317, dna_variant_allele_frequency=0.857, rna_variant_allele_frequency=0.294, neofox_annotations=NeoantigenAnnotations(annotations=[], annotator='NeoFox', annotator_version='0.6.4', timestamp='20220913195121496077', resources=[Resource(name='netMHCpan', version='4.1', url='', hash='', download_timestamp=''), Resource(name='netMHCIIpan', version='4.0', url='', hash='', download_timestamp=''), Resource(name='mixMHCpred', version='2.1', url='', hash='', download_timestamp=''), Resource(name='mixMHC2pred', version='1.2', url='', hash='', download_timestamp=''), Resource(name='IEDB', version='', url='http://www.iedb.org/downloader.php?file_name=doc/tcell_full_v3.zip', hash='9f77e294ab978785d15f5e893090a81d', download_timestamp='20220913184513'), Resource(name
kwargs:    {}
Exception: 'NeofoxCommandException("Error running command \'/app/PRIME-master/PRIME -a A0301,A0201,B0702,B4001,C0702,C0304 -i /tmp/tmp_sequence_nps7feyh.fasta -o /tmp/primeyb2gwade.txt -mix /app/MixMHCpred-2.1/MixMHCpred\'")'

[E 220913 19:53:16 command_line:208] Error running command '/app/PRIME-master/PRIME -a A0301,A0201,B0702,B4001,C0702,C0304 -i /tmp/tmp_sequence_nps7feyh.fasta -o /tmp/primeyb2gwade.txt -mix /app/MixMHCpred-2.1/MixMHCpred'
    Traceback (most recent call last):
      File "/usr/local/lib/python3.7/site-packages/neofox/command_line.py", line 197, in neofox_cli
        affinity_threshold=affinity_threshold
      File "/usr/local/lib/python3.7/site-packages/neofox/neofox.py", line 206, in get_annotations
        annotations = self.send_to_client(dask_client)
      File "/usr/local/lib/python3.7/site-packages/neofox/neofox.py", line 243, in send_to_client
        annotated_neoantigens = dask_client.gather(futures)
      File "/usr/local/lib/python3.7/site-packages/distributed/client.py", line 2152, in gather
        asynchronous=asynchronous,
      File "/usr/local/lib/python3.7/site-packages/distributed/utils.py", line 310, in sync
        self.loop, func, *args, callback_timeout=callback_timeout, **kwargs
      File "/usr/local/lib/python3.7/site-packages/distributed/utils.py", line 376, in sync
        raise exc.with_traceback(tb)
      File "/usr/local/lib/python3.7/site-packages/distributed/utils.py", line 349, in f
        result = yield future
      File "/usr/local/lib/python3.7/site-packages/tornado/gen.py", line 769, in run
        value = future.result()
      File "/usr/local/lib/python3.7/site-packages/distributed/client.py", line 2009, in _gather
        raise exception.with_traceback(traceback)
      File "/usr/local/lib/python3.7/site-packages/neofox/neofox.py", line 278, in annotate_neoantigen
        raise e
      File "/usr/local/lib/python3.7/site-packages/neofox/neofox.py", line 274, in annotate_neoantigen
        ).get_annotation(neoantigen, patient)
      File "/usr/local/lib/python3.7/site-packages/neofox/annotator.py", line 132, in get_annotation
        ) = self._compute_long_running_tasks(neoantigen, patient)
      File "/usr/local/lib/python3.7/site-packages/neofox/annotator.py", line 422, in _compute_long_running_tasks
        patient,
      File "/usr/local/lib/python3.7/site-packages/neofox/annotator.py", line 560, in run_prime
        return prime.get_annotations(mutation=neoantigen.mutation, mhc=patient.mhc1, uniprot=self.uniprot)
      File "/usr/local/lib/python3.7/site-packages/neofox/published_features/prime.py", line 138, in get_annotations
        mhc=mhc, mutation=mutation, uniprot=uniprot
      File "/usr/local/lib/python3.7/site-packages/neofox/published_features/prime.py", line 120, in run
        results = self._prime(mhc1_alleles, potential_ligand_sequences)
      File "/usr/local/lib/python3.7/site-packages/neofox/published_features/prime.py", line 93, in _prime
        cmd=command
      File "/usr/local/lib/python3.7/site-packages/neofox/helpers/runner.py", line 55, in run_command
        "Error running command '{}'".format(" ".join(cmd))
    neofox.exceptions.NeofoxCommandException: Error running command '/app/PRIME-master/PRIME -a A0301,A0201,B0702,B4001,C0702,C0304 -i /tmp/tmp_sequence_nps7feyh.fasta -o /tmp/primeyb2gwade.txt -mix /app/MixMHCpred-2.1/MixMHCpred'
Traceback (most recent call last):
  File "/usr/local/bin/neofox", line 8, in <module>
    sys.exit(neofox_cli())
  File "/usr/local/lib/python3.7/site-packages/neofox/command_line.py", line 209, in neofox_cli
    raise e
  File "/usr/local/lib/python3.7/site-packages/neofox/command_line.py", line 197, in neofox_cli
    affinity_threshold=affinity_threshold
  File "/usr/local/lib/python3.7/site-packages/neofox/neofox.py", line 206, in get_annotations
    annotations = self.send_to_client(dask_client)
  File "/usr/local/lib/python3.7/site-packages/neofox/neofox.py", line 243, in send_to_client
    annotated_neoantigens = dask_client.gather(futures)
  File "/usr/local/lib/python3.7/site-packages/distributed/client.py", line 2152, in gather
    asynchronous=asynchronous,
  File "/usr/local/lib/python3.7/site-packages/distributed/utils.py", line 310, in sync
    self.loop, func, *args, callback_timeout=callback_timeout, **kwargs
  File "/usr/local/lib/python3.7/site-packages/distributed/utils.py", line 376, in sync
    raise exc.with_traceback(tb)
  File "/usr/local/lib/python3.7/site-packages/distributed/utils.py", line 349, in f
    result = yield future
  File "/usr/local/lib/python3.7/site-packages/tornado/gen.py", line 769, in run
    value = future.result()
  File "/usr/local/lib/python3.7/site-packages/distributed/client.py", line 2009, in _gather
    raise exception.with_traceback(traceback)
  File "/usr/local/lib/python3.7/site-packages/neofox/neofox.py", line 278, in annotate_neoantigen
    raise e
  File "/usr/local/lib/python3.7/site-packages/neofox/neofox.py", line 274, in annotate_neoantigen
    ).get_annotation(neoantigen, patient)
  File "/usr/local/lib/python3.7/site-packages/neofox/annotator.py", line 132, in get_annotation
    ) = self._compute_long_running_tasks(neoantigen, patient)
  File "/usr/local/lib/python3.7/site-packages/neofox/annotator.py", line 422, in _compute_long_running_tasks
    patient,
  File "/usr/local/lib/python3.7/site-packages/neofox/annotator.py", line 560, in run_prime
    return prime.get_annotations(mutation=neoantigen.mutation, mhc=patient.mhc1, uniprot=self.uniprot)
  File "/usr/local/lib/python3.7/site-packages/neofox/published_features/prime.py", line 138, in get_annotations
    mhc=mhc, mutation=mutation, uniprot=uniprot
  File "/usr/local/lib/python3.7/site-packages/neofox/published_features/prime.py", line 120, in run
    results = self._prime(mhc1_alleles, potential_ligand_sequences)
  File "/usr/local/lib/python3.7/site-packages/neofox/published_features/prime.py", line 93, in _prime
    cmd=command
  File "/usr/local/lib/python3.7/site-packages/neofox/helpers/runner.py", line 55, in run_command
    "Error running command '{}'".format(" ".join(cmd))
neofox.exceptions.NeofoxCommandException: Error running command '/app/PRIME-master/PRIME -a A0301,A0201,B0702,B4001,C0702,C0304 -i /tmp/tmp_sequence_nps7feyh.fasta -o /tmp/primeyb2gwade.txt -mix /app/MixMHCpred-2.1/MixMHCpred'

Updating sed -i 's/\/app\/PRIME/\/app\/PRIME-master/g' /app/PRIME-master/PRIME to sed -i 's/PATH_TO_PRIME/app\/PRIME-master/g' /app/PRIME-master/PRIME in the Dockerfile solved the issue for me.

priesgo commented 1 year ago

Thanks for the feedback @aromberg this is now in develop branch ready for the next release