loosolab / UROPA

Universal RObust Peak Annotator
https://uropa-manual.readthedocs.io/
MIT License
15 stars 6 forks source link

UROPA run error #21

Closed deep-buddingcoder closed 1 year ago

deep-buddingcoder commented 1 year ago

Hi following is my config file: { "queries":[ {"feature":["3UTR", "5UTR", "exon", "transcript"], "feature.anchor":["start", "center", "end"], "distance":[100000, 100000], "strand":"ignore", "direction":"", "internals":"0.01", "filter.attribute":["gene_id", "gene_name"], "attribute.value":"None", "show.attributes":["gene_id", "transcript_id", "gene_name"] } ], "priority":"False", "gtf":"hg38.000001405.40-RS_2023_03.ncbiRefSeq.gtf", "bed":"16D_Ctrl_E10d_AccDNA40-100_catenated_peaks_sorted_merged.bed" }

following is my UROPA command: $ uropa --bed 16D_Ctrl_E10d_AccDNA40-100_catenated_peaks_sorted_merged.bed --gtf hg38.000001405.40-RS_2023_03.ncbiRefSeq.gtf --input uropa_config_v1.json --prefix 16D_Ctrl_E10d_AccDNA40-100_peaks_merged --outdir 16D_Ctrl_E10d_AccDNA40-100_catenated_peaks_sorted_merged --output-by-query --summary --threads 33 --log uropa.log --debug

Following is my error: `2023-05-11 15:00:12 (6617) [ERROR] Multiprocessing task exited with error: <class 'TypeError'> 2023-05-11 15:00:12 (6617) [ERROR] Please check previous warnings for resolving the issue. 2023-05-11 15:00:12 (9161) [DEBUG] Annotating peaks in chunk 9 2023-05-11 15:00:12 (6617) [ERROR] Full traceback: multiprocessing.pool.RemoteTraceback: """ Traceback (most recent call last): File "/home/deep/miniconda3/envs/uropa/lib/python3.10/multiprocessing/pool.py", line 125, in worker result = (True, func(*args, **kwds)) File "/home/deep/miniconda3/envs/uropa/lib/python3.10/site-packages/uropa/annotation.py", line 358, in annotate_peaks valid_annotations = annotate_single_peak(peak, tabix_obj, cfg_dict, logger=logger) File "/home/deep/miniconda3/envs/uropa/lib/python3.10/site-packages/uropa/annotation.py", line 269, in annotate_single_peak if query["filter_attribute"] in anno_dict["feat_attributes"]: TypeError: unhashable type: 'list' """

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

Traceback (most recent call last): File "/home/deep/miniconda3/envs/uropa/lib/python3.10/site-packages/uropa/uropa.py", line 506, in main task.get() #either successful or exited with exception File "/home/deep/miniconda3/envs/uropa/lib/python3.10/multiprocessing/pool.py", line 774, in get raise self._value TypeError: unhashable type: 'list'

2023-05-11 15:00:12 (6757) [ERROR] Logger lost connection to queue - probably due to an error raised from a child process.`

I am not sure which list is unhashable type.

Any advice to fix the error will be highly appreciated.

Thanks

deep-buddingcoder commented 1 year ago

I have narrowed down the reason for the error, following key:value pair in config file is causing the error. "filter.attribute":["gene_id", "gene_name"], "attribute.value":"None",

Any suggestion how to fix the config file to overcome the error. Thanks

msbentsen commented 1 year ago

Hi @deep-buddingcoder

Thank you for your issue. I noticed a bug in UROPA where we don't check for the input of filter.attribute, and have fixed this on the dev branch now. You can solve it now by only setting one "filter.attribute" value, for example like shown in the example config: https://github.com/loosolab/UROPA/blob/cce6b86df4e53f3330791596fba23d20902f3bb1/sample_config.json#L5

Do you want to only have those annotations with gene_id and gene_name attributes? This is unfortunately not possible directly, but you can use "filter.attribute" to select attributes with values as given in "attribute.value". Hope this helps.

deep-buddingcoder commented 1 year ago

Thanks for your reply and explanation. I believe, in my case, I don't really need to filter the annotation based on attribute and its value. So I will skip this factor in the config file. Nevertheless, your explanation improves my understanding of the usage of 'filter_attribute'.