RomoL2 / RegVar

Characterize 3'UTR variants
9 stars 2 forks source link

No module named RBPamp.params when running CharacterizeVariants_single_input #12

Closed Alexei-Lipov closed 6 months ago

Alexei-Lipov commented 6 months ago

When I try running CharacterizeVariants_single_input() in R, I get this error:

library(RegVar) CharacterizeVariants_single_input('~/')3 Error: unexpected numeric constant in "CharacterizeVariants_single_input('~/')3" CharacterizeVariants_single_input('~/') Enter 3'UTR single nucleotide variant chromosome number: 3 Enter variant position in 1-based coordinates: 38549707 Enter hg38 reference base (capitalized) at variant position: C Enter variant base (capitalized): T Enter a name for this variant (no spaces): something gzip: motifs2 already exists; do you wish to overwrite (y or n)? y gzip: motifs2: Is a directory [1] "incorporating eCLIP" [1] "incorporating eQTLS" [1] "incorporating GWAS" [1] "incorporating microRNAs" [1] "incorporating RBP motifs" processing TRNAU1AP.txt Error in py_run_file_impl(file, local, convert) : ModuleNotFoundError: No module named 'RBPamp.params' Run reticulate::py_last_error() for details.

No module named "RBPamp.params" apparently.

Any ideas? Thanks.

RomoL2 commented 6 months ago

That will happen if rbpamp is not installed correctly. Did you have any issues with the conda environment or rbpamp installation?

Lindsay

On Mon, May 6, 2024 at 12:11 PM Alexei-Lipov @.***> wrote:

When I try running CharacterizeVariants_single_input() in R, I get this error:

library(RegVar) CharacterizeVariants_single_input('/')3 Error: unexpected numeric constant in "CharacterizeVariants_single_input(' /')3" CharacterizeVariants_single_input('~/') Enter 3'UTR single nucleotide variant chromosome number: 3 Enter variant position in 1-based coordinates: 38549707 Enter hg38 reference base (capitalized) at variant position: C Enter variant base (capitalized): T Enter a name for this variant (no spaces): something gzip: motifs2 already exists; do you wish to overwrite (y or n)? y gzip: motifs2: Is a directory [1] "incorporating eCLIP" [1] "incorporating eQTLS" [1] "incorporating GWAS" [1] "incorporating microRNAs" [1] "incorporating RBP motifs" processing TRNAU1AP.txt Error in py_run_file_impl(file, local, convert) : ModuleNotFoundError: No module named 'RBPamp.params' Run reticulate::py_last_error() for details.

No module named "RBPamp.params" apparently.

Any ideas? Thanks.

— Reply to this email directly, view it on GitHub https://github.com/RomoL2/RegVar/issues/12, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZOARDHKMVCXE5ZPYRWJX4LZA6TSTAVCNFSM6AAAAABHJKDISKVHI2DSMVQWIX3LMV43ASLTON2WKOZSGI4DCMRTG4YDEMA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

Alexei-Lipov commented 6 months ago

Thank you for the quick response.

RBPamp seems to be installed:

(RBPamp) [lipova@tcn177 motifs2]$ RBPamp -h Usage: RBPamp [options] [path_to_RBNS_splitreads]

Options: -h, --help show this help message and exit --version show version information and quit --name=NAME name of the protein assayed (default=RBP) -o OUTPUT, --output=OUTPUT path where results are to be stored (default='RBPamp') --run-path=RUN pattern for run-folder name (default='run_{datestr}') --ranks=RANKS analyze these ranks out of the best n samples (by top R-value) default=1,2,3,4

I'll try to remove the conda environment, delete all the RegVar folders and re-install everything from scratch and get back to you. Many thanks

RomoL2 commented 6 months ago

Sounds good- you could try reinstalling rbpamp in the conda env first, which would take a lot less time, or just try the whole thing again. It’s strange that it does appear installed but isn’t working. Is that file present in the rbpamp folder? (The params one that was reported missing)?

Lindsay

On Mon, May 6, 2024 at 12:38 PM Alexei-Lipov @.***> wrote:

Thank you for the quick response.

RBPamp seems to be installed:

(RBPamp) @.*** motifs2]$ RBPamp -h Usage: RBPamp [options] [path_to_RBNS_splitreads]

Options: -h, --help show this help message and exit --version show version information and quit --name=NAME name of the protein assayed (default=RBP) -o OUTPUT, --output=OUTPUT path where results are to be stored (default='RBPamp') --run-path=RUN pattern for run-folder name (default='run_{datestr}') --ranks=RANKS analyze these ranks out of the best n samples (by top R-value) default=1,2,3,4

I'll try to remove the conda environment, delete all the RegVar folders and re-install everything scratch and get back to you. Many thanks

— Reply to this email directly, view it on GitHub https://github.com/RomoL2/RegVar/issues/12#issuecomment-2096463215, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZOARDCB6ADHGPYWQ4ZK6GDZA6WYNAVCNFSM6AAAAABHJKDISKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOJWGQ3DGMRRGU . You are receiving this because you commented.Message ID: @.***>

RomoL2 commented 6 months ago

Oh nm it’s a module that didn’t get loaded. Yeah try either rbpamp reinstall or reinstall the conda env and rbpamp.

Lindsay

On Mon, May 6, 2024 at 12:51 PM Lindsay Romo @.***> wrote:

Sounds good- you could try reinstalling rbpamp in the conda env first, which would take a lot less time, or just try the whole thing again. It’s strange that it does appear installed but isn’t working. Is that file present in the rbpamp folder? (The params one that was reported missing)?

Lindsay

On Mon, May 6, 2024 at 12:38 PM Alexei-Lipov @.***> wrote:

Thank you for the quick response.

RBPamp seems to be installed:

(RBPamp) @.*** motifs2]$ RBPamp -h Usage: RBPamp [options] [path_to_RBNS_splitreads]

Options: -h, --help show this help message and exit --version show version information and quit --name=NAME name of the protein assayed (default=RBP) -o OUTPUT, --output=OUTPUT path where results are to be stored (default='RBPamp') --run-path=RUN pattern for run-folder name (default='run_{datestr}') --ranks=RANKS analyze these ranks out of the best n samples (by top R-value) default=1,2,3,4

I'll try to remove the conda environment, delete all the RegVar folders and re-install everything scratch and get back to you. Many thanks

— Reply to this email directly, view it on GitHub https://github.com/RomoL2/RegVar/issues/12#issuecomment-2096463215, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZOARDCB6ADHGPYWQ4ZK6GDZA6WYNAVCNFSM6AAAAABHJKDISKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOJWGQ3DGMRRGU . You are receiving this because you commented.Message ID: @.***>

Alexei-Lipov commented 6 months ago

Hi, I deleted everything, removed the conda environment, and re-installed everything precisely using the lines in the installation guide. Yet I still get this error:

library(RegVar) CharacterizeVariants_single_input('~/') Enter 3'UTR single nucleotide variant chromosome number: 3 Enter variant position in 1-based coordinates: 38549707 Enter hg38 reference base (capitalized) at variant position: C Enter variant base (capitalized): T Enter a name for this variant (no spaces): test gzip: motifs2 already exists; do you wish to overwrite (y or n)? y gzip: motifs2: Is a directory [1] "incorporating eCLIP" [1] "incorporating eQTLS" [1] "incorporating GWAS" [1] "incorporating microRNAs" [1] "incorporating RBP motifs" processing TRNAU1AP.txt Error in py_run_file_impl(file, local, convert) : ModuleNotFoundError: No module named 'RBPamp.params' Run reticulate::py_last_error() for details.

RBPamp does seem to be installed (as before):

(RBPamp) [lipova@tcn322 extdata]$ RBPamp --help Usage: RBPamp [options] [path_to_RBNS_splitreads]

Options: -h, --help show this help message and exit --version show version information and quit --name=NAME name of the protein assayed (default=RBP) -o OUTPUT, --output=OUTPUT path where results are to be stored (default='RBPamp') --run-path=RUN pattern for run-folder name (default='run_{datestr}') --ranks=RANKS analyze these ranks out of the best n samples (by top R-value) default=1,2,3,4

I cannot find "RBPamp.params", in /RegVar/extdata/RBPamp/RBPamp. There is "params.py", but not sure this is the same thing. If you filter by "params" in https://bitbucket.org/marjens/rbpamp/src/master/, then again, you only get "params.py". So not sure what this RBPamp.params is, nor how to get it/install it. Any ideas?

RomoL2 commented 6 months ago

I will try to look into this over the next few days, but in the meantime you could try using the dockerfile. I personally didn’t write the rbpamp code so it always takes me a little to debug. But I will try- it does seem something isn’t installed fully so will try to troubleshoot.

Lindsay

On Tue, May 7, 2024 at 7:30 AM Alexei-Lipov @.***> wrote:

Hi, I deleted everything, removed the conda environment, and re-installed everything precisely using the lines in the installation guide. Yet I still get this error:

library(RegVar) CharacterizeVariants_single_input('~/') Enter 3'UTR single nucleotide variant chromosome number: 3 Enter variant position in 1-based coordinates: 38549707 Enter hg38 reference base (capitalized) at variant position: C Enter variant base (capitalized): T Enter a name for this variant (no spaces): test gzip: motifs2 already exists; do you wish to overwrite (y or n)? y gzip: motifs2: Is a directory [1] "incorporating eCLIP" [1] "incorporating eQTLS" [1] "incorporating GWAS" [1] "incorporating microRNAs" [1] "incorporating RBP motifs" processing TRNAU1AP.txt Error in py_run_file_impl(file, local, convert) : ModuleNotFoundError: No module named 'RBPamp.params' Run reticulate::py_last_error() for details.

RBPamp does seem to be installed (as before):

(RBPamp) @.*** extdata]$ RBPamp --help Usage: RBPamp [options] [path_to_RBNS_splitreads]

Options: -h, --help show this help message and exit --version show version information and quit --name=NAME name of the protein assayed (default=RBP) -o OUTPUT, --output=OUTPUT path where results are to be stored (default='RBPamp') --run-path=RUN pattern for run-folder name (default='run_{datestr}') --ranks=RANKS analyze these ranks out of the best n samples (by top R-value) default=1,2,3,4

I cannot find "RBPamp.params", in /RegVar/extdata/RBPamp/RBPamp. There is "params.py", but not sure this is the same thing. If you filter by "params" in https://bitbucket.org/marjens/rbpamp/src/master/, then again, you only get "params.py". So not what this RBPamp.params is, nor how to get it/install it. Any ideas?

— Reply to this email directly, view it on GitHub https://github.com/RomoL2/RegVar/issues/12#issuecomment-2098188260, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZOARDDP2MSYR3F4VKYPHPTZBC3O7AVCNFSM6AAAAABHJKDISKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOJYGE4DQMRWGA . You are receiving this because you commented.Message ID: @.***>

RomoL2 commented 6 months ago

Can also try including this in the R script which worked for someone a few months ago:

reticulate::use_condaenv('RBPamp', required=TRUE) path_to_python <- "/opt/conda/envs/RBPamp/bin/python" reticulate::use_python(path_to_python, required = TRUE)

On Tue, May 7, 2024 at 8:03 AM Lindsay Romo @.***> wrote:

I will try to look into this over the next few days, but in the meantime you could try using the dockerfile. I personally didn’t write the rbpamp code so it always takes me a little to debug. But I will try- it does seem something isn’t installed fully so will try to troubleshoot.

Lindsay

On Tue, May 7, 2024 at 7:30 AM Alexei-Lipov @.***> wrote:

Hi, I deleted everything, removed the conda environment, and re-installed everything precisely using the lines in the installation guide. Yet I still get this error:

library(RegVar) CharacterizeVariants_single_input('~/') Enter 3'UTR single nucleotide variant chromosome number: 3 Enter variant position in 1-based coordinates: 38549707 Enter hg38 reference base (capitalized) at variant position: C Enter variant base (capitalized): T Enter a name for this variant (no spaces): test gzip: motifs2 already exists; do you wish to overwrite (y or n)? y gzip: motifs2: Is a directory [1] "incorporating eCLIP" [1] "incorporating eQTLS" [1] "incorporating GWAS" [1] "incorporating microRNAs" [1] "incorporating RBP motifs" processing TRNAU1AP.txt Error in py_run_file_impl(file, local, convert) : ModuleNotFoundError: No module named 'RBPamp.params' Run reticulate::py_last_error() for details.

RBPamp does seem to be installed (as before):

(RBPamp) @.*** extdata]$ RBPamp --help Usage: RBPamp [options] [path_to_RBNS_splitreads]

Options: -h, --help show this help message and exit --version show version information and quit --name=NAME name of the protein assayed (default=RBP) -o OUTPUT, --output=OUTPUT path where results are to be stored (default='RBPamp') --run-path=RUN pattern for run-folder name (default='run_{datestr}') --ranks=RANKS analyze these ranks out of the best n samples (by top R-value) default=1,2,3,4

I cannot find "RBPamp.params", in /RegVar/extdata/RBPamp/RBPamp. There is "params.py", but not sure this is the same thing. If you filter by "params" in https://bitbucket.org/marjens/rbpamp/src/master/, then again, you only get "params.py". So not what this RBPamp.params is, nor how to get it/install it. Any ideas?

— Reply to this email directly, view it on GitHub https://github.com/RomoL2/RegVar/issues/12#issuecomment-2098188260, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZOARDDP2MSYR3F4VKYPHPTZBC3O7AVCNFSM6AAAAABHJKDISKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOJYGE4DQMRWGA . You are receiving this because you commented.Message ID: @.***>

RomoL2 commented 6 months ago

If this is the case it’s just a problem calling the conda env from the r script which is easily fixed with below code in the r script for the function- let me know.

On Tue, May 7, 2024 at 8:05 AM Lindsay Romo @.***> wrote:

Can also try including this in the R script which worked for someone a few months ago:

reticulate::use_condaenv('RBPamp', required=TRUE) path_to_python <- "/opt/conda/envs/RBPamp/bin/python" reticulate::use_python(path_to_python, required = TRUE)

On Tue, May 7, 2024 at 8:03 AM Lindsay Romo @.***> wrote:

I will try to look into this over the next few days, but in the meantime you could try using the dockerfile. I personally didn’t write the rbpamp code so it always takes me a little to debug. But I will try- it does seem something isn’t installed fully so will try to troubleshoot.

Lindsay

On Tue, May 7, 2024 at 7:30 AM Alexei-Lipov @.***> wrote:

Hi, I deleted everything, removed the conda environment, and re-installed everything precisely using the lines in the installation guide. Yet I still get this error:

library(RegVar) CharacterizeVariants_single_input('~/') Enter 3'UTR single nucleotide variant chromosome number: 3 Enter variant position in 1-based coordinates: 38549707 Enter hg38 reference base (capitalized) at variant position: C Enter variant base (capitalized): T Enter a name for this variant (no spaces): test gzip: motifs2 already exists; do you wish to overwrite (y or n)? y gzip: motifs2: Is a directory [1] "incorporating eCLIP" [1] "incorporating eQTLS" [1] "incorporating GWAS" [1] "incorporating microRNAs" [1] "incorporating RBP motifs" processing TRNAU1AP.txt Error in py_run_file_impl(file, local, convert) : ModuleNotFoundError: No module named 'RBPamp.params' Run reticulate::py_last_error() for details.

RBPamp does seem to be installed (as before):

(RBPamp) @.*** extdata]$ RBPamp --help Usage: RBPamp [options] [path_to_RBNS_splitreads]

Options: -h, --help show this help message and exit --version show version information and quit --name=NAME name of the protein assayed (default=RBP) -o OUTPUT, --output=OUTPUT path where results are to be stored (default='RBPamp') --run-path=RUN pattern for run-folder name (default='run_{datestr}') --ranks=RANKS analyze these ranks out of the best n samples (by top R-value) default=1,2,3,4

I cannot find "RBPamp.params", in /RegVar/extdata/RBPamp/RBPamp. There is "params.py", but not sure this is the same thing. If you filter by "params" in https://bitbucket.org/marjens/rbpamp/src/master/, then again, you only get "params.py". So not what this RBPamp.params is, nor how to get it/install it. Any ideas?

— Reply to this email directly, view it on GitHub https://github.com/RomoL2/RegVar/issues/12#issuecomment-2098188260, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZOARDDP2MSYR3F4VKYPHPTZBC3O7AVCNFSM6AAAAABHJKDISKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOJYGE4DQMRWGA . You are receiving this because you commented.Message ID: @.***>

RomoL2 commented 6 months ago

Ok, yes, looking back at the code for the single input function, somehow the line of code with the path to python got deleted. My original code is this:

path_to_python<-reticulate::conda_list()[[2]][which(reticulate::conda_list()[[1]]=='RBPamp')] but it should also work with the other user's fix: path_to_python <- "/opt/conda/envs/RBPamp/bin/python"

You need to put that into somewhere around line 322 of the single input function code, and then it should work. Sorry about that- will also fix on the github.

Lindsay

On Tue, May 7, 2024 at 8:08 AM Lindsay Romo @.***> wrote:

If this is the case it’s just a problem calling the conda env from the r script which is easily fixed with below code in the r script for the function- let me know.

On Tue, May 7, 2024 at 8:05 AM Lindsay Romo @.***> wrote:

Can also try including this in the R script which worked for someone a few months ago:

reticulate::use_condaenv('RBPamp', required=TRUE) path_to_python <- "/opt/conda/envs/RBPamp/bin/python" reticulate::use_python(path_to_python, required = TRUE)

On Tue, May 7, 2024 at 8:03 AM Lindsay Romo @.***> wrote:

I will try to look into this over the next few days, but in the meantime you could try using the dockerfile. I personally didn’t write the rbpamp code so it always takes me a little to debug. But I will try- it does seem something isn’t installed fully so will try to troubleshoot.

Lindsay

On Tue, May 7, 2024 at 7:30 AM Alexei-Lipov @.***> wrote:

Hi, I deleted everything, removed the conda environment, and re-installed everything precisely using the lines in the installation guide. Yet I still get this error:

library(RegVar) CharacterizeVariants_single_input('~/') Enter 3'UTR single nucleotide variant chromosome number: 3 Enter variant position in 1-based coordinates: 38549707 Enter hg38 reference base (capitalized) at variant position: C Enter variant base (capitalized): T Enter a name for this variant (no spaces): test gzip: motifs2 already exists; do you wish to overwrite (y or n)? y gzip: motifs2: Is a directory [1] "incorporating eCLIP" [1] "incorporating eQTLS" [1] "incorporating GWAS" [1] "incorporating microRNAs" [1] "incorporating RBP motifs" processing TRNAU1AP.txt Error in py_run_file_impl(file, local, convert) : ModuleNotFoundError: No module named 'RBPamp.params' Run reticulate::py_last_error() for details.

RBPamp does seem to be installed (as before):

(RBPamp) @.*** extdata]$ RBPamp --help Usage: RBPamp [options] [path_to_RBNS_splitreads]

Options: -h, --help show this help message and exit --version show version information and quit --name=NAME name of the protein assayed (default=RBP) -o OUTPUT, --output=OUTPUT path where results are to be stored (default='RBPamp') --run-path=RUN pattern for run-folder name (default='run_{datestr}') --ranks=RANKS analyze these ranks out of the best n samples (by top R-value) default=1,2,3,4

I cannot find "RBPamp.params", in /RegVar/extdata/RBPamp/RBPamp. There is "params.py", but not sure this is the same thing. If you filter by "params" in https://bitbucket.org/marjens/rbpamp/src/master/, then again, you only get "params.py". So not what this RBPamp.params is, nor how to get it/install it. Any ideas?

— Reply to this email directly, view it on GitHub https://github.com/RomoL2/RegVar/issues/12#issuecomment-2098188260, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZOARDDP2MSYR3F4VKYPHPTZBC3O7AVCNFSM6AAAAABHJKDISKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOJYGE4DQMRWGA . You are receiving this because you commented.Message ID: @.***>

Alexei-Lipov commented 6 months ago

So, unfortunately, I have tried what you suggested and it still gives me the same error.

As you can see below, I am in the RBPamp conda env. I also loaded Python (I'm on a HPC where you have to module load packages). As you can see below, I tried both extra lines of code you suggested (separately).

(RBPamp) [lipova@int5 rpackages]$ R

R version 4.3.2 (2023-10-31) -- "Eye Holes" Copyright (C) 2023 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details.

Natural language support but running in an English locale

R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R.

l> library(RegVar)

path_to_python<-reticulate::conda_list()[[2]][which(reticulate::conda_list()[[1]]=='RBPamp')] CharacterizeVariants_single_input('~/') Enter 3'UTR single nucleotide variant chromosome number: 3 Enter variant position in 1-based coordinates: 38549707 Enter hg38 reference base (capitalized) at variant position: C Enter variant base (capitalized): T Enter a name for this variant (no spaces): test gzip: motifs2 already exists; do you wish to overwrite (y or n)? y gzip: motifs2: Is a directory [1] "incorporating eCLIP" [1] "incorporating eQTLS" [1] "incorporating GWAS" [1] "incorporating microRNAs" [1] "incorporating RBP motifs" processing TRNAU1AP.txt Error in py_run_file_impl(file, local, convert) : ModuleNotFoundError: No module named 'RBPamp.params' Run reticulate::py_last_error() for details. path_to_python <- "/opt/conda/envs/RBPamp/bin/python"

CharacterizeVariants_single_input('~/') Enter 3'UTR single nucleotide variant chromosome number: 3 Enter variant position in 1-based coordinates: 38549707 Enter hg38 reference base (capitalized) at variant position: C Enter variant base (capitalized): T Enter a name for this variant (no spaces): test gzip: motifs2 already exists; do you wish to overwrite (y or n)? y gzip: motifs2: Is a directory [1] "incorporating eCLIP" [1] "incorporating eQTLS" [1] "incorporating GWAS" [1] "incorporating microRNAs" [1] "incorporating RBP motifs" processing TRNAU1AP.txt Error in py_run_file_impl(file, local, convert) : ModuleNotFoundError: No module named 'RBPamp.params' Run reticulate::py_last_error() for details. reticulate::py_last_error()

── Python Exception Message ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── Traceback (most recent call last): File "RBPamp_aff_local.py", line 44, in params = load_model(user_motif_location + curr_RBP) File "RBPamp_aff_local.py", line 23, in load_model from RBPamp.params import ModelSetParams File "/gpfs/home6/lipova/rpackages/reticulate/python/rpytools/loader.py", line 122, in _find_and_load_hook return _run_hook(name, _hook) File "/gpfs/home6/lipova/rpackages/reticulate/python/rpytools/loader.py", line 96, in _run_hook module = hook() File "/gpfs/home6/lipova/rpackages/reticulate/python/rpytools/loader.py", line 120, in _hook return _find_andload(name, import) ModuleNotFoundError: No module named 'RBPamp.params'

── R Traceback ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ▆

  1. └─RegVar::CharacterizeVariants_single_input("~/")
  2. └─reticulate::source_python("RBPamp_aff_local.py")
  3. └─reticulate::py_run_file(file, local = FALSE, convert = convert)
  4. └─reticulate:::py_run_file_impl(file, local, convert) See reticulate::py_last_error()$r_trace$full_call for more details.

    q()

The error suggests that the issue is with the line from RBPamp.params import ModelSetParams in RBPamp_aff_local.py:

(RBPamp) [lipova@int5 extdata]$ more RBPamp_aff_local.py

!/usr/bin/env python

from future import print_function import numpy as np import RBPamp import os import pandas as pd import sys import re import csv

user_11_mer_file = 'vars.k_11_seq.txt' # path/to/11_mer_file.txt user_10_mer_file = 'vars.k_10_seq.txt' # path/to/10_mer_file.txt user_full_seq_file = 'vars.full_seq.txt' # path/to/full_seq_file.txt user_motif_location = './motifs2/' #path to folder with RBP motifs

make empty versions of output files

os.system('> ' + re.sub('.txt', '', user_full_seq_file) + ".RBPamp_affs." + 'motifs.' + 'tsv') os.system('> ' + re.sub('.txt', '', user_11_mer_file) + ".RBPamp_affs." + 'motifs.' + 'tsv') os.system('> ' + re.sub('.txt', '', user_10_mer_file) + ".RBPamp_affs." + 'motifs.' + 'tsv')

set up

def load_model(fname): from RBPamp.params import ModelSetParams params = ModelSetParams.load(fname, 1) return params

RomoL2 commented 6 months ago

Did you try actually putting the line of code into the function rather than running separately?

You can do this to make sure RBPamp itself is working in your env separately from my code (if so, the problem is my R script): move the intermediate input files to a folder (should be 3, called 'vars.k_10_seq.txt,' 'vars.k_11_seq.txt,' and 'vars.full_seq.txt') cd /your/path/here conda activate RBPamp python RBPamp_aff_local.py

Let me know if this is working- thanks

Lindsay

On Tue, May 7, 2024 at 9:38 AM Alexei-Lipov @.***> wrote:

So, unfortunately, I have tried what you suggested and it still gives me the same error.

As you can see below, I am in the RBPamp conda env. I also loaded Python (I'm on a HPC where you have to module load packages). As you can see below, I tried both extra lines of code you suggested (separately).

(RBPamp) @.*** rpackages]$ R

R version 4.3.2 (2023-10-31) -- "Eye Holes" Copyright (C) 2023 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details.

Natural language support but running in an English locale

R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R.

l> library(RegVar)

path_to_python<-reticulate::conda_list()[[2]][which(reticulate::conda_list()[[1]]=='RBPamp')] CharacterizeVariants_single_input('~/') Enter 3'UTR single nucleotide variant chromosome number: 3 Enter variant position in 1-based coordinates: 38549707 Enter hg38 reference base (capitalized) at variant position: C Enter variant base (capitalized): T Enter a name for this variant (no spaces): test gzip: motifs2 already exists; do you wish to overwrite (y or n)? y gzip: motifs2: Is a directory [1] "incorporating eCLIP" [1] "incorporating eQTLS" [1] "incorporating GWAS" [1] "incorporating microRNAs" [1] "incorporating RBP motifs" processing TRNAU1AP.txt Error in py_run_file_impl(file, local, convert) : ModuleNotFoundError: No module named 'RBPamp.params' Run reticulate::py_last_error() for details. path_to_python <- "/opt/conda/envs/RBPamp/bin/python"

CharacterizeVariants_single_input('~/') Enter 3'UTR single nucleotide variant chromosome number: 3 Enter variant position in 1-based coordinates: 38549707 Enter hg38 reference base (capitalized) at variant position: C Enter variant base (capitalized): T Enter a name for this variant (no spaces): test gzip: motifs2 already exists; do you wish to overwrite (y or n)? y gzip: motifs2: Is a directory [1] "incorporating eCLIP" [1] "incorporating eQTLS" [1] "incorporating GWAS" [1] "incorporating microRNAs" [1] "incorporating RBP motifs" processing TRNAU1AP.txt Error in py_run_file_impl(file, local, convert) : ModuleNotFoundError: No module named 'RBPamp.params' Run reticulate::py_last_error() for details. reticulate::py_last_error()

── Python Exception Message ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── Traceback (most recent call last): File "RBPamp_aff_local.py", line 44, in params = load_model(user_motif_location + curr_RBP) File "RBPamp_aff_local.py", line 23, in load_model from RBPamp.params import ModelSetParams File "/gpfs/home6/lipova/rpackages/reticulate/python/rpytools/loader.py", line 122, in _find_and_load_hook return _run_hook(name, _hook) File "/gpfs/home6/lipova/rpackages/reticulate/python/rpytools/loader.py", line 96, in _run_hook module = hook() File "/gpfs/home6/lipova/rpackages/reticulate/python/rpytools/loader.py", line 120, in _hook return find_and_load(name, import) ModuleNotFoundError: No module named 'RBPamp.params'

── R Traceback ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ▆

  1. └─RegVar::CharacterizeVariants_single_input("~/")

  2. └─reticulate::source_python("RBPamp_aff_local.py")

  3. └─reticulate::py_run_file(file, local = FALSE, convert = convert)

  4. └─reticulate:::py_run_file_impl(file, local, convert)

See reticulate::py_last_error()$r_trace$full_call for more details.

q()

The error suggests that the issue is with the line from RBPamp.params import ModelSetParams in RBPamp_aff_local.py:

(RBPamp) @.*** extdata]$ more RBPamp_aff_local.py

!/usr/bin/env python

from future import print_function import numpy as np import RBPamp import os import pandas as pd import sys import re import csv

user_11_mer_file = 'vars.k_11_seq.txt' # path/to/11_mer_file.txt user_10_mer_file = 'vars.k_10_seq.txt' # path/to/10_mer_file.txt user_full_seq_file = 'vars.full_seq.txt' # path/to/full_seq_file.txt user_motif_location = './motifs2/' #path to folder with RBP motifs make empty versions of output files

os.system('> ' + re.sub('.txt', '', user_full_seq_file) + ".RBPamp_affs."

  • 'motifs.' + 'tsv') os.system('> ' + re.sub('.txt', '', user_11_mer_file) + ".RBPamp_affs." + 'motifs.' + 'tsv') os.system('> ' + re.sub('.txt', '', user_10_mer_file) + ".RBPamp_affs." + 'motifs.' + 'tsv') set up

def load_model(fname): from RBPamp.params import ModelSetParams params = ModelSetParams.load(fname, 1) return params

— Reply to this email directly, view it on GitHub https://github.com/RomoL2/RegVar/issues/12#issuecomment-2098432680, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZOARDHIVPY4OXKLY7XTYETZBDKNZAVCNFSM6AAAAABHJKDISKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOJYGQZTENRYGA . You are receiving this because you commented.Message ID: @.***>

RomoL2 commented 6 months ago

Obviously the .py file needs to be there as well.

On Tue, May 7, 2024 at 9:58 AM Lindsay Romo @.***> wrote:

Did you try actually putting the line of code into the function rather than running separately?

You can do this to make sure RBPamp itself is working in your env separately from my code (if so, the problem is my R script): move the intermediate input files to a folder (should be 3, called 'vars.k_10_seq.txt,' 'vars.k_11_seq.txt,' and 'vars.full_seq.txt') cd /your/path/here conda activate RBPamp python RBPamp_aff_local.py

Let me know if this is working- thanks

Lindsay

On Tue, May 7, 2024 at 9:38 AM Alexei-Lipov @.***> wrote:

So, unfortunately, I have tried what you suggested and it still gives me the same error.

As you can see below, I am in the RBPamp conda env. I also loaded Python (I'm on a HPC where you have to module load packages). As you can see below, I tried both extra lines of code you suggested (separately).

(RBPamp) @.*** rpackages]$ R

R version 4.3.2 (2023-10-31) -- "Eye Holes" Copyright (C) 2023 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details.

Natural language support but running in an English locale

R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R.

l> library(RegVar)

path_to_python<-reticulate::conda_list()[[2]][which(reticulate::conda_list()[[1]]=='RBPamp')] CharacterizeVariants_single_input('~/') Enter 3'UTR single nucleotide variant chromosome number: 3 Enter variant position in 1-based coordinates: 38549707 Enter hg38 reference base (capitalized) at variant position: C Enter variant base (capitalized): T Enter a name for this variant (no spaces): test gzip: motifs2 already exists; do you wish to overwrite (y or n)? y gzip: motifs2: Is a directory [1] "incorporating eCLIP" [1] "incorporating eQTLS" [1] "incorporating GWAS" [1] "incorporating microRNAs" [1] "incorporating RBP motifs" processing TRNAU1AP.txt Error in py_run_file_impl(file, local, convert) : ModuleNotFoundError: No module named 'RBPamp.params' Run reticulate::py_last_error() for details. path_to_python <- "/opt/conda/envs/RBPamp/bin/python"

CharacterizeVariants_single_input('~/') Enter 3'UTR single nucleotide variant chromosome number: 3 Enter variant position in 1-based coordinates: 38549707 Enter hg38 reference base (capitalized) at variant position: C Enter variant base (capitalized): T Enter a name for this variant (no spaces): test gzip: motifs2 already exists; do you wish to overwrite (y or n)? y gzip: motifs2: Is a directory [1] "incorporating eCLIP" [1] "incorporating eQTLS" [1] "incorporating GWAS" [1] "incorporating microRNAs" [1] "incorporating RBP motifs" processing TRNAU1AP.txt Error in py_run_file_impl(file, local, convert) : ModuleNotFoundError: No module named 'RBPamp.params' Run reticulate::py_last_error() for details. reticulate::py_last_error()

── Python Exception Message ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── Traceback (most recent call last): File "RBPamp_aff_local.py", line 44, in params = load_model(user_motif_location + curr_RBP) File "RBPamp_aff_local.py", line 23, in load_model from RBPamp.params import ModelSetParams File "/gpfs/home6/lipova/rpackages/reticulate/python/rpytools/loader.py", line 122, in _find_and_load_hook return _run_hook(name, _hook) File "/gpfs/home6/lipova/rpackages/reticulate/python/rpytools/loader.py", line 96, in _run_hook module = hook() File "/gpfs/home6/lipova/rpackages/reticulate/python/rpytools/loader.py", line 120, in _hook return find_and_load(name, import) ModuleNotFoundError: No module named 'RBPamp.params'

── R Traceback ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ▆

  1. └─RegVar::CharacterizeVariants_single_input("~/")

  2. └─reticulate::source_python("RBPamp_aff_local.py")

  3. └─reticulate::py_run_file(file, local = FALSE, convert = convert)

  4. └─reticulate:::py_run_file_impl(file, local, convert)

See reticulate::py_last_error()$r_trace$full_call for more details.

q()

The error suggests that the issue is with the line from RBPamp.params import ModelSetParams in RBPamp_aff_local.py:

(RBPamp) @.*** extdata]$ more RBPamp_aff_local.py

!/usr/bin/env python

from future import print_function import numpy as np import RBPamp import os import pandas as pd import sys import re import csv

user_11_mer_file = 'vars.k_11_seq.txt' # path/to/11_mer_file.txt user_10_mer_file = 'vars.k_10_seq.txt' # path/to/10_mer_file.txt user_full_seq_file = 'vars.full_seq.txt' # path/to/full_seq_file.txt user_motif_location = './motifs2/' #path to folder with RBP motifs make empty versions of output files

os.system('> ' + re.sub('.txt', '', user_full_seq_file) + ".RBPamp_affs."

  • 'motifs.' + 'tsv') os.system('> ' + re.sub('.txt', '', user_11_mer_file) + ".RBPamp_affs." + 'motifs.' + 'tsv') os.system('> ' + re.sub('.txt', '', user_10_mer_file) + ".RBPamp_affs." + 'motifs.' + 'tsv') set up

def load_model(fname): from RBPamp.params import ModelSetParams params = ModelSetParams.load(fname, 1) return params

— Reply to this email directly, view it on GitHub https://github.com/RomoL2/RegVar/issues/12#issuecomment-2098432680, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZOARDHIVPY4OXKLY7XTYETZBDKNZAVCNFSM6AAAAABHJKDISKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOJYGQZTENRYGA . You are receiving this because you commented.Message ID: @.***>

RomoL2 commented 6 months ago

Actually, looking at the python code, sorry, this needs to be run in the folder where the intermediate files are located (motifs2 folder should also be there along with the python file).

On Tue, May 7, 2024 at 9:59 AM Lindsay Romo @.***> wrote:

Obviously the .py file needs to be there as well.

On Tue, May 7, 2024 at 9:58 AM Lindsay Romo @.***> wrote:

Did you try actually putting the line of code into the function rather than running separately?

You can do this to make sure RBPamp itself is working in your env separately from my code (if so, the problem is my R script): move the intermediate input files to a folder (should be 3, called 'vars.k_10_seq.txt,' 'vars.k_11_seq.txt,' and 'vars.full_seq.txt') cd /your/path/here conda activate RBPamp python RBPamp_aff_local.py

Let me know if this is working- thanks

Lindsay

On Tue, May 7, 2024 at 9:38 AM Alexei-Lipov @.***> wrote:

So, unfortunately, I have tried what you suggested and it still gives me the same error.

As you can see below, I am in the RBPamp conda env. I also loaded Python (I'm on a HPC where you have to module load packages). As you can see below, I tried both extra lines of code you suggested (separately).

(RBPamp) @.*** rpackages]$ R

R version 4.3.2 (2023-10-31) -- "Eye Holes" Copyright (C) 2023 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details.

Natural language support but running in an English locale

R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R.

l> library(RegVar)

path_to_python<-reticulate::conda_list()[[2]][which(reticulate::conda_list()[[1]]=='RBPamp')] CharacterizeVariants_single_input('~/') Enter 3'UTR single nucleotide variant chromosome number: 3 Enter variant position in 1-based coordinates: 38549707 Enter hg38 reference base (capitalized) at variant position: C Enter variant base (capitalized): T Enter a name for this variant (no spaces): test gzip: motifs2 already exists; do you wish to overwrite (y or n)? y gzip: motifs2: Is a directory [1] "incorporating eCLIP" [1] "incorporating eQTLS" [1] "incorporating GWAS" [1] "incorporating microRNAs" [1] "incorporating RBP motifs" processing TRNAU1AP.txt Error in py_run_file_impl(file, local, convert) : ModuleNotFoundError: No module named 'RBPamp.params' Run reticulate::py_last_error() for details. path_to_python <- "/opt/conda/envs/RBPamp/bin/python"

CharacterizeVariants_single_input('~/') Enter 3'UTR single nucleotide variant chromosome number: 3 Enter variant position in 1-based coordinates: 38549707 Enter hg38 reference base (capitalized) at variant position: C Enter variant base (capitalized): T Enter a name for this variant (no spaces): test gzip: motifs2 already exists; do you wish to overwrite (y or n)? y gzip: motifs2: Is a directory [1] "incorporating eCLIP" [1] "incorporating eQTLS" [1] "incorporating GWAS" [1] "incorporating microRNAs" [1] "incorporating RBP motifs" processing TRNAU1AP.txt Error in py_run_file_impl(file, local, convert) : ModuleNotFoundError: No module named 'RBPamp.params' Run reticulate::py_last_error() for details. reticulate::py_last_error()

── Python Exception Message ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── Traceback (most recent call last): File "RBPamp_aff_local.py", line 44, in params = load_model(user_motif_location + curr_RBP) File "RBPamp_aff_local.py", line 23, in load_model from RBPamp.params import ModelSetParams File "/gpfs/home6/lipova/rpackages/reticulate/python/rpytools/loader.py", line 122, in _find_and_load_hook return _run_hook(name, _hook) File "/gpfs/home6/lipova/rpackages/reticulate/python/rpytools/loader.py", line 96, in _run_hook module = hook() File "/gpfs/home6/lipova/rpackages/reticulate/python/rpytools/loader.py", line 120, in _hook return find_and_load(name, import) ModuleNotFoundError: No module named 'RBPamp.params'

── R Traceback ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ▆

  1. └─RegVar::CharacterizeVariants_single_input("~/")

  2. └─reticulate::source_python("RBPamp_aff_local.py")

  3. └─reticulate::py_run_file(file, local = FALSE, convert = convert)

  4. └─reticulate:::py_run_file_impl(file, local, convert)

See reticulate::py_last_error()$r_trace$full_call for more details.

q()

The error suggests that the issue is with the line from RBPamp.params import ModelSetParams in RBPamp_aff_local.py:

(RBPamp) @.*** extdata]$ more RBPamp_aff_local.py

!/usr/bin/env python

from future import print_function import numpy as np import RBPamp import os import pandas as pd import sys import re import csv

user_11_mer_file = 'vars.k_11_seq.txt' # path/to/11_mer_file.txt user_10_mer_file = 'vars.k_10_seq.txt' # path/to/10_mer_file.txt user_full_seq_file = 'vars.full_seq.txt' # path/to/full_seq_file.txt user_motif_location = './motifs2/' #path to folder with RBP motifs make empty versions of output files

os.system('> ' + re.sub('.txt', '', user_full_seq_file) + ".RBPamp_affs." + 'motifs.' + 'tsv') os.system('> ' + re.sub('.txt', '', user_11_mer_file) + ".RBPamp_affs."

  • 'motifs.' + 'tsv') os.system('> ' + re.sub('.txt', '', user_10_mer_file) + ".RBPamp_affs."
  • 'motifs.' + 'tsv') set up

def load_model(fname): from RBPamp.params import ModelSetParams params = ModelSetParams.load(fname, 1) return params

— Reply to this email directly, view it on GitHub https://github.com/RomoL2/RegVar/issues/12#issuecomment-2098432680, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZOARDHIVPY4OXKLY7XTYETZBDKNZAVCNFSM6AAAAABHJKDISKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOJYGQZTENRYGA . You are receiving this because you commented.Message ID: @.***>

RomoL2 commented 6 months ago

Also, the python code for RBPamp is working fine on my end, so my suspicion is that this is more likely to be a problem with calling the conda environment from R. So best way to test that is try running RBPamp outside of R to make sure it's working.

On Tue, May 7, 2024 at 10:01 AM Lindsay Romo @.***> wrote:

Actually, looking at the python code, sorry, this needs to be run in the folder where the intermediate files are located (motifs2 folder should also be there along with the python file).

On Tue, May 7, 2024 at 9:59 AM Lindsay Romo @.***> wrote:

Obviously the .py file needs to be there as well.

On Tue, May 7, 2024 at 9:58 AM Lindsay Romo @.***> wrote:

Did you try actually putting the line of code into the function rather than running separately?

You can do this to make sure RBPamp itself is working in your env separately from my code (if so, the problem is my R script): move the intermediate input files to a folder (should be 3, called 'vars.k_10_seq.txt,' 'vars.k_11_seq.txt,' and 'vars.full_seq.txt') cd /your/path/here conda activate RBPamp python RBPamp_aff_local.py

Let me know if this is working- thanks

Lindsay

On Tue, May 7, 2024 at 9:38 AM Alexei-Lipov @.***> wrote:

So, unfortunately, I have tried what you suggested and it still gives me the same error.

As you can see below, I am in the RBPamp conda env. I also loaded Python (I'm on a HPC where you have to module load packages). As you can see below, I tried both extra lines of code you suggested (separately).

(RBPamp) @.*** rpackages]$ R

R version 4.3.2 (2023-10-31) -- "Eye Holes" Copyright (C) 2023 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details.

Natural language support but running in an English locale

R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R.

l> library(RegVar)

path_to_python<-reticulate::conda_list()[[2]][which(reticulate::conda_list()[[1]]=='RBPamp')] CharacterizeVariants_single_input('~/') Enter 3'UTR single nucleotide variant chromosome number: 3 Enter variant position in 1-based coordinates: 38549707 Enter hg38 reference base (capitalized) at variant position: C Enter variant base (capitalized): T Enter a name for this variant (no spaces): test gzip: motifs2 already exists; do you wish to overwrite (y or n)? y gzip: motifs2: Is a directory [1] "incorporating eCLIP" [1] "incorporating eQTLS" [1] "incorporating GWAS" [1] "incorporating microRNAs" [1] "incorporating RBP motifs" processing TRNAU1AP.txt Error in py_run_file_impl(file, local, convert) : ModuleNotFoundError: No module named 'RBPamp.params' Run reticulate::py_last_error() for details. path_to_python <- "/opt/conda/envs/RBPamp/bin/python"

CharacterizeVariants_single_input('~/') Enter 3'UTR single nucleotide variant chromosome number: 3 Enter variant position in 1-based coordinates: 38549707 Enter hg38 reference base (capitalized) at variant position: C Enter variant base (capitalized): T Enter a name for this variant (no spaces): test gzip: motifs2 already exists; do you wish to overwrite (y or n)? y gzip: motifs2: Is a directory [1] "incorporating eCLIP" [1] "incorporating eQTLS" [1] "incorporating GWAS" [1] "incorporating microRNAs" [1] "incorporating RBP motifs" processing TRNAU1AP.txt Error in py_run_file_impl(file, local, convert) : ModuleNotFoundError: No module named 'RBPamp.params' Run reticulate::py_last_error() for details. reticulate::py_last_error()

── Python Exception Message ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── Traceback (most recent call last): File "RBPamp_aff_local.py", line 44, in params = load_model(user_motif_location + curr_RBP) File "RBPamp_aff_local.py", line 23, in load_model from RBPamp.params import ModelSetParams File "/gpfs/home6/lipova/rpackages/reticulate/python/rpytools/loader.py", line 122, in _find_and_load_hook return _run_hook(name, _hook) File "/gpfs/home6/lipova/rpackages/reticulate/python/rpytools/loader.py", line 96, in _run_hook module = hook() File "/gpfs/home6/lipova/rpackages/reticulate/python/rpytools/loader.py", line 120, in _hook return find_and_load(name, import) ModuleNotFoundError: No module named 'RBPamp.params'

── R Traceback ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ▆

  1. └─RegVar::CharacterizeVariants_single_input("~/")

  2. └─reticulate::source_python("RBPamp_aff_local.py")

  3. └─reticulate::py_run_file(file, local = FALSE, convert = convert)

  4. └─reticulate:::py_run_file_impl(file, local, convert)

See reticulate::py_last_error()$r_trace$full_call for more details.

q()

The error suggests that the issue is with the line from RBPamp.params import ModelSetParams in RBPamp_aff_local.py:

(RBPamp) @.*** extdata]$ more RBPamp_aff_local.py

!/usr/bin/env python

from future import print_function import numpy as np import RBPamp import os import pandas as pd import sys import re import csv

user_11_mer_file = 'vars.k_11_seq.txt' # path/to/11_mer_file.txt user_10_mer_file = 'vars.k_10_seq.txt' # path/to/10_mer_file.txt user_full_seq_file = 'vars.full_seq.txt' # path/to/full_seq_file.txt user_motif_location = './motifs2/' #path to folder with RBP motifs make empty versions of output files

os.system('> ' + re.sub('.txt', '', user_full_seq_file) + ".RBPamp_affs." + 'motifs.' + 'tsv') os.system('> ' + re.sub('.txt', '', user_11_mer_file) + ".RBPamp_affs."

  • 'motifs.' + 'tsv') os.system('> ' + re.sub('.txt', '', user_10_mer_file) + ".RBPamp_affs."
  • 'motifs.' + 'tsv') set up

def load_model(fname): from RBPamp.params import ModelSetParams params = ModelSetParams.load(fname, 1) return params

— Reply to this email directly, view it on GitHub https://github.com/RomoL2/RegVar/issues/12#issuecomment-2098432680, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZOARDHIVPY4OXKLY7XTYETZBDKNZAVCNFSM6AAAAABHJKDISKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOJYGQZTENRYGA . You are receiving this because you commented.Message ID: @.***>

RomoL2 commented 6 months ago

My input/output (locally):

(base) @.*** ~ % cd /Library/Frameworks/R.framework/Versions/4.0/Resources/library/RegVar

(base) @.*** RegVar % ls

DESCRIPTION Meta R extdata.tar.gz html

INDEX NAMESPACE extdata help

(base) @.*** RegVar % cd extdata

(base) @.*** extdata % ls

GTEx_v8_finemapping_DAPG_UTR_for_script.bed

GTEx_v8_finemapping_DAPG_scottUTR_processed.txt

GTEx_v8_finemapping_DAPG_scottUTR_processed_expanded_miR_info.txt

GWAS_UTR_for_script.bed

LR_all_APA_peak_coords_hg38_by_base.phylop_100.phylop_17.phastcons_100.phastcons_17.txt

RBPamp

RBPamp_aff_local.py

all_APA_peak_coords_hg38.bed

all_gd_UTR_vars.bed

clinvar_for_script.bed

eCLIP_GRCh38_reps_1_2_narrow_peak_ALL_RBP_cell_line_pairs.RBPs_with_amp_NEW_motifs.lines_assayed.lines_w_peak.NEW_aff_sum_peak_pm_10.in_top_motif.BY_BASE_BY_RBP.bed

eCLIP_peaks.GRCh38.IDR_pass.main_chr.HepG2.full_name.bed

eCLIP_peaks.GRCh38.IDR_pass.main_chr.K562.full_name.bed

gwas_scottUTRvars_processed.txt

hg38.fa

hg38.fa.fai

hg38_miR_predictions_final.bed

hg38_miR_predictions_final.txt

merged_by_strand_nat_sorted_vcf_UTR_tmp.bed

motifs2

nat_sorted_vcf_UTR_tmp.bed

nat_sorted_vcf_UTR_tmp_intersected_expanded_RNA_strand_PLUS_k_for_seq2.bed

nat_sorted_vcf_UTR_tmp_intersected_expanded_RNA_strand_PLUS_k_for_seq2.txt

scott_vcf.bed.3pseq_intersected.txt

vars.full_seq.RBPamp_affs.motifs.tsv

vars.full_seq.txt

vars.k_10_seq.RBPamp_affs.motifs.tsv

vars.k_10_seq.txt

vars.k_11_seq.RBPamp_affs.motifs.tsv

vars.k_11_seq.txt

vcf.bed

vcf_UTR.bed

vcf_UTR_clinvar.bed

vcf_UTR_eqtls.bed

vcf_UTR_gwas.bed

vcf_UTR_miRs.bed

vcf_UTR_tmp.bed

vcf_UTR_tmp_hepg2.txt

vcf_UTR_tmp_k562.txt

(base) @.*** extdata % conda activate RBPamp

(RBPamp) @.*** extdata % python RBPamp_aff_local.py

processing HNRNPA0.txt

processing SF1.txt

processing MBNL1.txt

processing HNRNPA1.txt

processing DAZ3.txt

processing RALY.txt

processing ESRP1.txt

processing CELF1.txt

processing TARDBP.txt

processing RBM15B.txt

processing MSI1.txt

processing SRSF5.txt

processing A1CF.txt

processing PTBP3.txt

processing SRSF4.txt

processing PRR3.txt

processing RC3H1.txt

processing TRNAU1AP.txt

processing RBMS3.txt

processing HNRNPK.txt

processing RBMS2.txt

processing UNK.txt

processing ZCRB1.txt

processing TIA1.txt

processing RBFOX3.txt

processing RBFOX2.txt

processing PUM1.txt

processing SRSF2.txt

processing HNRNPDL.txt

processing KHDRBS2.txt

processing HNRNPL.txt

processing PUF60.txt

processing PUM2.txt

processing KHDRBS3.txt

processing FUBP3.txt

processing CPEB1.txt

processing NUPL2.txt

processing BOLL.txt

processing SFPQ.txt

processing ILF2.txt

processing RBM6.txt

processing RBM4.txt

processing RBM24.txt

processing SNRPA.txt

processing HNRNPC.txt

processing RBM25.txt

processing FUBP1.txt

processing NOVA1.txt

processing HNRNPF.txt

processing FUS.txt

processing KHSRP.txt

processing HNRNPH2.txt

processing SRSF9.txt

processing TRA2A.txt

processing PABPN1L.txt

processing RBM22.txt

processing ELAVL4.txt

processing HNRNPD.txt

processing RBM23.txt

processing DAZAP1.txt

processing SRSF8.txt

processing PCBP4.txt

processing CNOT4.txt

processing RBM4B.txt

processing ZNF326.txt

processing RBM45.txt

processing RBM47.txt

processing ZFP36.txt

processing PCBP2.txt

processing IGF2BP2.txt

processing HNRNPA2B1.txt

processing SRSF11.txt

processing TAF15.txt

processing EWSR1.txt

processing HNRNPCL1.txt

processing SRSF10.txt

processing PCBP1.txt

processing IGF2BP1.txt

processing EIF4G2.txt

processing RBM41.txt

(RBPamp) @.*** extdata %

On Tue, May 7, 2024 at 10:04 AM Lindsay Romo @.***> wrote:

Also, the python code for RBPamp is working fine on my end, so my suspicion is that this is more likely to be a problem with calling the conda environment from R. So best way to test that is try running RBPamp outside of R to make sure it's working.

On Tue, May 7, 2024 at 10:01 AM Lindsay Romo @.***> wrote:

Actually, looking at the python code, sorry, this needs to be run in the folder where the intermediate files are located (motifs2 folder should also be there along with the python file).

On Tue, May 7, 2024 at 9:59 AM Lindsay Romo @.***> wrote:

Obviously the .py file needs to be there as well.

On Tue, May 7, 2024 at 9:58 AM Lindsay Romo @.***> wrote:

Did you try actually putting the line of code into the function rather than running separately?

You can do this to make sure RBPamp itself is working in your env separately from my code (if so, the problem is my R script): move the intermediate input files to a folder (should be 3, called 'vars.k_10_seq.txt,' 'vars.k_11_seq.txt,' and 'vars.full_seq.txt') cd /your/path/here conda activate RBPamp python RBPamp_aff_local.py

Let me know if this is working- thanks

Lindsay

On Tue, May 7, 2024 at 9:38 AM Alexei-Lipov @.***> wrote:

So, unfortunately, I have tried what you suggested and it still gives me the same error.

As you can see below, I am in the RBPamp conda env. I also loaded Python (I'm on a HPC where you have to module load packages). As you can see below, I tried both extra lines of code you suggested (separately).

(RBPamp) @.*** rpackages]$ R

R version 4.3.2 (2023-10-31) -- "Eye Holes" Copyright (C) 2023 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details.

Natural language support but running in an English locale

R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R.

l> library(RegVar)

path_to_python<-reticulate::conda_list()[[2]][which(reticulate::conda_list()[[1]]=='RBPamp')] CharacterizeVariants_single_input('~/') Enter 3'UTR single nucleotide variant chromosome number: 3 Enter variant position in 1-based coordinates: 38549707 Enter hg38 reference base (capitalized) at variant position: C Enter variant base (capitalized): T Enter a name for this variant (no spaces): test gzip: motifs2 already exists; do you wish to overwrite (y or n)? y gzip: motifs2: Is a directory [1] "incorporating eCLIP" [1] "incorporating eQTLS" [1] "incorporating GWAS" [1] "incorporating microRNAs" [1] "incorporating RBP motifs" processing TRNAU1AP.txt Error in py_run_file_impl(file, local, convert) : ModuleNotFoundError: No module named 'RBPamp.params' Run reticulate::py_last_error() for details. path_to_python <- "/opt/conda/envs/RBPamp/bin/python"

CharacterizeVariants_single_input('~/') Enter 3'UTR single nucleotide variant chromosome number: 3 Enter variant position in 1-based coordinates: 38549707 Enter hg38 reference base (capitalized) at variant position: C Enter variant base (capitalized): T Enter a name for this variant (no spaces): test gzip: motifs2 already exists; do you wish to overwrite (y or n)? y gzip: motifs2: Is a directory [1] "incorporating eCLIP" [1] "incorporating eQTLS" [1] "incorporating GWAS" [1] "incorporating microRNAs" [1] "incorporating RBP motifs" processing TRNAU1AP.txt Error in py_run_file_impl(file, local, convert) : ModuleNotFoundError: No module named 'RBPamp.params' Run reticulate::py_last_error() for details. reticulate::py_last_error()

── Python Exception Message ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── Traceback (most recent call last): File "RBPamp_aff_local.py", line 44, in params = load_model(user_motif_location + curr_RBP) File "RBPamp_aff_local.py", line 23, in load_model from RBPamp.params import ModelSetParams File "/gpfs/home6/lipova/rpackages/reticulate/python/rpytools/loader.py", line 122, in _find_and_load_hook return _run_hook(name, _hook) File "/gpfs/home6/lipova/rpackages/reticulate/python/rpytools/loader.py", line 96, in _run_hook module = hook() File "/gpfs/home6/lipova/rpackages/reticulate/python/rpytools/loader.py", line 120, in _hook return find_and_load(name, import) ModuleNotFoundError: No module named 'RBPamp.params'

── R Traceback ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ▆

  1. └─RegVar::CharacterizeVariants_single_input("~/")

  2. └─reticulate::source_python("RBPamp_aff_local.py")

  3. └─reticulate::py_run_file(file, local = FALSE, convert = convert)

  4. └─reticulate:::py_run_file_impl(file, local, convert)

See reticulate::py_last_error()$r_trace$full_call for more details.

q()

The error suggests that the issue is with the line from RBPamp.params import ModelSetParams in RBPamp_aff_local.py:

(RBPamp) @.*** extdata]$ more RBPamp_aff_local.py

!/usr/bin/env python

from future import print_function import numpy as np import RBPamp import os import pandas as pd import sys import re import csv

user_11_mer_file = 'vars.k_11_seq.txt' # path/to/11_mer_file.txt user_10_mer_file = 'vars.k_10_seq.txt' # path/to/10_mer_file.txt user_full_seq_file = 'vars.full_seq.txt' # path/to/full_seq_file.txt user_motif_location = './motifs2/' #path to folder with RBP motifs make empty versions of output files

os.system('> ' + re.sub('.txt', '', user_full_seq_file) + ".RBPamp_affs." + 'motifs.' + 'tsv') os.system('> ' + re.sub('.txt', '', user_11_mer_file) + ".RBPamp_affs." + 'motifs.' + 'tsv') os.system('> ' + re.sub('.txt', '', user_10_mer_file) + ".RBPamp_affs." + 'motifs.' + 'tsv') set up

def load_model(fname): from RBPamp.params import ModelSetParams params = ModelSetParams.load(fname, 1) return params

— Reply to this email directly, view it on GitHub https://github.com/RomoL2/RegVar/issues/12#issuecomment-2098432680, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZOARDHIVPY4OXKLY7XTYETZBDKNZAVCNFSM6AAAAABHJKDISKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOJYGQZTENRYGA . You are receiving this because you commented.Message ID: @.***>

Alexei-Lipov commented 6 months ago

I do not know which line of code to add to which function. I guess you mean the def load_model(fname) in RBPamp_aff_local.py? But the line of code you suggested is R code, not Python code?

RBPamp successfully runs outside of R. Going to /extdata and runningpython RBPamp_aff_local.py also works, as you commented. I have not modified RBPamp_aff_local.py. See below:

(RBPamp) [lipova@int5 RegVar]$ cd extdata /home/lipova/rpackages/RegVar/extdata (RBPamp) [lipova@int5 extdata]$ ll total 6161511 -rw-r----- 1 lipova lipova 3037941 Jun 3 2022 all_APA_peak_coords_hg38.bed -rw-r----- 1 lipova lipova 216978153 May 12 2022 all_gd_UTR_vars.bed -rw-r----- 1 lipova lipova 41581296 Jun 3 2022 clinvar_for_script.bed -rw-r----- 1 lipova lipova 714276154 Jun 16 2021 eCLIP_GRCh38_reps_1_2_narrow_peak_ALL_RBP_cell_line_pairs.RBPs_with_amp_NEW_motifs.lines_assayed.lines_w_peak.NEW_aff_sum_peak_pm_10.in_top_motif.BY_BASE_BY_RBP.bed -rw-r----- 1 lipova lipova 34143837 Jun 3 2022 eCLIP_peaks.GRCh38.IDR_pass.main_chr.HepG2.full_name.bed -rw-r----- 1 lipova lipova 32023712 Jun 3 2022 eCLIP_peaks.GRCh38.IDR_pass.main_chr.K562.full_name.bed -rw-r----- 1 lipova lipova 71697049 Jan 10 2022 GTEx_v8_finemapping_DAPG_scottUTR_processed_expanded_miR_info.txt -rw-r----- 1 lipova lipova 52361208 Jan 5 2022 GTEx_v8_finemapping_DAPG_scottUTR_processed.txt -rw-r----- 1 lipova lipova 76411371 Jun 3 2022 GTEx_v8_finemapping_DAPG_UTR_for_script.bed -rw-r----- 1 lipova lipova 153119342 Jan 7 2022 gwas_scottUTRvars_processed.txt -rw-r----- 1 lipova lipova 41748790 Jun 3 2022 GWAS_UTR_for_script.bed -rw-r----- 1 lipova lipova 3273481150 Jan 16 2014 hg38.fa -rw-r----- 1 lipova lipova 19381 Feb 15 2021 hg38.fa.fai -rw-r----- 1 lipova lipova 554141098 Mar 12 2021 hg38_miR_predictions_final.bed -rw-r----- 1 lipova lipova 133094811 Jun 3 2022 hg38_miR_predictions_final.txt -rw-r----- 1 lipova lipova 885558777 Jun 3 2022 LR_all_APA_peak_coords_hg38_by_base.phylop_100.phylop_17.phastcons_100.phastcons_17.txt -rw-r----- 1 lipova lipova 45 May 7 16:13 merged_by_strand_nat_sorted_vcf_UTR_tmp.bed drwxr-x--- 2 lipova lipova 8192 May 6 18:50 motifs2 -rw-r----- 1 lipova lipova 59993 Feb 9 06:38 motifs2.gz -rw-r----- 1 lipova lipova 45 May 7 16:13 nat_sorted_vcf_UTR_tmp.bed -rw-r----- 1 lipova lipova 67 May 7 16:13 nat_sorted_vcf_UTR_tmp_intersected_expanded_RNA_strand_PLUS_k_for_seq2.bed -rw-r----- 1 lipova lipova 155 May 7 16:13 nat_sorted_vcf_UTR_tmp_intersected_expanded_RNA_strand_PLUS_k_for_seq2.txt drwxr-x--- 13 lipova lipova 4096 May 7 16:12 RBPamp -rw-r----- 1 lipova lipova 3572 May 7 15:49 RBPamp_aff_local.py -rw-r----- 1 lipova lipova 21920768 Feb 9 06:38 RBPamp.tar -rw-r----- 1 lipova lipova 3645048 Jun 2 2021 scott_vcf.bed.3pseq_intersected.txt -rw-r----- 1 lipova lipova 0 May 7 16:14 vars.full_seq.RBPamp_affs.motifs.tsv -rw-r----- 1 lipova lipova 92 May 7 16:13 vars.full_seq.txt -rw-r----- 1 lipova lipova 0 May 7 16:14 vars.k_10_seq.RBPamp_affs.motifs.tsv -rw-r----- 1 lipova lipova 24 May 7 16:13 vars.k_10_seq.txt -rw-r----- 1 lipova lipova 0 May 7 16:14 vars.k_11_seq.RBPamp_affs.motifs.tsv -rw-r----- 1 lipova lipova 46 May 7 16:13 vars.k_11_seq.txt -rw-r----- 1 lipova lipova 34 May 7 16:13 vcf.bed -rw-r----- 1 lipova lipova 99 May 7 16:13 vcf_UTR.bed -rw-r----- 1 lipova lipova 0 May 7 16:13 vcf_UTR_eqtls.bed -rw-r----- 1 lipova lipova 0 May 7 16:13 vcf_UTR_gwas.bed -rw-r----- 1 lipova lipova 209 May 7 16:13 vcf_UTR_miRs.bed -rw-r----- 1 lipova lipova 45 May 7 16:13 vcf_UTR_tmp.bed -rw-r----- 1 lipova lipova 0 May 7 16:13 vcf_UTR_tmp_hepg2.txt -rw-r----- 1 lipova lipova 0 May 7 16:13 vcf_UTR_tmp_k562.txt (RBPamp) [lipova@int5 extdata]$ python Python 3.7.12 | packaged by conda-forge | (default, Oct 26 2021, 06:08:21) [GCC 9.4.0] on linux Type "help", "copyright", "credits" or "license" for more information.

quit() (RBPamp) [lipova@int5 extdata]$ python RBPamp_aff_local.py processing TRNAU1AP.txt processing RBFOX2.txt processing CELF1.txt processing ILF2.txt processing RBM24.txt processing SRSF2.txt processing ESRP1.txt processing EIF4G2.txt processing RALY.txt processing PABPN1L.txt processing RBMS2.txt processing PRR3.txt processing TAF15.txt processing RBM47.txt processing RC3H1.txt processing NOVA1.txt processing KHDRBS2.txt processing PCBP1.txt processing RBMS3.txt processing SRSF5.txt processing SRSF9.txt processing UNK.txt processing HNRNPK.txt processing DAZAP1.txt processing FUS.txt processing ZFP36.txt processing BOLL.txt processing PCBP2.txt processing CNOT4.txt processing SFPQ.txt processing SF1.txt processing KHDRBS3.txt processing KHSRP.txt processing RBM4.txt processing SRSF8.txt processing PUM1.txt processing IGF2BP1.txt processing TIA1.txt processing ZCRB1.txt processing RBM45.txt processing MBNL1.txt processing RBFOX3.txt processing HNRNPA2B1.txt processing CPEB1.txt processing HNRNPD.txt processing RBM4B.txt processing RBM41.txt processing PUM2.txt processing SRSF11.txt processing ZNF326.txt processing RBM23.txt processing EWSR1.txt processing HNRNPF.txt processing A1CF.txt processing RBM6.txt processing RBM22.txt processing FUBP3.txt processing NUPL2.txt processing RBM15B.txt processing HNRNPH2.txt processing SRSF4.txt processing HNRNPL.txt processing ELAVL4.txt processing HNRNPA1.txt processing HNRNPC.txt processing MSI1.txt processing RBM25.txt processing IGF2BP2.txt processing PCBP4.txt processing PTBP3.txt processing FUBP1.txt processing HNRNPCL1.txt processing TARDBP.txt processing SNRPA.txt processing SRSF10.txt processing DAZ3.txt processing HNRNPA0.txt processing TRA2A.txt processing HNRNPDL.txt processing PUF60.txt

Alexei-Lipov commented 6 months ago

RBPamp works outside of R:

(RBPamp) [lipova@int5 extdata]$ RBPamp --help Usage: RBPamp [options] [path_to_RBNS_splitreads]

Options: -h, --help show this help message and exit --version show version information and quit --name=NAME name of the protein assayed (default=RBP) -o OUTPUT, --output=OUTPUT path where results are to be stored (default='RBPamp') --run-path=RUN pattern for run-folder name (default='run_{datestr}') --ranks=RANKS analyze these ranks out of the best n samples (by top R-value) default=1,2,3,4 --min-R=MIN_R minimal enrichment value of the (overall) most enriched 7-mer required to consider a sample at all (QC pass) default=1.1

RomoL2 commented 6 months ago

Ok that's good, so the problem is definitely from the R script. Two options: redownload from Github with devtools::install_github("RomoL2/RegVar") as I have now fixed the file Or you can manually add path_to_python to your file, which is named 'CharacterizeVariants_single_input.R', to after line 322: 321: ##fetch affinities---- 322: reticulate::source_python("RBPamp_aff_local.py") line to add: path_to_python<-reticulate::conda_list()[[2]][which(reticulate::conda_list()[[1]]=='RBPamp')]

On Tue, May 7, 2024 at 10:29 AM Alexei-Lipov @.***> wrote:

I do not know which line of code to add to which function. I guess you mean the def load_model(fname) in RBPamp_aff_local.py? But the line of code you suggested is R code, not Python code?

RBPamp successfully runs outside of R. Going to /extdata and running python RBPamp_aff_local.py also works, as you commented. I have not modified RBPamp_aff_local.py. See below:

(RBPamp) @. RegVar]$ cd extdata /home/lipova/rpackages/RegVar/extdata (RBPamp) @. extdata]$ ll total 6161511 -rw-r----- 1 lipova lipova 3037941 Jun 3 2022 all_APA_peak_coords_hg38.bed -rw-r----- 1 lipova lipova 216978153 May 12 2022 all_gd_UTR_vars.bed -rw-r----- 1 lipova lipova 41581296 Jun 3 2022 clinvar_for_script.bed -rw-r----- 1 lipova lipova 714276154 Jun 16 2021 eCLIP_GRCh38_reps_1_2_narrow_peak_ALL_RBP_cell_line_pairs.RBPs_with_amp_NEW_motifs.lines_assayed.lines_w_peak.NEW_aff_sum_peak_pm_10.in_top_motif.BY_BASE_BY_RBP.bed -rw-r----- 1 lipova lipova 34143837 Jun 3 2022 eCLIP_peaks.GRCh38.IDR_pass.main_chr.HepG2.full_name.bed -rw-r----- 1 lipova lipova 32023712 Jun 3 2022 eCLIP_peaks.GRCh38.IDR_pass.main_chr.K562.full_name.bed -rw-r----- 1 lipova lipova 71697049 Jan 10 2022 GTEx_v8_finemapping_DAPG_scottUTR_processed_expanded_miR_info.txt -rw-r----- 1 lipova lipova 52361208 Jan 5 2022 GTEx_v8_finemapping_DAPG_scottUTR_processed.txt -rw-r----- 1 lipova lipova 76411371 Jun 3 2022 GTEx_v8_finemapping_DAPG_UTR_for_script.bed -rw-r----- 1 lipova lipova 153119342 Jan 7 2022 gwas_scottUTRvars_processed.txt -rw-r----- 1 lipova lipova 41748790 Jun 3 2022 GWAS_UTR_for_script.bed -rw-r----- 1 lipova lipova 3273481150 Jan 16 2014 hg38.fa -rw-r----- 1 lipova lipova 19381 Feb 15 2021 hg38.fa.fai -rw-r----- 1 lipova lipova 554141098 Mar 12 2021 hg38_miR_predictions_final.bed -rw-r----- 1 lipova lipova 133094811 Jun 3 2022 hg38_miR_predictions_final.txt -rw-r----- 1 lipova lipova 885558777 Jun 3 2022 LR_all_APA_peak_coords_hg38_by_base.phylop_100.phylop_17.phastcons_100.phastcons_17.txt -rw-r----- 1 lipova lipova 45 May 7 16:13 merged_by_strand_nat_sorted_vcf_UTR_tmp.bed drwxr-x--- 2 lipova lipova 8192 May 6 18:50 motifs2 -rw-r----- 1 lipova lipova 59993 Feb 9 06:38 motifs2.gz -rw-r----- 1 lipova lipova 45 May 7 16:13 nat_sorted_vcf_UTR_tmp.bed -rw-r----- 1 lipova lipova 67 May 7 16:13 nat_sorted_vcf_UTR_tmp_intersected_expanded_RNA_strand_PLUS_k_for_seq2.bed -rw-r----- 1 lipova lipova 155 May 7 16:13 nat_sorted_vcf_UTR_tmp_intersected_expanded_RNA_strand_PLUS_k_for_seq2.txt drwxr-x--- 13 lipova lipova 4096 May 7 16:12 RBPamp -rw-r----- 1 lipova lipova 3572 May 7 15:49 RBPamp_aff_local.py -rw-r----- 1 lipova lipova 21920768 Feb 9 06:38 RBPamp.tar -rw-r----- 1 lipova lipova 3645048 Jun 2 2021 scott_vcf.bed.3pseq_intersected.txt -rw-r----- 1 lipova lipova 0 May 7 16:14 vars.full_seq.RBPamp_affs.motifs.tsv -rw-r----- 1 lipova lipova 92 May 7 16:13 vars.full_seq.txt -rw-r----- 1 lipova lipova 0 May 7 16:14 vars.k_10_seq.RBPamp_affs.motifs.tsv -rw-r----- 1 lipova lipova 24 May 7 16:13 vars.k_10_seq.txt -rw-r----- 1 lipova lipova 0 May 7 16:14 vars.k_11_seq.RBPamp_affs.motifs.tsv -rw-r----- 1 lipova lipova 46 May 7 16:13 vars.k_11_seq.txt -rw-r----- 1 lipova lipova 34 May 7 16:13 vcf.bed -rw-r----- 1 lipova lipova 99 May 7 16:13 vcf_UTR.bed -rw-r----- 1 lipova lipova 0 May 7 16:13 vcf_UTR_eqtls.bed -rw-r----- 1 lipova lipova 0 May 7 16:13 vcf_UTR_gwas.bed -rw-r----- 1 lipova lipova 209 May 7 16:13 vcf_UTR_miRs.bed -rw-r----- 1 lipova lipova 45 May 7 16:13 vcf_UTR_tmp.bed -rw-r----- 1 lipova lipova 0 May 7 16:13 vcf_UTR_tmp_hepg2.txt -rw-r----- 1 lipova lipova 0 May 7 16:13 vcf_UTR_tmp_k562.txt (RBPamp) @.*** extdata]$ python Python 3.7.12 | packaged by conda-forge | (default, Oct 26 2021, 06:08:21) [GCC 9.4.0] on linux Type "help", "copyright", "credits" or "license" for more information.

quit() (RBPamp) @.*** extdata]$ python RBPamp_aff_local.py processing TRNAU1AP.txt processing RBFOX2.txt processing CELF1.txt processing ILF2.txt processing RBM24.txt processing SRSF2.txt processing ESRP1.txt processing EIF4G2.txt processing RALY.txt processing PABPN1L.txt processing RBMS2.txt processing PRR3.txt processing TAF15.txt processing RBM47.txt processing RC3H1.txt processing NOVA1.txt processing KHDRBS2.txt processing PCBP1.txt processing RBMS3.txt processing SRSF5.txt processing SRSF9.txt processing UNK.txt processing HNRNPK.txt processing DAZAP1.txt processing FUS.txt processing ZFP36.txt processing BOLL.txt processing PCBP2.txt processing CNOT4.txt processing SFPQ.txt processing SF1.txt processing KHDRBS3.txt processing KHSRP.txt processing RBM4.txt processing SRSF8.txt processing PUM1.txt processing IGF2BP1.txt processing TIA1.txt processing ZCRB1.txt processing RBM45.txt processing MBNL1.txt processing RBFOX3.txt processing HNRNPA2B1.txt processing CPEB1.txt processing HNRNPD.txt processing RBM4B.txt processing RBM41.txt processing PUM2.txt processing SRSF11.txt processing ZNF326.txt processing RBM23.txt processing EWSR1.txt processing HNRNPF.txt processing A1CF.txt processing RBM6.txt processing RBM22.txt processing FUBP3.txt processing NUPL2.txt processing RBM15B.txt processing HNRNPH2.txt processing SRSF4.txt processing HNRNPL.txt processing ELAVL4.txt processing HNRNPA1.txt processing HNRNPC.txt processing MSI1.txt processing RBM25.txt processing IGF2BP2.txt processing PCBP4.txt processing PTBP3.txt processing FUBP1.txt processing HNRNPCL1.txt processing TARDBP.txt processing SNRPA.txt processing SRSF10.txt processing DAZ3.txt processing HNRNPA0.txt processing TRA2A.txt processing HNRNPDL.txt processing PUF60.txt

— Reply to this email directly, view it on GitHub https://github.com/RomoL2/RegVar/issues/12#issuecomment-2098545196, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZOARDAVT26ZJUWQLSBP553ZBDQODAVCNFSM6AAAAABHJKDISKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOJYGU2DKMJZGY . You are receiving this because you commented.Message ID: @.***>

RomoL2 commented 6 months ago

(If you redownload from GitHub I think you will also need to redownload the extdata files as well from zenodo which is the downside to that option).

On Tue, May 7, 2024 at 10:39 AM Lindsay Romo @.***> wrote:

Ok that's good, so the problem is definitely from the R script. Two options: redownload from Github with devtools::install_github("RomoL2/RegVar") as I have now fixed the file Or you can manually add path_to_python to your file, which is named 'CharacterizeVariants_single_input.R', to after line 322: 321: ##fetch affinities---- 322: reticulate::source_python("RBPamp_aff_local.py") line to add: path_to_python<-reticulate::conda_list()[[2]][which(reticulate::conda_list()[[1]]=='RBPamp')]

On Tue, May 7, 2024 at 10:29 AM Alexei-Lipov @.***> wrote:

I do not know which line of code to add to which function. I guess you mean the def load_model(fname) in RBPamp_aff_local.py? But the line of code you suggested is R code, not Python code?

RBPamp successfully runs outside of R. Going to /extdata and running python RBPamp_aff_local.py also works, as you commented. I have not modified RBPamp_aff_local.py. See below:

(RBPamp) @. RegVar]$ cd extdata /home/lipova/rpackages/RegVar/extdata (RBPamp) @. extdata]$ ll total 6161511 -rw-r----- 1 lipova lipova 3037941 Jun 3 2022 all_APA_peak_coords_hg38.bed -rw-r----- 1 lipova lipova 216978153 May 12 2022 all_gd_UTR_vars.bed -rw-r----- 1 lipova lipova 41581296 Jun 3 2022 clinvar_for_script.bed -rw-r----- 1 lipova lipova 714276154 Jun 16 2021 eCLIP_GRCh38_reps_1_2_narrow_peak_ALL_RBP_cell_line_pairs.RBPs_with_amp_NEW_motifs.lines_assayed.lines_w_peak.NEW_aff_sum_peak_pm_10.in_top_motif.BY_BASE_BY_RBP.bed -rw-r----- 1 lipova lipova 34143837 Jun 3 2022 eCLIP_peaks.GRCh38.IDR_pass.main_chr.HepG2.full_name.bed -rw-r----- 1 lipova lipova 32023712 Jun 3 2022 eCLIP_peaks.GRCh38.IDR_pass.main_chr.K562.full_name.bed -rw-r----- 1 lipova lipova 71697049 Jan 10 2022 GTEx_v8_finemapping_DAPG_scottUTR_processed_expanded_miR_info.txt -rw-r----- 1 lipova lipova 52361208 Jan 5 2022 GTEx_v8_finemapping_DAPG_scottUTR_processed.txt -rw-r----- 1 lipova lipova 76411371 Jun 3 2022 GTEx_v8_finemapping_DAPG_UTR_for_script.bed -rw-r----- 1 lipova lipova 153119342 Jan 7 2022 gwas_scottUTRvars_processed.txt -rw-r----- 1 lipova lipova 41748790 Jun 3 2022 GWAS_UTR_for_script.bed -rw-r----- 1 lipova lipova 3273481150 Jan 16 2014 hg38.fa -rw-r----- 1 lipova lipova 19381 Feb 15 2021 hg38.fa.fai -rw-r----- 1 lipova lipova 554141098 Mar 12 2021 hg38_miR_predictions_final.bed -rw-r----- 1 lipova lipova 133094811 Jun 3 2022 hg38_miR_predictions_final.txt -rw-r----- 1 lipova lipova 885558777 Jun 3 2022 LR_all_APA_peak_coords_hg38_by_base.phylop_100.phylop_17.phastcons_100.phastcons_17.txt -rw-r----- 1 lipova lipova 45 May 7 16:13 merged_by_strand_nat_sorted_vcf_UTR_tmp.bed drwxr-x--- 2 lipova lipova 8192 May 6 18:50 motifs2 -rw-r----- 1 lipova lipova 59993 Feb 9 06:38 motifs2.gz -rw-r----- 1 lipova lipova 45 May 7 16:13 nat_sorted_vcf_UTR_tmp.bed -rw-r----- 1 lipova lipova 67 May 7 16:13 nat_sorted_vcf_UTR_tmp_intersected_expanded_RNA_strand_PLUS_k_for_seq2.bed -rw-r----- 1 lipova lipova 155 May 7 16:13 nat_sorted_vcf_UTR_tmp_intersected_expanded_RNA_strand_PLUS_k_for_seq2.txt drwxr-x--- 13 lipova lipova 4096 May 7 16:12 RBPamp -rw-r----- 1 lipova lipova 3572 May 7 15:49 RBPamp_aff_local.py -rw-r----- 1 lipova lipova 21920768 Feb 9 06:38 RBPamp.tar -rw-r----- 1 lipova lipova 3645048 Jun 2 2021 scott_vcf.bed.3pseq_intersected.txt -rw-r----- 1 lipova lipova 0 May 7 16:14 vars.full_seq.RBPamp_affs.motifs.tsv -rw-r----- 1 lipova lipova 92 May 7 16:13 vars.full_seq.txt -rw-r----- 1 lipova lipova 0 May 7 16:14 vars.k_10_seq.RBPamp_affs.motifs.tsv -rw-r----- 1 lipova lipova 24 May 7 16:13 vars.k_10_seq.txt -rw-r----- 1 lipova lipova 0 May 7 16:14 vars.k_11_seq.RBPamp_affs.motifs.tsv -rw-r----- 1 lipova lipova 46 May 7 16:13 vars.k_11_seq.txt -rw-r----- 1 lipova lipova 34 May 7 16:13 vcf.bed -rw-r----- 1 lipova lipova 99 May 7 16:13 vcf_UTR.bed -rw-r----- 1 lipova lipova 0 May 7 16:13 vcf_UTR_eqtls.bed -rw-r----- 1 lipova lipova 0 May 7 16:13 vcf_UTR_gwas.bed -rw-r----- 1 lipova lipova 209 May 7 16:13 vcf_UTR_miRs.bed -rw-r----- 1 lipova lipova 45 May 7 16:13 vcf_UTR_tmp.bed -rw-r----- 1 lipova lipova 0 May 7 16:13 vcf_UTR_tmp_hepg2.txt -rw-r----- 1 lipova lipova 0 May 7 16:13 vcf_UTR_tmp_k562.txt (RBPamp) @.*** extdata]$ python Python 3.7.12 | packaged by conda-forge | (default, Oct 26 2021, 06:08:21) [GCC 9.4.0] on linux Type "help", "copyright", "credits" or "license" for more information.

quit() (RBPamp) @.*** extdata]$ python RBPamp_aff_local.py processing TRNAU1AP.txt processing RBFOX2.txt processing CELF1.txt processing ILF2.txt processing RBM24.txt processing SRSF2.txt processing ESRP1.txt processing EIF4G2.txt processing RALY.txt processing PABPN1L.txt processing RBMS2.txt processing PRR3.txt processing TAF15.txt processing RBM47.txt processing RC3H1.txt processing NOVA1.txt processing KHDRBS2.txt processing PCBP1.txt processing RBMS3.txt processing SRSF5.txt processing SRSF9.txt processing UNK.txt processing HNRNPK.txt processing DAZAP1.txt processing FUS.txt processing ZFP36.txt processing BOLL.txt processing PCBP2.txt processing CNOT4.txt processing SFPQ.txt processing SF1.txt processing KHDRBS3.txt processing KHSRP.txt processing RBM4.txt processing SRSF8.txt processing PUM1.txt processing IGF2BP1.txt processing TIA1.txt processing ZCRB1.txt processing RBM45.txt processing MBNL1.txt processing RBFOX3.txt processing HNRNPA2B1.txt processing CPEB1.txt processing HNRNPD.txt processing RBM4B.txt processing RBM41.txt processing PUM2.txt processing SRSF11.txt processing ZNF326.txt processing RBM23.txt processing EWSR1.txt processing HNRNPF.txt processing A1CF.txt processing RBM6.txt processing RBM22.txt processing FUBP3.txt processing NUPL2.txt processing RBM15B.txt processing HNRNPH2.txt processing SRSF4.txt processing HNRNPL.txt processing ELAVL4.txt processing HNRNPA1.txt processing HNRNPC.txt processing MSI1.txt processing RBM25.txt processing IGF2BP2.txt processing PCBP4.txt processing PTBP3.txt processing FUBP1.txt processing HNRNPCL1.txt processing TARDBP.txt processing SNRPA.txt processing SRSF10.txt processing DAZ3.txt processing HNRNPA0.txt processing TRA2A.txt processing HNRNPDL.txt processing PUF60.txt

— Reply to this email directly, view it on GitHub https://github.com/RomoL2/RegVar/issues/12#issuecomment-2098545196, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZOARDAVT26ZJUWQLSBP553ZBDQODAVCNFSM6AAAAABHJKDISKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOJYGU2DKMJZGY . You are receiving this because you commented.Message ID: @.***>

Alexei-Lipov commented 6 months ago

Ok, thanks, I'm going to delete everything, remove the conda environment and re-install everything. I'll get back to you soon

Alexei-Lipov commented 6 months ago

Apologies for the bad news, but I still get the same error

Alexei-Lipov commented 6 months ago

To confirm that the new line has been added. I went into R and ran body(CharacterizeVariants_single_input). Then scrolling down, I indeed found

    rm(temp_seq)
    reticulate::source_python("RBPamp_aff_local.py")
    path_to_python <- reticulate::conda_list()[[2]][which(reticulate::conda_list()[[1]] ==
        "RBPamp")]
    reticulate::use_python(path_to_python, required = TRUE)
    reticulate::use_condaenv("RBPamp", required = TRUE)
    reticulate::source_python("RBPamp_aff_local.py")

Then, running the function gives the same RBPamp.params error:

CharacterizeVariants_single_input('~/')
Enter 3'UTR single nucleotide variant chromosome number: 3
Enter variant position in 1-based coordinates: 38549707
Enter hg38 reference base (capitalized) at variant position: C
Enter variant base (capitalized): T
Enter a name for this variant (no spaces): test
gzip: motifs2 already exists; do you wish to overwrite (y or n)? y
gzip: motifs2: Is a directory
[1] "incorporating eCLIP"
[1] "incorporating eQTLS"
[1] "incorporating GWAS"
[1] "incorporating microRNAs"
[1] "incorporating RBP motifs"
processing TRNAU1AP.txt
Error in py_run_file_impl(file, local, convert) :
  ModuleNotFoundError: No module named 'RBPamp.params'
Run `reticulate::py_last_error()` for details.
RomoL2 commented 6 months ago

If you run these lines in R outside the function what happens? I feel this will be an easy fix but unfortunately I can’t work on it until Friday.

On Wed, May 8, 2024 at 6:12 AM Alexei-Lipov @.***> wrote:

To confirm that the new line has been added. I went into R and ran body(CharacterizeVariants_single_input). Then scrolling down, I indeed found

rm(temp_seq) reticulate::source_python("RBPamp_aff_local.py") path_to_python <- reticulate::conda_list()[[2]][which(reticulate::conda_list()[[1]] == "RBPamp")] reticulate::use_python(path_to_python, required = TRUE) reticulate::use_condaenv("RBPamp", required = TRUE) reticulate::source_python("RBPamp_aff_local.py")

— Reply to this email directly, view it on GitHub https://github.com/RomoL2/RegVar/issues/12#issuecomment-2100236135, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZOARDBL4T6TQR7A7D4OZKDZBH3A5AVCNFSM6AAAAABHJKDISKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMBQGIZTMMJTGU . You are receiving this because you commented.Message ID: @.***>

Alexei-Lipov commented 6 months ago

It worked!

(RBPamp) [lipova@tcn358 extdata]$ R

R version 4.3.2 (2023-10-31) -- "Eye Holes"
Copyright (C) 2023 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(RegVar)
> path_to_python <- reticulate::conda_list()[[2]][which(reticulate::conda_list()[[1]] ==
        "RBPamp")]
> reticulate::use_python(path_to_python, required = TRUE)
> CharacterizeVariants_single_input('~/')
Enter 3'UTR single nucleotide variant chromosome number: 3
Enter variant position in 1-based coordinates: 38549707
Enter hg38 reference base (capitalized) at variant position: C
Enter variant base (capitalized): T
Enter a name for this variant (no spaces): test
gzip: motifs2 already exists; do you wish to overwrite (y or n)? y
gzip: motifs2: Is a directory
[1] "incorporating eCLIP"
[1] "incorporating eQTLS"
[1] "incorporating GWAS"
[1] "incorporating microRNAs"
[1] "incorporating RBP motifs"
processing TRNAU1AP.txt
processing RBFOX2.txt

Many thanks for fixing this for me!