Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with running scenicplus grn_inference eGRN #551

Open
guoyuh opened this issue Mar 4, 2025 · 0 comments
Open

Issue with running scenicplus grn_inference eGRN #551

guoyuh opened this issue Mar 4, 2025 · 0 comments

Comments

@guoyuh
Copy link

guoyuh commented Mar 4, 2025

hi:
first I run by snakemake ,,I encountered a error as flow:
`Running`` for Negative TF to gene: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 11854/11854 [00:59<00:00, 199.73it/s]
2025-03-04 15:34:40,271 GSEA INFO Subsetting on adjusted pvalue: 1, minimal NES: 0 and minimal leading edge genes 10
2025-03-04 15:34:40,719 GSEA INFO Merging eRegulons
2025-03-04 15:34:47,149 SCENIC+ INFO Formatting eGRN as table.
2025-03-04 15:34:48,050 SCENIC+ INFO Calculating triplet ranking.
2025-03-04 15:34:48,264 cisTarget INFO Reading cisTarget database
Traceback (most recent call last):
File "/mnt/home/guoyuh/miniconda3/envs/scenicplus/lib/python3.11/site-packages/pandas/core/indexes/base.py", line 3802, in get_loc
return self._engine.get_loc(casted_key)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "pandas/_libs/index.pyx", line 138, in pandas._libs.index.IndexEngine.get_loc
File "pandas/_libs/index.pyx", line 165, in pandas._libs.index.IndexEngine.get_loc
File "pandas/_libs/hashtable_class_helper.pxi", line 5745, in pandas._libs.hashtable.PyObjectHashTable.get_item
File "pandas/_libs/hashtable_class_helper.pxi", line 5753, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'chr20:4886520-4887020'

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

Traceback (most recent call last):
File "/mnt/home/guoyuh/miniconda3/envs/scenicplus/bin/scenicplus", line 8, in
sys.exit(main())
^^^^^^
File "/mnt/home/guoyuh/miniconda3/envs/scenicplus/lib/python3.11/site-packages/scenicplus/cli/scenicplus.py", line 1143, in main
args.func(args)
File "/mnt/home/guoyuh/miniconda3/envs/scenicplus/lib/python3.11/site-packages/scenicplus/cli/scenicplus.py", line 861, in eGRN
infer_grn(
File "/mnt/home/guoyuh/miniconda3/envs/scenicplus/lib/python3.11/site-packages/scenicplus/cli/commands.py", line 921, in infer_grn
eRegulon_metadata = calculate_triplet_score(
^^^^^^^^^^^^^^^^^^^^^^^^
File "/mnt/home/guoyuh/miniconda3/envs/scenicplus/lib/python3.11/site-packages/scenicplus/triplet_score.py", line 112, in calculate_triplet_score
TF_to_region_score = np.array([
^
File "/mnt/home/guoyuh/miniconda3/envs/scenicplus/lib/python3.11/site-packages/scenicplus/triplet_score.py", line 113, in
df_TF_region_max_rank.loc[region, TF]
~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
File "/mnt/home/guoyuh/miniconda3/envs/scenicplus/lib/python3.11/site-packages/pandas/core/indexing.py", line 1066, in getitem
return self.obj._get_value(*key, takeable=self._takeable)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/mnt/home/guoyuh/miniconda3/envs/scenicplus/lib/python3.11/site-packages/pandas/core/frame.py", line 3924, in _get_value
row = self.index.get_loc(index)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/mnt/home/guoyuh/miniconda3/envs/scenicplus/lib/python3.11/site-packages/pandas/core/indexes/base.py", line 3804, in get_loc
raise KeyError(key) from err
KeyError: 'chr20:4886520-4887020'
[Tue Mar 4 15:37:10 2025]
Error in rule eGRN_direct:
jobid: 4
input: /mnt/home/guoyuh/projects/SCENIC_PLUS/outs/tf_to_gene_adj.tsv, /mnt/home/guoyuh/projects/SCENIC_PLUS/outs/region_to_gene_adj.tsv, /mnt/home/guoyuh/projects/SCENIC_PLUS/outs/cistromes_direct.h5ad, /mnt/home/guoyuh/projects/SCENIC_PLUS/pycistarget/database/hg38_screen_v10_clust.regions_vs_motifs.rankings.feather
output: /mnt/home/guoyuh/projects/SCENIC_PLUS/outs/eRegulon_direct.tsv
shell:

    scenicplus grn_inference eGRN             --TF_to_gene_adj_fname /mnt/home/guoyuh/projects/SCENIC_PLUS/outs/tf_to_gene_adj.tsv            --region_to_gene_adj_fname /mnt/home/guoyuh/projects/SCENIC_PLUS/outs/region_to_gene_adj.tsv             --cistromes_fname /mnt/home/guoyuh/projects/SCENIC_PLUS/outs/cistromes_direct.h5ad            --ranking_db_fname /mnt/home/guoyuh/projects/SCENIC_PLUS/pycistarget/database/hg38_screen_v10_clust.regions_vs_motifs.rankings.feather             --eRegulon_out_fname /mnt/home/guoyuh/projects/SCENIC_PLUS/outs/eRegulon_direct.tsv             --temp_dir /mnt/home/guoyuh/projects/SCENIC_PLUS/tmp             --order_regions_to_genes_by importance             --order_TFs_to_genes_by importance             --gsea_n_perm 1000             --quantiles 0.85 0.90 0.95             --top_n_regionTogenes_per_gene 5 10 15             --top_n_regionTogenes_per_region              --min_regions_per_gene 0             --rho_threshold 0.05             --min_target_genes 10             --n_cpu 48
    
    (one of the commands exited with non-zero exit code; note that snakemake uses bash strict mode!)

Shutting down, this might take some time.
Exiting because a job execution failed. Look above for error message
Complete log: .snakemake/log/2025-03-04T150039.635926.snakemake.log
WorkflowError:
At least one job did not complete successfully.
I Encountered the same error withcommand ”scenicplus grn_inference eGRN “
$scenicplus grn_inference eGRN \

--TF_to_gene_adj_fname /mnt/home/guoyuh/projects/SCENIC_PLUS/outs/tf_to_gene_adj.tsv
--region_to_gene_adj_fname /mnt/home/guoyuh/projects/SCENIC_PLUS/outs/region_to_gene_adj_filtered.tsv
--cistromes_fname /mnt/home/guoyuh/projects/SCENIC_PLUS/outs/cistromes_direct.h5ad
--ranking_db_fname /mnt/home/guoyuh/projects/SCENIC_PLUS/pycistarget/database/hg38_screen_v10_clust.regions_vs_motifs.rankings.feather
--eRegulon_out_fname /mnt/home/guoyuh/projects/SCENIC_PLUS/outs/eRegulon_direct.tsv
--temp_dir /mnt/home/guoyuh/projects/SCENIC_PLUS/tmp
--order_regions_to_genes_by importance
--order_TFs_to_genes_by importance
--gsea_n_perm 1000
--quantiles 0.85 0.90 0.95
--top_n_regionTogenes_per_gene 5 10 15
--min_regions_per_gene 0
--rho_threshold 0.05
--min_target_genes 10
--n_cpu 48
2025-03-04 16:29:36,869 SCENIC+ INFO Loading TF to gene adjacencies.
2025-03-04 16:29:37,898 SCENIC+ INFO Loading region to gene adjacencies.
2025-03-04 16:29:38,039 SCENIC+ INFO Loading cistromes.
2025-03-04 16:29:38,172 GSEA INFO Thresholding region to gene relationships
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 14/14 [03:32<00:00, 15.19s/it]
2025-03-04 16:33:10,996 GSEA INFO Subsetting TF2G adjacencies for TF with motif.
2025-03-04 16:33:11,127 GSEA INFO Running GSEA...
2025-03-04 16:33:11,128 GSEA INFO Generating rankings...
100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 896/896 [00:04<00:00, 181.74it/s]
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 328/328 [00:00<00:00, 2304.00it/s]
Running for Positive TF to gene: 1%|█▌ | 96/11868 [00:05<11:40, 16.80it/s]/mnt/home/guoyuh/miniconda3/envs/scenicplus/lib/python3.11/site-packages/gseapy/algorithm.py:71: RuntimeWarning: divide by zero encountered in divide
norm_tag = 1.0/sum_correl_tag
/mnt/home/guoyuh/miniconda3/envs/scenicplus/lib/python3.11/site-packages/gseapy/algorithm.py:74: RuntimeWarning: invalid value encountered in multiply
RES = np.cumsum(tag_indicator * correl_vector * norm_tag - no_tag_indicator * norm_no_tag, axis=axis)
/mnt/home/guoyuh/miniconda3/envs/scenicplus/lib/python3.11/site-packages/gseapy/algorithm.py:71: RuntimeWarning: divide by zero encountered in divide
norm_tag = 1.0/sum_correl_tag
/mnt/home/guoyuh/miniconda3/envs/scenicplus/lib/python3.11/site-packages/gseapy/algorithm.py:74: RuntimeWarning: invalid value encountered in multiply
RES = np.cumsum(tag_indicator * correl_vector * norm_tag - no_tag_indicator * norm_no_tag, axis=axis)
/mnt/home/guoyuh/miniconda3/envs/scenicplus/lib/python3.11/site-packages/gseapy/algorithm.py:71: RuntimeWarning: divide by zero encountered in divide
norm_tag = 1.0/sum_correl_tag
/mnt/home/guoyuh/miniconda3/envs/scenicplus/lib/python3.11/site-packages/gseapy/algorithm.py:74: RuntimeWarning: invalid value encountered in multiply
RES = np.cumsum(tag_indicator * correl_vector * norm_tag - no_tag_indicator * norm_no_tag, axis=axis)
/mnt/home/guoyuh/miniconda3/envs/scenicplus/lib/python3.11/site-packages/gseapy/algorithm.py:71: RuntimeWarning: divide by zero encountered in divide
norm_tag = 1.0/sum_correl_tag
/mnt/home/guoyuh/miniconda3/envs/scenicplus/lib/python3.11/site-packages/gseapy/algorithm.py:74: RuntimeWarning: invalid value encountered in multiply
RES = np.cumsum(tag_indicator * correl_vector * norm_tag - no_tag_indicator * norm_no_tag, axis=axis)
/mnt/home/guoyuh/miniconda3/envs/scenicplus/lib/python3.11/site-packages/joblib/externals/loky/process_executor.py:752: UserWarning: A worker stopped while some jobs were given to the executor. This can be caused by a too short worker timeout or by a memory leak.
warnings.warn(
/mnt/home/guoyuh/miniconda3/envs/scenicplus/lib/python3.11/site-packages/gseapy/algorithm.py:71: RuntimeWarning: divide by zero encountered in divide
norm_tag = 1.0/sum_correl_tag
/mnt/home/guoyuh/miniconda3/envs/scenicplus/lib/python3.11/site-packages/gseapy/algorithm.py:74: RuntimeWarning: invalid value encountered in multiply
RES = np.cumsum(tag_indicator * correl_vector * norm_tag - no_tag_indicator * norm_no_tag, axis=axis)
/mnt/home/guoyuh/miniconda3/envs/scenicplus/lib/python3.11/site-packages/gseapy/algorithm.py:71: RuntimeWarning: divide by zero encountered in divide
norm_tag = 1.0/sum_correl_tag
/mnt/home/guoyuh/miniconda3/envs/scenicplus/lib/python3.11/site-packages/gseapy/algorithm.py:74: RuntimeWarning: invalid value encountered in multiply
RES = np.cumsum(tag_indicator * correl_vector * norm_tag - no_tag_indicator * norm_no_tag, axis=axis)
/mnt/home/guoyuh/miniconda3/envs/scenicplus/lib/python3.11/site-packages/gseapy/algorithm.py:71: RuntimeWarning: divide by zero encountered in divide
norm_tag = 1.0/sum_correl_tag
/mnt/home/guoyuh/miniconda3/envs/scenicplus/lib/python3.11/site-packages/gseapy/algorithm.py:74: RuntimeWarning: invalid value encountered in multiply
RES = np.cumsum(tag_indicator * correl_vector * norm_tag - no_tag_indicator * norm_no_tag, axis=axis)
/mnt/home/guoyuh/miniconda3/envs/scenicplus/lib/python3.11/site-packages/gseapy/algorithm.py:71: RuntimeWarning: divide by zero encountered in divide
norm_tag = 1.0/sum_correl_tag
/mnt/home/guoyuh/miniconda3/envs/scenicplus/lib/python3.11/site-packages/gseapy/algorithm.py:74: RuntimeWarning: invalid value encountered in multiply
RES = np.cumsum(tag_indicator * correl_vector * norm_tag - no_tag_indicator * norm_no_tag, axis=axis)
/mnt/home/guoyuh/miniconda3/envs/scenicplus/lib/python3.11/site-packages/gseapy/algorithm.py:71: RuntimeWarning: divide by zero encountered in divide
norm_tag = 1.0/sum_correl_tag
/mnt/home/guoyuh/miniconda3/envs/scenicplus/lib/python3.11/site-packages/gseapy/algorithm.py:74: RuntimeWarning: invalid value encountered in multiply
RES = np.cumsum(tag_indicator * correl_vector * norm_tag - no_tag_indicator * norm_no_tag, axis=axis)
/mnt/home/guoyuh/miniconda3/envs/scenicplus/lib/python3.11/site-packages/gseapy/algorithm.py:71: RuntimeWarning: divide by zero encountered in divide
norm_tag = 1.0/sum_correl_tag
/mnt/home/guoyuh/miniconda3/envs/scenicplus/lib/python3.11/site-packages/gseapy/algorithm.py:74: RuntimeWarning: invalid value encountered in multiply
RES = np.cumsum(tag_indicator * correl_vector * norm_tag - no_tag_indicator * norm_no_tag, axis=axis)
/mnt/home/guoyuh/miniconda3/envs/scenicplus/lib/python3.11/site-packages/gseapy/algorithm.py:71: RuntimeWarning: divide by zero encountered in divide
norm_tag = 1.0/sum_correl_tag
/mnt/home/guoyuh/miniconda3/envs/scenicplus/lib/python3.11/site-packages/gseapy/algorithm.py:74: RuntimeWarning: invalid value encountered in multiply
RES = np.cumsum(tag_indicator * correl_vector * norm_tag - no_tag_indicator * norm_no_tag, axis=axis)
/mnt/home/guoyuh/miniconda3/envs/scenicplus/lib/python3.11/site-packages/gseapy/algorithm.py:71: RuntimeWarning: divide by zero encountered in divide
norm_tag = 1.0/sum_correl_tag
/mnt/home/guoyuh/miniconda3/envs/scenicplus/lib/python3.11/site-packages/gseapy/algorithm.py:74: RuntimeWarning: invalid value encountered in multiply
RES = np.cumsum(tag_indicator * correl_vector * norm_tag - no_tag_indicator * norm_no_tag, axis=axis)
/mnt/home/guoyuh/miniconda3/envs/scenicplus/lib/python3.11/site-packages/gseapy/algorithm.py:71: RuntimeWarning: divide by zero encountered in divide
norm_tag = 1.0/sum_correl_tag
/mnt/home/guoyuh/miniconda3/envs/scenicplus/lib/python3.11/site-packages/gseapy/algorithm.py:74: RuntimeWarning: invalid value encountered in multiply
RES = np.cumsum(tag_indicator * correl_vector * norm_tag - no_tag_indicator * norm_no_tag, axis=axis)
Running for Positive TF to gene: 1%|█▌ | 96/11868 [00:24<11:40, 16.80it/s]/mnt/home/guoyuh/miniconda3/envs/scenicplus/lib/python3.11/site-packages/gseapy/algorithm.py:71: RuntimeWarning: divide by zero encountered in divide
norm_tag = 1.0/sum_correl_tag
/mnt/home/guoyuh/miniconda3/envs/scenicplus/lib/python3.11/site-packages/gseapy/algorithm.py:74: RuntimeWarning: invalid value encountered in multiply
RES = np.cumsum(tag_indicator * correl_vector * norm_tag - no_tag_indicator * norm_no_tag, axis=axis)
/mnt/home/guoyuh/miniconda3/envs/scenicplus/lib/python3.11/site-packages/gseapy/algorithm.py:71: RuntimeWarning: divide by zero encountered in divide
norm_tag = 1.0/sum_correl_tag
/mnt/home/guoyuh/miniconda3/envs/scenicplus/lib/python3.11/site-packages/gseapy/algorithm.py:74: RuntimeWarning: invalid value encountered in multiply
RES = np.cumsum(tag_indicator * correl_vector * norm_tag - no_tag_indicator * norm_no_tag, axis=axis)
Running for Positive TF to gene: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 11868/11868 [02:52<00:00, 68.76it/s]
Running for Negative TF to gene: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 11868/11868 [01:14<00:00, 159.21it/s]
2025-03-04 16:37:25,489 GSEA INFO Subsetting on adjusted pvalue: 1, minimal NES: 0 and minimal leading edge genes 10
2025-03-04 16:37:25,900 GSEA INFO Merging eRegulons
2025-03-04 16:37:33,185 SCENIC+ INFO Formatting eGRN as table.
2025-03-04 16:37:34,215 SCENIC+ INFO Calculating triplet ranking.
2025-03-04 16:37:34,521 cisTarget INFO Reading cisTarget database
Traceback (most recent call last):
File "/mnt/home/guoyuh/miniconda3/envs/scenicplus/lib/python3.11/site-packages/pandas/core/indexes/base.py", line 3802, in get_loc
return self._engine.get_loc(casted_key)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "pandas/_libs/index.pyx", line 138, in pandas._libs.index.IndexEngine.get_loc
File "pandas/_libs/index.pyx", line 165, in pandas._libs.index.IndexEngine.get_loc
File "pandas/_libs/hashtable_class_helper.pxi", line 5745, in pandas._libs.hashtable.PyObjectHashTable.get_item
File "pandas/_libs/hashtable_class_helper.pxi", line 5753, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'chr6:14122987-14123487'

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

Traceback (most recent call last):
File "/mnt/home/guoyuh/miniconda3/envs/scenicplus/bin/scenicplus", line 8, in
sys.exit(main())
^^^^^^
File "/mnt/home/guoyuh/miniconda3/envs/scenicplus/lib/python3.11/site-packages/scenicplus/cli/scenicplus.py", line 1143, in main
args.func(args)
File "/mnt/home/guoyuh/miniconda3/envs/scenicplus/lib/python3.11/site-packages/scenicplus/cli/scenicplus.py", line 861, in eGRN
infer_grn(
File "/mnt/home/guoyuh/miniconda3/envs/scenicplus/lib/python3.11/site-packages/scenicplus/cli/commands.py", line 921, in infer_grn
eRegulon_metadata = calculate_triplet_score(
^^^^^^^^^^^^^^^^^^^^^^^^
File "/mnt/home/guoyuh/miniconda3/envs/scenicplus/lib/python3.11/site-packages/scenicplus/triplet_score.py", line 112, in calculate_triplet_score
TF_to_region_score = np.array([
^
File "/mnt/home/guoyuh/miniconda3/envs/scenicplus/lib/python3.11/site-packages/scenicplus/triplet_score.py", line 113, in
df_TF_region_max_rank.loc[region, TF]
~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
File "/mnt/home/guoyuh/miniconda3/envs/scenicplus/lib/python3.11/site-packages/pandas/core/indexing.py", line 1066, in getitem
return self.obj._get_value(*key, takeable=self._takeable)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/mnt/home/guoyuh/miniconda3/envs/scenicplus/lib/python3.11/site-packages/pandas/core/frame.py", line 3924, in _get_value
row = self.index.get_loc(index)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/mnt/home/guoyuh/miniconda3/envs/scenicplus/lib/python3.11/site-packages/pandas/core/indexes/base.py", line 3804, in get_loc
raise KeyError(key) from err
KeyError: 'chr6:14122987-14123487'
`
Who can tell me the reason for this KeyError? ,thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant