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
249 stars 52 forks source link

error with DRAM-v distill #270

Open Qiqi04Tsinghua opened 1 year ago

Qiqi04Tsinghua commented 1 year ago

Hi,

I have already finished the annotation step and get the annotations.tsv file, now I am doing the distill. step. Here is my command line "DRAM-v.py distill -i annotations.tsv -o distilled2". However, I got the error. Please see the below message.

"Traceback (most recent call last): File "/software/anaconda3/envs/DRAM/bin/DRAM-v.py", line 140, in args.func(**args_dict) File "/software/anaconda3/envs/DRAM/lib/python3.9/site-packages/mag_annotator/summarize_vgfs.py", line 223, in summarize_vgfs mkdir(output_dir) FileExistsError: [Errno 17] File exists: 'distilled1' (DRAM) [qiqi@icdli IMGVR_UViG_3300035703_000001.3300035703.Ga0310140_0000041__0_partial-cat_4]$ DRAM-v.py distill -i annotations.tsv -o distilled2 0:00:00.033321: Retrieved database locations and descriptions Traceback (most recent call last): File "/software/anaconda3/envs/DRAM/lib/python3.9/site-packages/pandas/core/indexes/base.py", line 3361, in get_loc return self._engine.get_loc(casted_key) File "pandas/_libs/index.pyx", line 76, in pandas._libs.index.IndexEngine.get_loc File "pandas/_libs/index.pyx", line 108, in pandas._libs.index.IndexEngine.get_loc File "pandas/_libs/hashtable_class_helper.pxi", line 5198, in pandas._libs.hashtable.PyObjectHashTable.get_item File "pandas/_libs/hashtable_class_helper.pxi", line 5206, in pandas._libs.hashtable.PyObjectHashTable.get_item KeyError: 'amg_flags'

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/software/anaconda3/envs/DRAM/bin/DRAM-v.py", line 140, in args.func(**args_dict) File "/software/anaconda3/envs/DRAM/lib/python3.9/site-packages/mag_annotator/summarize_vgfs.py", line 235, in summarize_vgfs potential_amgs = filter_to_amgs(annotations, max_aux=max_auxiliary_score, File "/software/anaconda3/envs/DRAM/lib/python3.9/site-packages/mag_annotator/summarize_vgfs.py", line 47, in filter_to_amgs amg_flags = row['amg_flags'] File "/software/anaconda3/envs/DRAM/lib/python3.9/site-packages/pandas/core/series.py", line 942, in getitem return self._get_value(key) File "/software/anaconda3/envs/DRAM/lib/python3.9/site-packages/pandas/core/series.py", line 1051, in _get_value loc = self.index.get_loc(label) File "/software/anaconda3/envs/DRAM/lib/python3.9/site-packages/pandas/core/indexes/base.py", line 3363, in get_loc raise KeyError(key) from err KeyError: 'amg_flags'"

Could you help me to figure out what is going on?

Best,

Qi

Qiqi04Tsinghua commented 1 year ago

Here is the column name of "annotation.tsv" file : "fasta" "scaffold"
[3] "gene_position" "start_position"
[5] "end_position" "strandedness"
[7] "rank" "kegg_id"
[9] "kegg_hit" "viral_id"
[11] "viral_hit" "viral_RBH"
[13] "viral_identity" "viral_bitScore"
[15] "viral_eVal" "peptidase_id"
[17] "peptidase_family" "peptidase_hit"
[19] "peptidase_RBH" "peptidase_identity"
[21] "peptidase_bitScore" "peptidase_eVal"
[23] "pfam_hits" "cazy_hits"
[25] "vogdb_description" "vogdb_categories"
[27] "heme_regulatory_motif_count"

mladen5000 commented 1 year ago

I am having the same issue but with the key error being "scaffold"

ileleiwi commented 7 months ago

Hi Qiqi04Tsinghua, I got the same KeyError: 'amg_flags' error when I ran a DRAM-v.py distill command on an annotations.tsv that was produced using DRAM.py annotate. If you're trying to distill a DRAMv run make sure you use DRAM-v.py distill. If you're trying to distill a regular DRAM run, make sure you use DRAM.py distill. In other words, you can't distill annotations from a regular DRAM run using DRAMv b/c DRAM-v.py distill expects the amg_flags column to be present in the annotations. I hope that helps

Qiqi04Tsinghua commented 7 months ago

Hi WrightonLabCSU,

Thank you for reminding and explanation!

Best,

Qi

------------------ 原始邮件 ------------------ 发件人: "WrightonLabCSU/DRAM" @.>; 发送时间: 2024年3月5日(星期二) 凌晨1:02 @.>; @.**@.>; 主题: Re: [WrightonLabCSU/DRAM] error with DRAM-v distill (Issue #270)

Hi Qiqi04Tsinghua, I got the same KeyError: 'amg_flags' error when I ran a DRAM-v.py distill command on an annotations.tsv that was produced using DRAM.py annotate. If you're trying to distill a DRAMv run make sure you use DRAM-v.py distill. If you're trying to distill a regular DRAM run, make sure you use DRAM.py distill. In other words, you can't distill annotations from a regular DRAM run using DRAMv b/c DRAM-v.py distill expects the amg_flags column to be present in the annotations. I hope that helps

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>