WrightonLabCSU / DRAM

Distilled and Refined Annotation of Metabolism: A tool for the annotation and curation of function for microbial and viral genomes
GNU General Public License v3.0
239 stars 50 forks source link

Error at "Getting descriptions of hits from peptidase" step #222

Closed Ahmed-Shibl closed 1 year ago

Ahmed-Shibl commented 1 year ago

Hi Dram developers and users. Excited to use this tool!

We've recently installed DRAM and successfully downloaded the databases on our HPC cluster. Running DRAM-setup.py print_config gives me this output:

Processed search databases
KEGG db: None
KOfam db: /scratch/Reference_Genomes/In_house/Metagenomic/oral_microbiome/dram/kofam_profiles.hmm
KOfam KO list: /scratch/Reference_Genomes/In_house/Metagenomic/oral_microbiome/dram/kofam_ko_list.tsv
UniRef db: /scratch/Reference_Genomes/In_house/Metagenomic/oral_microbiome/dram/uniref90.20220912.mmsdb
Pfam db: /scratch/Reference_Genomes/In_house/Metagenomic/oral_microbiome/dram/pfam.mmspro
dbCAN db: /scratch/Reference_Genomes/In_house/Metagenomic/oral_microbiome/dram/dbCAN-HMMdb-V10.txt
RefSeq Viral db: /scratch/Reference_Genomes/In_house/Metagenomic/oral_microbiome/dram/refseq_viral.20220912.mmsdb
MEROPS peptidase db: /scratch/Reference_Genomes/In_house/Metagenomic/oral_microbiome/dram/peptidases.20220912.mmsdb
VOGDB db: /scratch/Reference_Genomes/In_house/Metagenomic/oral_microbiome/dram/vog_latest_hmms.txt

Descriptions of search database entries
Pfam hmm dat: /scratch/Reference_Genomes/In_house/Metagenomic/oral_microbiome/dram/Pfam-A.hmm.dat.gz
dbCAN family activities: /scratch/Reference_Genomes/In_house/Metagenomic/oral_microbiome/dram/CAZyDB.07292021.fam-activities.txt
VOG annotations: /scratch/Reference_Genomes/In_house/Metagenomic/oral_microbiome/dram/vog_annotations_latest.tsv.gz

Description db: description_db.sqlite

DRAM distillation sheets
Genome summary form: /scratch/Reference_Genomes/In_house/Metagenomic/oral_microbiome/dram/genome_summary_form.20220912.tsv
Module step form: /scratch/Reference_Genomes/In_house/Metagenomic/oral_microbiome/dram/module_step_form.20220912.tsv
ETC module database: /scratch/Reference_Genomes/In_house/Metagenomic/oral_microbiome/dram/etc_mdoule_database.20220912.tsv
Function heatmap form: /scratch/Reference_Genomes/In_house/Metagenomic/oral_microbiome/dram/function_heatmap_form.20220912.tsv
AMG database: /scratch/Reference_Genomes/In_house/Metagenomic/oral_microbiome/dram/amg_database.20220912.tsv

However, I get an error with DRAM.py annotate. Here's my command: DRAM.py annotate -i '/scratch/gencore/novaseq/220702_A00534_0101_BHLFKWDSXX/Unaligned/data/analysis/CH_NA0009561695_S222/reassemble/reassembled_bins/*.fa' -o ~/400MGS/data/analysis/CH_NA0009561695_S222/dram --gtdb_taxonomy /scratch/gencore/novaseq/220702_A00534_0101_BHLFKWDSXX/Unaligned/data/analysis/CH_NA0009561695_S222/gtdbtk/gtdbtk.bac120.summary.tsv --threads 16 --verbose

and here's the output with the error at the end:

7 fastas found
2022-09-17 11:03:34.613823: Annotation started
/scratch/gencore/.eb/2.0/software/dram/1.3.5/lib/python3.10/site-packages/mag_annotator/database_handler.py:51: UserWarning: Database does not exist at path description_db.sqlite
  warnings.warn('Database does not exist at path %s' % self.description_loc)
0:00:00.002033: Retrieved database locations and descriptions
0:00:00.002066: Annotating bin.1.strict
-------------------------------------
PRODIGAL v2.6.3 [February, 2016]         
Univ of Tenn / Oak Ridge National Lab
Doug Hyatt, Loren Hauser, et al.     
-------------------------------------
Request:  Metagenomic, Phase:  Training
Initializing training files...done!
-------------------------------------
Request:  Metagenomic, Phase:  Gene Finding
Finding genes in sequence #1 (371467 bp)...done!
Finding genes in sequence #2 (199027 bp)...done!
Finding genes in sequence #3 (198810 bp)...done!
Finding genes in sequence #4 (194920 bp)...done!
Finding genes in sequence #5 (111209 bp)...done!
Finding genes in sequence #6 (108372 bp)...done!
Finding genes in sequence #7 (102905 bp)...done!
Finding genes in sequence #8 (96407 bp)...done!
Finding genes in sequence #9 (96094 bp)...done!
Finding genes in sequence #10 (93855 bp)...done!
Finding genes in sequence #11 (83303 bp)...done!
Finding genes in sequence #12 (76277 bp)...done!
Finding genes in sequence #13 (69880 bp)...done!
Finding genes in sequence #14 (65313 bp)...done!
Finding genes in sequence #15 (60477 bp)...done!
Finding genes in sequence #16 (58576 bp)...done!
Finding genes in sequence #17 (38205 bp)...done!
Finding genes in sequence #18 (37286 bp)...done!
Finding genes in sequence #19 (28511 bp)...done!
Finding genes in sequence #20 (24149 bp)...done!
Finding genes in sequence #21 (22855 bp)...done!
Finding genes in sequence #22 (15390 bp)...done!
Finding genes in sequence #23 (14959 bp)...done!
Finding genes in sequence #24 (10521 bp)...done!
Finding genes in sequence #25 (5518 bp)...done!
Finding genes in sequence #26 (5189 bp)...done!
Finding genes in sequence #27 (3865 bp)...done!
Finding genes in sequence #28 (3449 bp)...done!
Finding genes in sequence #29 (2809 bp)...done!
0:00:36.740769: Turning genes from prodigal to mmseqs2 db
0:00:50.427019: Getting hits from kofam
0:16:31.850430: Getting forward best hits from peptidase
0:16:46.008236: Getting reverse best hits from peptidase
0:16:48.498903: Getting descriptions of hits from peptidase
Traceback (most recent call last):
  File "/scratch/gencore/.eb/2.0/software/dram/1.3.5/bin/DRAM.py", line 189, in <module>
    args.func(**args_dict)
  File "/scratch/gencore/.eb/2.0/software/dram/1.3.5/lib/python3.10/site-packages/mag_annotator/annotate_bins.py", line 1040, in annotate_bins_cmd
    annotate_bins(list(set(fasta_locs)), output_dir, min_contig_size, prodigal_mode, trans_table, bit_score_threshold,
  File "/scratch/gencore/.eb/2.0/software/dram/1.3.5/lib/python3.10/site-packages/mag_annotator/annotate_bins.py", line 1079, in annotate_bins
    all_annotations = annotate_fastas(fasta_locs, output_dir, db_handler, min_contig_size, prodigal_mode, trans_table,
  File "/scratch/gencore/.eb/2.0/software/dram/1.3.5/lib/python3.10/site-packages/mag_annotator/annotate_bins.py", line 1013, in annotate_fastas
    annotate_fasta(fasta_loc, fasta_name, fasta_dir, db_handler, min_contig_size, prodigal_mode, trans_table,
  File "/scratch/gencore/.eb/2.0/software/dram/1.3.5/lib/python3.10/site-packages/mag_annotator/annotate_bins.py", line 921, in annotate_fasta
    annotations = annotate_orfs(gene_faa, db_handler, tmp_dir, start_time, custom_db_locs, custom_hmm_locs,
  File "/scratch/gencore/.eb/2.0/software/dram/1.3.5/lib/python3.10/site-packages/mag_annotator/annotate_bins.py", line 821, in annotate_orfs
    annotation_list.append(do_blast_style_search(query_db, db_handler.db_locs['peptidase'], tmp_dir,
  File "/scratch/gencore/.eb/2.0/software/dram/1.3.5/lib/python3.10/site-packages/mag_annotator/annotate_bins.py", line 681, in do_blast_style_search
    header_dict = db_handler.get_descriptions(hits['%s_hit' % db_name], '%s_description' % db_name)
  File "/scratch/gencore/.eb/2.0/software/dram/1.3.5/lib/python3.10/site-packages/mag_annotator/database_handler.py", line 75, in get_descriptions
    descriptions = [
  File "/scratch/gencore/.eb/2.0/software/dram/1.3.5/lib/python3.10/site-packages/mag_annotator/database_handler.py", line 78, in <listcomp>
    for des in self.session.query(description_class).filter(description_class.id.in_(chunk)).all() 
AttributeError: 'NoneType' object has no attribute 'query'

Please let me know if you'd need more information to help me with this. Thanks!

Ahmed-Shibl commented 1 year ago

Sorry, just realized this is the same issue raised in #220