nick-youngblut / traitar3

From genomes to phenotypes: Traitar3, the microbial trait analyzer (for Python3)
GNU General Public License v3.0
22 stars 4 forks source link

Error: traitar phenotype #6

Open lanlan0210 opened 1 year ago

lanlan0210 commented 1 year ago

Thank you for developing Traitar. I got an error message when I ran the software. The data used is the data in the test file you provided. command: traitar phenotype test samples.txt from_genes output_dir error: usage: traitar phenotype [-h] [-c CPUS] [-x PARALLEL] [-o] [-g {genbank,refseq,img,prodigal,metagenemark}] [-p PRIMARY_MODELS] [-s SECONDARY_MODELS] [-r REARRANGE_HEATMAP] [--no_heatmap_sample_clustering] [--no_heatmap_phenotype_clustering] [-f {png,pdf,svg,jpg}] pfam_dir input_dir sample2file {from_genes,from_nucleotides,from_annotation_summary} output_dir traitar phenotype: error: argument mode: invalid choice: 'output_dir' (choose from 'from_genes', 'from_nucleotides', 'from_annotation_summary'). Can you help me see how to solve it? Looking forward to your reply.

nick-youngblut commented 1 year ago

@lanlan0210 you are probably not providing all of the required positional arguments:

pfam_dir input_dir sample2file
{from_genes,from_nucleotides,from_annotation_summary}
output_dir
lanlan0210 commented 1 year ago

Thank you for your timely reply. The previous problem seems solved, but a new error has appeared. ![Uploading image.png…]() Looking forward to your reply.

evazio commented 1 year ago

Hello,

Same here, I modified the command line as indicated but it gives back this error: FileNotFoundError: [Errno 2] No such file or directory: 'output/annotation/pfam/LBR121___domtblout.dat'

As I understand, this file should be generated by the software. Any ideas on how to solve this? I used the phenotype default traitar phenotype /GENOMICS/genomes/ASSEMBLED/faa/traitar_pfam /GENOMICS/genomes/ASSEMBLED/faa /GENOMICS/genomes/ASSEMBLED/faa/samples.txt from_genes output_traitar

Thank you in advance for the assistance.

mgabriell1 commented 11 months ago

Hello, Same problem here. Below you can find the complete log. Thanks in advance for the help!

2023-10-06 13:48:14,059 - Running annotate as part of predict
2023-10-06 13:48:14,060 - Running annotation with hmmer. This step can take a while. A rough estimate for sequential Pfam annotation of genome samples of ~3 Mbs is 10 min per genome.
2023-10-06 13:48:14,062 - Computing hmms
2023-10-06 13:48:14,063 -   Using existing file (use --overwrite to recreate): Genome00005//traitar_result/Genome00005.faa
2023-10-06 13:48:14,063 -   No. of hmmer commands to run: 0
2023-10-06 13:48:14,063 - Filtering hmm hits
2023-10-06 13:48:14,066 -   File doesn't exist, so creating: Genome00005//traitar_result/phenotypic_predictions/annotation/pfam/Genome00005_filtered_best.dat
2023-10-06 13:48:14,066 -   No. of hmmer filter commands to run: 1
Traceback (most recent call last):
  File "/cluster/project/eawag/p07003/Software/conda/envs/traitar-env/bin/traitar", line 10, in <module>
    sys.exit(main())
  File "/cluster/project/eawag/p07003/Software/conda/envs/traitar-env/lib/python3.10/site-packages/traitar/__main__.py", line 101, in main
    args.func(args)
  File "/cluster/project/eawag/p07003/Software/conda/envs/traitar-env/lib/python3.10/site-packages/traitar/Commands/phenotype.py", line 34, in phenolyze
    p.annotate(args.mode)
  File "/cluster/project/eawag/p07003/Software/conda/envs/traitar-env/lib/python3.10/site-packages/traitar/traitar_cls.py", line 217, in annotate
    self.run_hmmer_annotation(self.s2f.loc[:,'sample_file_name'],
  File "/cluster/project/eawag/p07003/Software/conda/envs/traitar-env/lib/python3.10/site-packages/traitar/traitar_cls.py", line 317, in run_hmmer_annotation
    fae_func(p)
  File "/cluster/project/eawag/p07003/Software/conda/envs/traitar-env/lib/python3.10/site-packages/traitar/hmmer2filtered_best.py", line 98, in _main_par
    main(infile_f, hmm_name, out_best_f)
  File "/cluster/project/eawag/p07003/Software/conda/envs/traitar-env/lib/python3.10/site-packages/traitar/hmmer2filtered_best.py", line 110, in main
    with open(infile_f) as inF:
FileNotFoundError: [Errno 2] No such file or directory: 'Genome00005//traitar_result/phenotypic_predictions/annotation/pfam/Genome00005_domtblout.dat'
nick-youngblut commented 11 months ago

@mgabriell1 do you have write permissions to Genome00005//traitar_result/phenotypic_predictions/annotation/pfam/?

mgabriell1 commented 11 months ago

Assuming that's the relative path in , yes

nick-youngblut commented 11 months ago

Does Genome00005//traitar_result/phenotypic_predictions/annotation/pfam/ actually exist?

mgabriell1 commented 11 months ago

It was created by traitar, but it was empty (hence the error)

nick-youngblut commented 11 months ago

If I had to guess, it could be the quality of your input genome(s). A poor quality genome could result in little or no pfam annotations, which would result in downstream failures of Traitar.

mgabriell1 commented 11 months ago

I don't think that's the case. That specific genome has been called as 99.97% complete by CheckM2 so I'd imagine it should be annotated by PFAM. Also this seem to have happened to others, so it's not something that I've only encountered myself

smta11 commented 5 months ago

Hello everyone, Has this problem been solved? I am getting the same error with test data and appreciate it if someone shares the solution of this problem. Thanks!

nick-youngblut commented 5 months ago

For some reason hmmsearch is not writing an output: https://github.com/nick-youngblut/traitar3/blob/a6d8772cd8cd62fd7cb63defc37a5c48c974f55f/traitar/traitar_cls.py#L283