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

AttributeError: 'NoneType' object has no attribute 'query' in Dram 1.3.5 #220

Closed jayramr closed 1 year ago

jayramr commented 1 year ago

Dram version 1.3.5

DRAM-setup.py prepare_databases
DRAM-setup.py update_description_db --output_loc description_db.sqlite

DRAM.py annotate -i *.fa -o dram --gtdb_taxonomy gtdbtk.bac120.summary.tsv --threads 4 --verbose

Got error as below

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](http://description_class.id.in/)_(chunk)).all()
AttributeError: 'NoneType' object has no attribute 'query'
jayramr commented 1 year ago

Issue resolved after correcting the --description_db_loc

DRAM-setup.py set_database_locations --description_db_loc /scratch/Reference_Genomes/In_house/Metagenomic/oral_microbiome/dram/description_db.sqlite

Hence closing this ticket